


int Load_PID_List()
{
	if (debugging == 1) Debug << L"ReadRulesDataTable Fired" << endl;
	GetRulesFileName();
	if (debugging == 1) Debug << L"ReadRulesDataTable RulesFileName-> " << RulesFileName<< endl;
	wifstream Rules(RulesFileName);	
	if (!Rules.is_open()) {
		if (debugging == 1) Debug << L"ReadRulesDataTable Rules.bad()" << endl;
	} else {
	   if (debugging == 1) Debug << L"ReadRulesDataTable Rules.good()" << endl;
	}
	wstring HexRead = L"";
	wstring Line;
	size_t loc1 = 0;
	size_t loc2 = 0;
	size_t loc3 = 0;
	size_t loc4 = 0;
	int one = 0;
	int two = 0;
	if (debugging == 1) Debug << L"ReadRulesDataTable before GetLine Loop" << endl;
	while ( getline(Rules, Line) ) {
		if (debugging == 1) Debug << L"ReadRulesDataTable GetLine Loop" << endl;
		loc1 = Line.find(L"[REPLACE WORDS]");
		if (loc1!=string::npos) {
			if (debugging == 1) Debug << L"found [REPLACE WORDS]" << endl;
			if (one == 0) {
				for (int j = 0;j < 150;j++) {
					one = 1;
					if (debugging == 1) Debug << L" ReadRulesDataTable " << L" in loop j " << j << endl;
					getline(Rules, Line);
					loc1 = Line.find('"');
					if (loc1!=string::npos) {
						loc2 = Line.find('"',loc1+1);
						if (loc2!=string::npos) {
							HexRead = Line.substr(loc1+1,loc2 - loc1 - 1);
							if (debugging == 1) Debug << L" ReadRulesDataTable " << L" in loop j " << j << L" HexRead " << HexRead << L" Step 0 " << endl;
							if (debugging == 1) Debug << HexRead << L" Step 0 " << endl;
							StringsArray[j][0] = HexRead;
							if (debugging == 1) Debug << L" ReadRulesDataTable " << L" in loop j " << j << L" StringsArray[j][0] " << StringsArray[j][0] << L" Step 1 " << endl;
							HexRead = L"";
							loc3 = Line.find('"',loc2+3);
							if (loc3!=string::npos) {
								loc4 = Line.find('"',loc3+1);
								if (loc4!=string::npos) {
									HexRead = Line.substr(loc3+1,loc4 - loc3 - 1);
									if (debugging == 1) Debug << HexRead << L" Step 1 " << j << endl;
									StringsArray[j][1] = HexRead;
									if (debugging == 1) Debug << L" ReadRulesDataTable HexRead" << L" in loop j " << j << L" HexRead " << HexRead << L" Step 1 " << endl;
									HexRead = L"";
									if (debugging == 1) Debug << L" ReadRulesDataTable Array" << L" in loop j " << j << L" StringsArray[j][1] " << StringsArray[j][1] << L" Step 1 " << endl;
								}
							}
						}
					}
				}
			}
		}
	}
	Rules.close();

	if (debugging == 1) Debug << L" ReadRulesDataTable " << L" completed " << L" " << L" " << endl;
	return 1;
}