aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/debugoverlay.cpp
diff options
context:
space:
mode:
authorBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-26 23:09:15 +0100
committerBobTheBob <32057864+BobTheBob9@users.noreply.github.com>2022-05-26 23:09:15 +0100
commit2171d95e1221442081bade7929c05b82ca0f2a08 (patch)
tree78e2d33c13fb0353e3869b08b15c3a6cc3c60393 /NorthstarDedicatedTest/debugoverlay.cpp
parentcc7b0ded08e3dc26fc970169a79c74c54e4f923b (diff)
downloadNorthstarLauncher-2171d95e1221442081bade7929c05b82ca0f2a08.tar.gz
NorthstarLauncher-2171d95e1221442081bade7929c05b82ca0f2a08.zip
update more stuff to new hook macros
Diffstat (limited to 'NorthstarDedicatedTest/debugoverlay.cpp')
-rw-r--r--NorthstarDedicatedTest/debugoverlay.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/NorthstarDedicatedTest/debugoverlay.cpp b/NorthstarDedicatedTest/debugoverlay.cpp
index 6cf7703f..e6601223 100644
--- a/NorthstarDedicatedTest/debugoverlay.cpp
+++ b/NorthstarDedicatedTest/debugoverlay.cpp
@@ -2,6 +2,8 @@
#include "dedicated.h"
#include "cvar.h"
+AUTOHOOK_INIT()
+
struct Vector3
{
float x, y, z;
@@ -83,10 +85,8 @@ typedef void (*RenderBoxType)(Vector3 vOrigin, QAngle angles, Vector3 vMins, Vec
static RenderBoxType RenderBox;
static RenderBoxType RenderWireframeBox;
-// engine.dll+0xABCB0
-typedef void (*DrawOverlayType)(OverlayBase_t* a1);
-DrawOverlayType DrawOverlay;
-void __fastcall DrawOverlayHook(OverlayBase_t* pOverlay)
+AUTOHOOK(DrawOverlay, engine.dll + 0xABCB0,
+void, __fastcall, (OverlayBase_t * pOverlay),
{
EnterCriticalSection((LPCRITICAL_SECTION)((char*)sEngineModule + 0x10DB0A38)); // s_OverlayMutex
@@ -129,12 +129,11 @@ void __fastcall DrawOverlayHook(OverlayBase_t* pOverlay)
break;
}
LeaveCriticalSection((LPCRITICAL_SECTION)((char*)sEngineModule + 0x10DB0A38));
-}
+})
ON_DLL_LOAD_CLIENT_RELIESON("engine.dll", DebugOverlay, ConVar, [](HMODULE baseAddress)
{
- HookEnabler hook;
- ENABLER_CREATEHOOK(hook, (char*)baseAddress + 0xABCB0, &DrawOverlayHook, reinterpret_cast<LPVOID*>(&DrawOverlay));
+ AUTOHOOK_DISPATCH()
RenderLine = reinterpret_cast<RenderLineType>((char*)baseAddress + 0x192A70);