From 2ce756c9a07f75a0ce6e7654631dc19ed1c35352 Mon Sep 17 00:00:00 2001 From: momo5502 Date: Fri, 19 Oct 2018 22:58:33 +0200 Subject: [PATCH] [Main] Check the whole .text section on startup This should prevent all binary-modification cheats from working --- src/Main.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Main.cpp b/src/Main.cpp index 08919017..2ccb30ed 100644 --- a/src/Main.cpp +++ b/src/Main.cpp @@ -55,7 +55,12 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l Steam::Proxy::RunMod(); // Ensure we're working with our desired binary - if (Utils::Hook::Get(0x4C0FFF) != 0x6824748B) return FALSE; + char* module = reinterpret_cast(GetModuleHandle(nullptr)); + auto hash = Utils::Cryptography::JenkinsOneAtATime::Compute(module, 0x2D6000); + if (hash != 0x1678FD9F) + { + return FALSE; + } #ifndef DISABLE_ANTICHEAT []() @@ -69,7 +74,6 @@ BOOL APIENTRY DllMain(HMODULE /*hModule*/, DWORD ul_reason_for_call, LPVOID /*l #endif DWORD oldProtect; - std::uint8_t* module = reinterpret_cast(GetModuleHandle(nullptr)); VirtualProtect(module + 0x1000, 0x2D6000, PAGE_EXECUTE_READ, &oldProtect); // Protect the .text segment // Install entry point hook