aboutsummaryrefslogtreecommitdiff
path: root/loader_wsock32_proxy/loader.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'loader_wsock32_proxy/loader.cpp')
-rw-r--r--loader_wsock32_proxy/loader.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/loader_wsock32_proxy/loader.cpp b/loader_wsock32_proxy/loader.cpp
index 9642df45..4af4daa1 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>
@@ -36,7 +36,7 @@ bool ShouldLoadNorthstar()
std::stringstream runNorthstarFileBuffer;
runNorthstarFileBuffer << runNorthstarFile.rdbuf();
runNorthstarFile.close();
- if (!runNorthstarFileBuffer.str().starts_with("0"))
+ if (!runNorthstarFileBuffer.str()._Starts_with("0"))
loadNorthstar = true;
}
return loadNorthstar;
@@ -94,12 +94,10 @@ bool ProvisionNorthstar()
return false;
}
- HookEnabler hook;
- ENABLER_CREATEHOOK(
- hook,
- reinterpret_cast<void*>(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;
}