diff options
author | DrFrugal <drfrugal@vmi2238186.contaboserver.net> | 2024-12-30 18:42:10 +0100 |
---|---|---|
committer | DrFrugal <drfrugal@vmi2238186.contaboserver.net> | 2024-12-30 18:42:10 +0100 |
commit | 24ca502e3af452603ed191948e5ece016e2204b2 (patch) | |
tree | 52964d5f1cb574b155cbc23ad764aa64fb41f330 /Launcher/Launcher.cpp |
Diffstat (limited to 'Launcher/Launcher.cpp')
-rw-r--r-- | Launcher/Launcher.cpp | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/Launcher/Launcher.cpp b/Launcher/Launcher.cpp new file mode 100644 index 0000000..5ea62f5 --- /dev/null +++ b/Launcher/Launcher.cpp @@ -0,0 +1,35 @@ +#include <iostream>
+#include <Windows.h>
+#include <detours.h>
+
+int main()
+{
+ std::string wow_directory = R"(C:\Users\alphaomega\Documents\World-of-Warcraft-3.3.5a.12340-enUS-WIN\)";
+ char launcherDirectory[MAX_PATH] = { 0 };
+ GetModuleFileNameA(NULL, launcherDirectory, MAX_PATH);
+ size_t lastBackslash = ((std::string)launcherDirectory).rfind('\\');
+ std::string lpDllName = ((std::string)launcherDirectory).substr(0, lastBackslash + 1) + "Hook.dll";
+
+ STARTUPINFOA lpStartupInfo;
+ ZeroMemory(&lpStartupInfo, sizeof(lpStartupInfo));
+ PROCESS_INFORMATION lpProcessInformation;
+ ZeroMemory(&lpProcessInformation, sizeof(lpProcessInformation));
+ lpStartupInfo.cb = sizeof(lpStartupInfo);
+
+ DetourCreateProcessWithDllA(
+ (wow_directory + "Wow.exe").c_str(), // lpApplicationName
+ NULL, // lpCommandLine,
+ NULL, // lpProcessAttributes,
+ NULL, // lpThreadAttributes,
+ TRUE, // bInheritHandles,
+ CREATE_DEFAULT_ERROR_MODE | CREATE_SUSPENDED, // dwCreationFlags,
+ NULL, // lpEnvironment,
+ wow_directory.c_str(), // lpCurrentDirectory,
+ &lpStartupInfo, // lpStartupInfo
+ &lpProcessInformation, // lpProcessInformation
+ lpDllName.c_str(), // lpDllName
+ NULL // pfCreateProcessA
+ );
+ ResumeThread(lpProcessInformation.hThread);
+ return 0;
+}
|