From d2fe290b968434bcbad80ee5dac10a4730aec7e9 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Mon, 14 Oct 2024 18:10:47 +0800 Subject: [PATCH] [saco] Implement/match `GenTaskAlloc_Hook()` --- saco/game/hooks.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/saco/game/hooks.cpp b/saco/game/hooks.cpp index 224b42b..6854bf4 100644 --- a/saco/game/hooks.cpp +++ b/saco/game/hooks.cpp @@ -36,6 +36,10 @@ DWORD dwSavedCheatFn=0; float fFarClip=1400.0f; +DWORD dwParam1; +DWORD dwParam2; +DWORD dwParamThis; + DWORD unnamed_101516D4; WORD wLastRendObj=0; @@ -541,6 +545,30 @@ exitFn: } } +//----------------------------------------------------------- + +NUDE GenTaskAlloc_Hook() +{ + _asm mov edi, [esp+4] + _asm mov dwParam1, edi + //_asm mov edx, [esp+8] + //_asm mov dwParam2, edx + _asm mov dwParamThis, ecx + + _asm pushad + _asm mov edx, [edi] + _asm mov ecx, edi + _asm call dword ptr [edx+4] + _asm mov dwParam2, eax + + //pChatWindow->AddDebugMessage("TaskAlloc: 0x%X, 0x%X, 0x%X",dwParamThis,dwParam1,dwParam2); + _asm popad + + _asm mov eax, fs:0 + _asm mov edx, 0x4C3876 + _asm jmp edx +} + //----------------------------------------------------------- // used for correct report message using 100A1790 ; void __thiscall CGame::PlayCrimeReport