MCPcopy Create free account
hub / github.com/Wemino/EchoPatch / LoadGameDLL_Hook

Function LoadGameDLL_Hook

src/Engine/Engine.cpp:601–627  ·  view source on GitHub ↗

When the game is loading the Client or Server

Source from the content-addressed store, hash-verified

599
600// When the game is loading the Client or Server
601static intptr_t __cdecl LoadGameDLL_Hook(char* FileName, char a2, DWORD* a3)
602{
603 intptr_t result = LoadGameDLL(FileName, a2, a3);
604
605 // Convert FileName to wide string
606 wchar_t wFileName[MAX_PATH];
607 MultiByteToWideChar(CP_ACP, 0, FileName, -1, wFileName, MAX_PATH);
608
609 // Use FileName to get the module handle
610 HMODULE ApiDLL = GetModuleHandleW(wFileName);
611 if (ApiDLL)
612 {
613 if (!g_State.isClientLoaded) // First time is client
614 {
615 g_State.GameClient = ApiDLL;
616 g_State.isClientLoaded = true;
617 ApplyClientPatch();
618 }
619 else // Otherwise server
620 {
621 g_State.GameServer = ApiDLL;
622 ApplyServerPatch();
623 }
624 }
625
626 return result;
627}
628
629static int __stdcall SetConsoleVariableFloat_Hook(const char* pszVarName, float fValue)
630{

Callers

nothing calls this directly

Calls 2

ApplyClientPatchFunction · 0.85
ApplyServerPatchFunction · 0.85

Tested by

no test coverage detected