Improve hook reliability - fixes GMalloc nullptr and proper alloc size

This commit is contained in:
AeonLucid
2021-10-30 23:31:56 +02:00
parent 341c8de5ba
commit afb082ee88
3 changed files with 15 additions and 10 deletions
+1 -4
View File
@@ -38,10 +38,7 @@ DWORD WINAPI OnDllAttach(LPVOID base)
const auto hModulePtr = reinterpret_cast<uintptr_t>(hModule);
// Initialize GMalloc.
do
{
SDK::GMalloc = *reinterpret_cast<SDK::FMalloc**>(hModulePtr + OffsetGMalloc);
} while (SDK::GMalloc == nullptr);
SDK::GMalloc = reinterpret_cast<SDK::FMalloc**>(hModulePtr + OffsetGMalloc);
// Initialize MinHook.
if (MH_Initialize() != MH_OK)