1 #include "Windows.h" 2 #include "tlhelp32.h" 3 #include "String.h" 4 #include "Shlwapi.h" 5 #include "iostream" 6 #include "map" 7 using namespace std; 8 9 HANDLE hProcess; 10 LPVOID lp_address; 11 LPVOID lp_ret_value_address; 12 DWORD lp_ret_jmp, calladd; 13 DWORD lp_to_jmp; 14 15 template <typename T> 16 T Read(LPVOID Address) 17 { 18 T Data; 19 ReadProcessMemory(hProcess, (LPVOID)Address, &Data, sizeof(T), nullptr); 20 return Data; 21 } 22 23 uintptr_t FindPattern(uintptr_t start, uintptr_t length, const unsigned char* pattern, const char* mask) 24 { 25 size_t pos = 0; 26 auto maskLength = strlen(mask) - 1; 27 28 auto startAdress = start; 29 for (auto it = startAdress; it < startAdress + length; ++it) 30 { 31 if (Read<unsigned char>(LPVOID(it)) == pattern[pos] || mask[pos] == '?') 32 { 33 if (mask[pos + 1] == '