|
29 | 29 | MovementUnlocker g_MovementUnlocker; |
30 | 30 |
|
31 | 31 | #ifdef _WIN32 |
32 | | -const unsigned char *pPatchSignature = (unsigned char *)"\x76\x2A\xF2\x0F\x10\x4E\x2A\x41\x0F\x28\xD2\x0F\x28\xC1"; |
33 | | -const char *pPatchPattern = "x?xxxx?xxxxxxx"; |
34 | | -int PatchLen = 1; |
| 32 | +const unsigned char *pPatchSignature = (unsigned char *)"\x0F\x86\xB8\x2A\x2A\x2A\xF3\x0F\x58\xD4"; |
| 33 | +const char *pPatchPattern = "xxx???xxxx"; |
| 34 | +int PatchLen = 6; |
35 | 35 | #elif __linux__ |
36 | | -const unsigned char * pPatchSignature = (unsigned char *)"\x0F\x87\x2A\x2A\x2A\x2A\x49\x8B\x7C\x24\x2A\x48\x85\xFF"; |
37 | | -const char* pPatchPattern = "xx????xxxx?xxx"; |
| 36 | +const unsigned char * pPatchSignature = (unsigned char *)"\x0F\x87\x2A\x2A\x2A\x2A\xF3\x0F\x10\x3D\x2A\x2A\x2A\x2A\xF3\x0F\x11\xBD"; |
| 37 | +const char* pPatchPattern = "xx????xxxx????xxxx"; |
38 | 38 | int PatchLen = 6; |
39 | 39 | #endif |
40 | 40 |
|
@@ -113,7 +113,10 @@ bool MovementUnlocker::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxl |
113 | 113 | SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_WRITE | SH_MEM_EXEC); |
114 | 114 |
|
115 | 115 | #ifdef _WIN32 |
116 | | - *(unsigned char*)(pPatchAddress) = ((unsigned char*)"\xEB")[0]; |
| 116 | + const char* patchBytes[] = {"\xE9", "\xB9", "\x00", "\x00", "\x00", "\x90"}; |
| 117 | + |
| 118 | + for (int i = 0; i < PatchLen; i++) |
| 119 | + *(unsigned char*)(pPatchAddress + i) = ((unsigned char*)patchBytes[i])[0]; |
117 | 120 | #elif __linux__ |
118 | 121 | for (int i = 0; i < PatchLen; i++) |
119 | 122 | *(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\x90")[0]; |
@@ -151,7 +154,7 @@ const char *MovementUnlocker::GetLicense() |
151 | 154 |
|
152 | 155 | const char *MovementUnlocker::GetVersion() |
153 | 156 | { |
154 | | - return "1.5"; |
| 157 | + return "1.6"; |
155 | 158 | } |
156 | 159 |
|
157 | 160 | const char *MovementUnlocker::GetDate() |
|
0 commit comments