diff options
Diffstat (limited to 'LauncherInjector/main.cpp')
-rw-r--r-- | LauncherInjector/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
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); |