diff options
Diffstat (limited to 'primedev/shared')
-rw-r--r-- | primedev/shared/exploit_fixes/exploitfixes.cpp | 8 | ||||
-rw-r--r-- | primedev/shared/exploit_fixes/exploitfixes_utf8parser.cpp | 6 | ||||
-rw-r--r-- | primedev/shared/keyvalues.cpp | 6 | ||||
-rw-r--r-- | primedev/shared/maxplayers.cpp | 4 |
4 files changed, 12 insertions, 12 deletions
diff --git a/primedev/shared/exploit_fixes/exploitfixes.cpp b/primedev/shared/exploit_fixes/exploitfixes.cpp index cade4084..7850f7b0 100644 --- a/primedev/shared/exploit_fixes/exploitfixes.cpp +++ b/primedev/shared/exploit_fixes/exploitfixes.cpp @@ -103,7 +103,7 @@ bool, __fastcall, (void* pMsg)) // 48 8B D1 48 8B 49 18 48 8B 01 48 FF 60 10 auto entry = msg->m_ConVars + i; // Safety check for memory access - if (CMemoryAddress(entry).IsMemoryReadable(sizeof(*entry))) + if (CMemory(entry).IsMemoryReadable(sizeof(*entry))) { // Find null terminators bool nameValid = false, valValid = false; @@ -421,9 +421,9 @@ ON_DLL_LOAD("engine.dll", EngineExploitFixes, (CModule module)) // patch to set bWasWritingStringTableSuccessful in CNetworkStringTableContainer::WriteBaselines if it fails { - CMemoryAddress writeAddress(&bWasWritingStringTableSuccessful - module.Offset(0x234EDC).m_nAddress); + CMemory writeAddress(&bWasWritingStringTableSuccessful - module.Offset(0x234EDC).GetPtr()); - CMemoryAddress addr = module.Offset(0x234ED2); + CMemory addr = module.Offset(0x234ED2); addr.Patch("C7 05"); addr.Offset(2).Patch((BYTE*)&writeAddress, sizeof(writeAddress)); @@ -451,7 +451,7 @@ ON_DLL_LOAD_RELIESON("server.dll", ServerExploitFixes, ConVar, (CModule module)) // Prevent these from actually doing anything for (auto exportName : ANTITAMPER_EXPORTS) { - CMemoryAddress exportAddr = module.GetExport(exportName); + CMemory exportAddr = module.GetExportedFunction(exportName); if (exportAddr) { // Just return, none of them have any args or are userpurge diff --git a/primedev/shared/exploit_fixes/exploitfixes_utf8parser.cpp b/primedev/shared/exploit_fixes/exploitfixes_utf8parser.cpp index 3d97f750..d63ba38a 100644 --- a/primedev/shared/exploit_fixes/exploitfixes_utf8parser.cpp +++ b/primedev/shared/exploit_fixes/exploitfixes_utf8parser.cpp @@ -67,7 +67,7 @@ bool __fastcall CheckUTF8Valid(INT64* a1, DWORD* a2, char* strData) { while (1) { - if (!CMemoryAddress(v4).IsMemoryReadable(1)) + if (!CMemory(v4).IsMemoryReadable(1)) return false; // INVALID v11 = *v4++; // crash potential @@ -174,7 +174,7 @@ AUTOHOOK(Rson_ParseUTF8, engine.dll + 0xEF670, bool, __fastcall, (INT64* a1, DWORD* a2, char* strData)) // 48 89 5C 24 ? 48 89 6C 24 ? 48 89 74 24 ? 57 41 54 41 55 41 56 41 57 48 83 EC 20 8B 1A // clang-format on { - static void* targetRetAddr = CModule("engine.dll").FindPattern("84 C0 75 2C 49 8B 16"); + static void* targetRetAddr = CModule("engine.dll").FindPatternSIMD("84 C0 75 2C 49 8B 16"); // only call if we're parsing utf8 data from the network (i.e. communities), otherwise we get perf issues void* pReturnAddress = @@ -195,5 +195,5 @@ ON_DLL_LOAD("engine.dll", EngineExploitFixes_UTF8Parser, (CModule module)) { AUTOHOOK_DISPATCH() - sub_F1320 = module.FindPattern("83 F9 7F 77 08 88 0A").RCast<INT64(__fastcall*)(DWORD, char*)>(); + sub_F1320 = module.FindPatternSIMD("83 F9 7F 77 08 88 0A").RCast<INT64(__fastcall*)(DWORD, char*)>(); } diff --git a/primedev/shared/keyvalues.cpp b/primedev/shared/keyvalues.cpp index 88753723..36f891eb 100644 --- a/primedev/shared/keyvalues.cpp +++ b/primedev/shared/keyvalues.cpp @@ -1289,9 +1289,9 @@ KeyValues* KeyValues::MakeCopy(void) const ON_DLL_LOAD("vstdlib.dll", KeyValues, (CModule module)) { - V_UTF8ToUnicode = module.GetExport("V_UTF8ToUnicode").RCast<int (*)(const char*, wchar_t*, int)>(); - V_UnicodeToUTF8 = module.GetExport("V_UnicodeToUTF8").RCast<int (*)(const wchar_t*, char*, int)>(); - KeyValuesSystem = module.GetExport("KeyValuesSystem").RCast<CKeyValuesSystem* (*)()>(); + V_UTF8ToUnicode = module.GetExportedFunction("V_UTF8ToUnicode").RCast<int (*)(const char*, wchar_t*, int)>(); + V_UnicodeToUTF8 = module.GetExportedFunction("V_UnicodeToUTF8").RCast<int (*)(const wchar_t*, char*, int)>(); + KeyValuesSystem = module.GetExportedFunction("KeyValuesSystem").RCast<CKeyValuesSystem* (*)()>(); } AUTOHOOK_INIT() diff --git a/primedev/shared/maxplayers.cpp b/primedev/shared/maxplayers.cpp index 711193d4..69d625f2 100644 --- a/primedev/shared/maxplayers.cpp +++ b/primedev/shared/maxplayers.cpp @@ -60,7 +60,7 @@ int GetMaxPlayers() return 32; } -template <class T> void ChangeOffset(CMemoryAddress addr, unsigned int offset) +template <class T> void ChangeOffset(CMemory addr, unsigned int offset) { addr.Patch((BYTE*)&offset, sizeof(T)); } @@ -296,7 +296,7 @@ ON_DLL_LOAD("server.dll", MaxPlayersOverride_Server, (CModule module)) AUTOHOOK_DISPATCH_MODULE(server.dll) // get required data - serverBase = (HMODULE)module.m_nAddress; + serverBase = (HMODULE)module.GetModuleBase(); RandomIntZeroMax = (decltype(RandomIntZeroMax))(GetProcAddress(GetModuleHandleA("vstdlib.dll"), "RandomIntZeroMax")); // patch max players amount |