aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDedicatedTest/clientvideooverrides.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDedicatedTest/clientvideooverrides.cpp')
-rw-r--r--NorthstarDedicatedTest/clientvideooverrides.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/NorthstarDedicatedTest/clientvideooverrides.cpp b/NorthstarDedicatedTest/clientvideooverrides.cpp
index b3609fc2..0bc6bb06 100644
--- a/NorthstarDedicatedTest/clientvideooverrides.cpp
+++ b/NorthstarDedicatedTest/clientvideooverrides.cpp
@@ -1,9 +1,10 @@
#include "pch.h"
#include "modmanager.h"
-typedef void* (*BinkOpenType)(const char* path, uint32_t flags);
-BinkOpenType BinkOpen;
-void* BinkOpenHook(const char* path, uint32_t flags)
+AUTOHOOK_INIT()
+
+AUTOHOOK_PROCADDRESS(BinkOpen, bink2w64.dll, BinkOpen,
+void*,, (const char* path, uint32_t flags),
{
std::string filename(fs::path(path).filename().string());
spdlog::info("BinkOpen {}", filename);
@@ -27,11 +28,9 @@ void* BinkOpenHook(const char* path, uint32_t flags)
}
else
return BinkOpen(path, flags);
-}
+})
ON_DLL_LOAD_CLIENT("client.dll", BinkVideo, [](HMODULE baseAddress)
{
- HookEnabler hook;
- ENABLER_CREATEHOOK(
- hook, GetProcAddress(GetModuleHandleA("bink2w64.dll"), "BinkOpen"), &BinkOpenHook, reinterpret_cast<LPVOID*>(&BinkOpen));
+ AUTOHOOK_DISPATCH()
}) \ No newline at end of file