Fix bug in localized strings code

This commit is contained in:
Diavolo 2022-08-31 16:40:17 +02:00 committed by Maurice Heumann
parent 0a1c1209bb
commit d0932060b4
3 changed files with 11 additions and 0 deletions

View File

@ -120,6 +120,11 @@ namespace Components
InterlockedIncrement(&Game::deferredQueue->send); 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() Security::Security()
{ {
// Exploit fixes // Exploit fixes
@ -147,5 +152,8 @@ namespace Components
// Fix packets causing buffer overflow // Fix packets causing buffer overflow
Utils::Hook(0x6267E3, NET_DeferPacketToClientStub, HOOK_CALL).install()->quick(); 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();
} }
} }

View File

@ -22,5 +22,7 @@ namespace Components
static void G_LogPrintfStub(const char* fmt); static void G_LogPrintfStub(const char* fmt);
static void NET_DeferPacketToClientStub(Game::netadr_t* net_from, Game::msg_t* net_message); 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);
}; };
} }

View File

@ -48,6 +48,7 @@ BOOL APIENTRY DllMain(HINSTANCE /*hinstDLL*/, DWORD fdwReason, LPVOID /*lpvReser
{ {
if (fdwReason == DLL_PROCESS_ATTACH) if (fdwReason == DLL_PROCESS_ATTACH)
{ {
SetProcessDEPPolicy(PROCESS_DEP_ENABLE);
Steam::Proxy::RunMod(); Steam::Proxy::RunMod();
#ifndef DISABLE_BINARY_CHECK #ifndef DISABLE_BINARY_CHECK