Skip to content

Commit 90a06cd

Browse files
engine: Remove uses of Autohook from runframe.cpp (#810)
* Manually hook CEngine__Frame * Remove AUTOHOOK_INIT and AUTOHOOK_DISPATCH
1 parent 13344f3 commit 90a06cd

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

primedev/engine/runframe.cpp

+5-8
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,14 @@
33
#include "hoststate.h"
44
#include "server/serverpresence.h"
55

6-
AUTOHOOK_INIT()
7-
8-
// clang-format off
9-
AUTOHOOK(CEngine__Frame, engine.dll + 0x1C8650,
10-
void, __fastcall, (CEngine* self))
11-
// clang-format on
6+
static void(__fastcall* o_pCEngine__Frame)(CEngine* self) = nullptr;
7+
static void __fastcall h_CEngine__Frame(CEngine* self)
128
{
13-
CEngine__Frame(self);
9+
o_pCEngine__Frame(self);
1410
}
1511

1612
ON_DLL_LOAD("engine.dll", RunFrame, (CModule module))
1713
{
18-
AUTOHOOK_DISPATCH()
14+
o_pCEngine__Frame = module.Offset(0x1C8650).RCast<decltype(o_pCEngine__Frame)>();
15+
HookAttach(&(PVOID&)o_pCEngine__Frame, (PVOID)h_CEngine__Frame);
1916
}

0 commit comments

Comments
 (0)