From 90a06cd98b1f5f219bc726ed5b81bd71404815ef Mon Sep 17 00:00:00 2001 From: Jack <66967891+ASpoonPlaysGames@users.noreply.github.com> Date: Fri, 15 Nov 2024 14:54:18 +0000 Subject: engine: Remove uses of Autohook from `runframe.cpp` (#810) * Manually hook CEngine__Frame * Remove AUTOHOOK_INIT and AUTOHOOK_DISPATCH --- primedev/engine/runframe.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/primedev/engine/runframe.cpp b/primedev/engine/runframe.cpp index ddfd9253..bfec9b8f 100644 --- a/primedev/engine/runframe.cpp +++ b/primedev/engine/runframe.cpp @@ -3,17 +3,14 @@ #include "hoststate.h" #include "server/serverpresence.h" -AUTOHOOK_INIT() - -// clang-format off -AUTOHOOK(CEngine__Frame, engine.dll + 0x1C8650, -void, __fastcall, (CEngine* self)) -// clang-format on +static void(__fastcall* o_pCEngine__Frame)(CEngine* self) = nullptr; +static void __fastcall h_CEngine__Frame(CEngine* self) { - CEngine__Frame(self); + o_pCEngine__Frame(self); } ON_DLL_LOAD("engine.dll", RunFrame, (CModule module)) { - AUTOHOOK_DISPATCH() + o_pCEngine__Frame = module.Offset(0x1C8650).RCast(); + HookAttach(&(PVOID&)o_pCEngine__Frame, (PVOID)h_CEngine__Frame); } -- cgit v1.2.3