From f66ea9ce2af44a00e49e6defaa7ec6ef4f100bb4 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Sat, 27 Nov 2021 01:35:22 +0000 Subject: more masterserver stuff and support for devonly/hidden cvars --- LauncherInjector/LauncherInjector.vcxproj | 8 ++++---- LauncherInjector/main.cpp | 13 +++++++++++++ 2 files changed, 17 insertions(+), 4 deletions(-) (limited to 'LauncherInjector') diff --git a/LauncherInjector/LauncherInjector.vcxproj b/LauncherInjector/LauncherInjector.vcxproj index 07d45e75..e205207d 100644 --- a/LauncherInjector/LauncherInjector.vcxproj +++ b/LauncherInjector/LauncherInjector.vcxproj @@ -30,26 +30,26 @@ Application true - v142 + v143 Unicode Application false - v142 + v143 true Unicode Application true - v142 + v143 Unicode Application false - v142 + v143 true Unicode diff --git a/LauncherInjector/main.cpp b/LauncherInjector/main.cpp index 8b136612..703ee188 100644 --- a/LauncherInjector/main.cpp +++ b/LauncherInjector/main.cpp @@ -134,6 +134,19 @@ int main(int argc, char* argv[]) { WriteProcessMemory(processInfo.hProcess, lpLibName, DLL_NAME, dwLength, &written); HANDLE hThread = CreateRemoteThread(processInfo.hProcess, NULL, NULL, pLoadLibraryW, lpLibName, NULL, NULL); + + if (hThread == NULL) + { + // injection failed + + std::string errorMessage = "Injection failed! CreateRemoteThread returned "; + errorMessage += std::to_string(GetLastError()).c_str(); + errorMessage += ", make sure bob hasn't accidentally shipped a debug build"; + + MessageBoxA(0, errorMessage.c_str(), "", MB_OK); + return 0; + } + WaitForSingleObject(hThread, INFINITE); //MessageBoxA(0, std::to_string(GetLastError()).c_str(), "", MB_OK); -- cgit v1.2.3