aboutsummaryrefslogtreecommitdiff
path: root/primedev/engine
diff options
context:
space:
mode:
authorJack <66967891+ASpoonPlaysGames@users.noreply.github.com>2024-11-15 14:54:18 +0000
committerGitHub <noreply@github.com>2024-11-15 15:54:18 +0100
commit90a06cd98b1f5f219bc726ed5b81bd71404815ef (patch)
treef42a6b571094322b2a1af2cbb1e547255a5a20fb /primedev/engine
parent13344f3910befa2cd15bfd306ba2c5e42e6c80ec (diff)
downloadNorthstarLauncher-90a06cd98b1f5f219bc726ed5b81bd71404815ef.tar.gz
NorthstarLauncher-90a06cd98b1f5f219bc726ed5b81bd71404815ef.zip
engine: Remove uses of Autohook from `runframe.cpp` (#810)v1.28.6-rc2v1.28.6-rc1v1.28.5-rc2v1.28.5
* Manually hook CEngine__Frame * Remove AUTOHOOK_INIT and AUTOHOOK_DISPATCH
Diffstat (limited to 'primedev/engine')
-rw-r--r--primedev/engine/runframe.cpp13
1 files 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<decltype(o_pCEngine__Frame)>();
+ HookAttach(&(PVOID&)o_pCEngine__Frame, (PVOID)h_CEngine__Frame);
}