Skip to content

Commit

Permalink
engine: Remove uses of Autohook from runframe.cpp (#810)
Browse files Browse the repository at this point in the history
* Manually hook CEngine__Frame
* Remove AUTOHOOK_INIT and AUTOHOOK_DISPATCH
  • Loading branch information
ASpoonPlaysGames authored Nov 15, 2024
1 parent 13344f3 commit 90a06cd
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions primedev/engine/runframe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<decltype(o_pCEngine__Frame)>();
HookAttach(&(PVOID&)o_pCEngine__Frame, (PVOID)h_CEngine__Frame);
}

0 comments on commit 90a06cd

Please sign in to comment.