Skip to content

Commit ce00eec

Browse files
committed
Update patches for recent CS2 updates
1 parent 3e7176f commit ce00eec

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

MovementUnlocker.cpp

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@
2929
MovementUnlocker g_MovementUnlocker;
3030

3131
#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;
3535
#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";
3838
int PatchLen = 6;
3939
#endif
4040

@@ -113,7 +113,10 @@ bool MovementUnlocker::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxl
113113
SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_WRITE | SH_MEM_EXEC);
114114

115115
#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];
117120
#elif __linux__
118121
for (int i = 0; i < PatchLen; i++)
119122
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\x90")[0];
@@ -151,7 +154,7 @@ const char *MovementUnlocker::GetLicense()
151154

152155
const char *MovementUnlocker::GetVersion()
153156
{
154-
return "1.5";
157+
return "1.6";
155158
}
156159

157160
const char *MovementUnlocker::GetDate()

0 commit comments

Comments
 (0)