Update patches for recent CS2 updates

This commit is contained in:
Vauff 2025-09-19 01:40:49 -04:00
parent 3e7176fe75
commit ce00eec29c

View file

@ -29,12 +29,12 @@
MovementUnlocker g_MovementUnlocker; MovementUnlocker g_MovementUnlocker;
#ifdef _WIN32 #ifdef _WIN32
const unsigned char *pPatchSignature = (unsigned char *)"\x76\x2A\xF2\x0F\x10\x4E\x2A\x41\x0F\x28\xD2\x0F\x28\xC1"; const unsigned char *pPatchSignature = (unsigned char *)"\x0F\x86\xB8\x2A\x2A\x2A\xF3\x0F\x58\xD4";
const char *pPatchPattern = "x?xxxx?xxxxxxx"; const char *pPatchPattern = "xxx???xxxx";
int PatchLen = 1; int PatchLen = 6;
#elif __linux__ #elif __linux__
const unsigned char * pPatchSignature = (unsigned char *)"\x0F\x87\x2A\x2A\x2A\x2A\x49\x8B\x7C\x24\x2A\x48\x85\xFF"; const unsigned char * pPatchSignature = (unsigned char *)"\x0F\x87\x2A\x2A\x2A\x2A\xF3\x0F\x10\x3D\x2A\x2A\x2A\x2A\xF3\x0F\x11\xBD";
const char* pPatchPattern = "xx????xxxx?xxx"; const char* pPatchPattern = "xx????xxxx????xxxx";
int PatchLen = 6; int PatchLen = 6;
#endif #endif
@ -113,7 +113,10 @@ bool MovementUnlocker::Load(PluginId id, ISmmAPI *ismm, char *error, size_t maxl
SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_WRITE | SH_MEM_EXEC); SourceHook::SetMemAccess((void*)pPatchAddress, PatchLen, SH_MEM_READ | SH_MEM_WRITE | SH_MEM_EXEC);
#ifdef _WIN32 #ifdef _WIN32
*(unsigned char*)(pPatchAddress) = ((unsigned char*)"\xEB")[0]; const char* patchBytes[] = {"\xE9", "\xB9", "\x00", "\x00", "\x00", "\x90"};
for (int i = 0; i < PatchLen; i++)
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)patchBytes[i])[0];
#elif __linux__ #elif __linux__
for (int i = 0; i < PatchLen; i++) for (int i = 0; i < PatchLen; i++)
*(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\x90")[0]; *(unsigned char*)(pPatchAddress + i) = ((unsigned char*)"\x90")[0];
@ -151,7 +154,7 @@ const char *MovementUnlocker::GetLicense()
const char *MovementUnlocker::GetVersion() const char *MovementUnlocker::GetVersion()
{ {
return "1.5"; return "1.6";
} }
const char *MovementUnlocker::GetDate() const char *MovementUnlocker::GetDate()