aboutsummaryrefslogtreecommitdiff
path: root/loader_wsock32_proxy/loader.cpp
diff options
context:
space:
mode:
authorBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-10 22:21:29 +0100
committerBobTheBob9 <for.oliver.kirkham@gmail.com>2022-07-10 22:21:29 +0100
commit0a9a44ce15bb772b3193fbee481768e7327db1a9 (patch)
tree855b235161de35ade7d86ce2d847483aa46b31e4 /loader_wsock32_proxy/loader.cpp
parent2ae34b67e36b8ba05132d481876eb4ed7a826283 (diff)
downloadNorthstarLauncher-0a9a44ce15bb772b3193fbee481768e7327db1a9.tar.gz
NorthstarLauncher-0a9a44ce15bb772b3193fbee481768e7327db1a9.zip
completely remove old hooking
Diffstat (limited to 'loader_wsock32_proxy/loader.cpp')
-rw-r--r--loader_wsock32_proxy/loader.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/loader_wsock32_proxy/loader.cpp b/loader_wsock32_proxy/loader.cpp
index ab89a615..663f1f7b 100644
--- a/loader_wsock32_proxy/loader.cpp
+++ b/loader_wsock32_proxy/loader.cpp
@@ -1,6 +1,6 @@
#include "pch.h"
#include "loader.h"
-#include "../NorthstarDLL/hookutils.h"
+#include "include/MinHook.h"
#include <string>
#include <system_error>
#include <sstream>
@@ -84,8 +84,10 @@ bool ProvisionNorthstar()
return false;
}
- HookEnabler hook;
- ENABLER_CREATEHOOK(hook, GetProcAddress(launcherHandle, "LauncherMain"), &LauncherMainHook, reinterpret_cast<LPVOID*>(&LauncherMainOriginal));
+ LPVOID pTarget = GetProcAddress(launcherHandle, "LauncherMain");
+ if (MH_CreateHook(pTarget, &LauncherMainHook, reinterpret_cast<LPVOID*>(&LauncherMainOriginal)) != MH_OK || MH_EnableHook(pTarget) != MH_OK)
+ MessageBoxA(
+ GetForegroundWindow(), "Hook creation failed for function LauncherMain.", "Northstar Wsock32 Proxy Error", 0);
return true;
} \ No newline at end of file