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

Function DEditLoadModule_Hook

src/Client/Client.cpp:1971–1990  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1969}
1970
1971static bool __stdcall DEditLoadModule_Hook(const char* pszProjectPath)
1972{
1973 // Load StringEditRuntime.dll
1974 bool res = DEditLoadModule(pszProjectPath);
1975
1976 // Get and hook 'LoadString'
1977 DWORD addr = ScanModuleSignature(g_State.GameClient, "8B 4C 24 18 03 C1 8B 0D ?? ?? ?? ?? 03 F7 85 C9", "LoadString", -1, false);
1978
1979 if (addr != 0)
1980 {
1981 int StringEditRuntimePtr = MemoryHelper::ReadMemory<int>(addr + 0x8);
1982 int StringEditRuntime = MemoryHelper::ReadMemory<int>(StringEditRuntimePtr);
1983 int vTable = MemoryHelper::ReadMemory<int>(StringEditRuntime);
1984 int pLoadString = MemoryHelper::ReadMemory<int>(vTable + 0x1C);
1985
1986 HookHelper::ApplyHook((void*)pLoadString, &LoadGameString_Hook, (LPVOID*)&LoadGameString);
1987 }
1988
1989 return res;
1990}
1991
1992// =======================
1993// ConsoleEnabled

Callers

nothing calls this directly

Calls 2

ScanModuleSignatureFunction · 0.85
ApplyHookFunction · 0.85

Tested by

no test coverage detected