From 24ca502e3af452603ed191948e5ece016e2204b2 Mon Sep 17 00:00:00 2001 From: DrFrugal Date: Mon, 30 Dec 2024 18:42:10 +0100 Subject: init --- Launcher/Launcher.cpp | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 Launcher/Launcher.cpp (limited to 'Launcher/Launcher.cpp') 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 +#include +#include + +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; +} -- cgit v1.2.3