diff --git a/src/Components/Modules/Security.cpp b/src/Components/Modules/Security.cpp index 07193220..e0565e24 100644 --- a/src/Components/Modules/Security.cpp +++ b/src/Components/Modules/Security.cpp @@ -120,6 +120,11 @@ namespace Components InterlockedIncrement(&Game::deferredQueue->send); } + void Security::SEH_LocalizeTextMessageStub(char* dest, const char* src, [[maybe_unused]] int destsize) + { + Game::I_strncpyz(dest, src, 1024); + } + Security::Security() { // Exploit fixes @@ -147,5 +152,8 @@ namespace Components // Fix packets causing buffer overflow Utils::Hook(0x6267E3, NET_DeferPacketToClientStub, HOOK_CALL).install()->quick(); + + // Use the correct size for the destination buffer + Utils::Hook(0x49D548, SEH_LocalizeTextMessageStub, HOOK_CALL).install()->quick(); } } diff --git a/src/Components/Modules/Security.hpp b/src/Components/Modules/Security.hpp index 23ceb4d6..b0270bbe 100644 --- a/src/Components/Modules/Security.hpp +++ b/src/Components/Modules/Security.hpp @@ -22,5 +22,7 @@ namespace Components static void G_LogPrintfStub(const char* fmt); static void NET_DeferPacketToClientStub(Game::netadr_t* net_from, Game::msg_t* net_message); + + static void SEH_LocalizeTextMessageStub(char* dest, const char* src, int destsize); }; } diff --git a/src/DllMain.cpp b/src/DllMain.cpp index fa4d6498..5860b701 100644 --- a/src/DllMain.cpp +++ b/src/DllMain.cpp @@ -48,6 +48,7 @@ BOOL APIENTRY DllMain(HINSTANCE /*hinstDLL*/, DWORD fdwReason, LPVOID /*lpvReser { if (fdwReason == DLL_PROCESS_ATTACH) { + SetProcessDEPPolicy(PROCESS_DEP_ENABLE); Steam::Proxy::RunMod(); #ifndef DISABLE_BINARY_CHECK