bool found = false; size_t searchLen = searchString.length(); size_t searchWidth = fileSize - searchLen + 1; for(size_t i=0; i(memFile[i+j]) ^ xorOffset; if(currChar != static_cast(searchString[j])) { match = false; break; } } if(match) { found = true; cout << "Found at offset: " << i << "\t(0x" << dec2hex(i) << ")" << endl; } } if(!found) cout << "String not found." << endl; system("pause");