From 22cfe175e12c68d62412ca662b300aa89e097b24 Mon Sep 17 00:00:00 2001 From: BobTheBob <32057864+BobTheBob9@users.noreply.github.com> Date: Mon, 27 Sep 2021 01:01:55 +0100 Subject: improve some commandline arg stuff --- LauncherInjector/main.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'LauncherInjector') diff --git a/LauncherInjector/main.cpp b/LauncherInjector/main.cpp index 597e72d3..8b136612 100644 --- a/LauncherInjector/main.cpp +++ b/LauncherInjector/main.cpp @@ -88,6 +88,15 @@ int main(int argc, char* argv[]) { std::wstring args; std::ifstream cmdlineArgFile; + args.append(L" "); + for (int i = 0; i < argc; i++) + { + std::string str = argv[i]; + + args.append(std::wstring(str.begin(), str.end())); + args.append(L" "); + } + if (!isdedi) cmdlineArgFile = std::ifstream("ns_startup_args.txt"); else @@ -103,9 +112,9 @@ int main(int argc, char* argv[]) { args.append(std::wstring(str.begin(), str.end())); } - if (isdedi) - // copy -dedicated into args if we have it in commandline args - args.append(L" -dedicated"); + //if (isdedi) + // // copy -dedicated into args if we have it in commandline args + // args.append(L" -dedicated"); STARTUPINFO startupInfo; PROCESS_INFORMATION processInfo; @@ -127,7 +136,7 @@ int main(int argc, char* argv[]) { HANDLE hThread = CreateRemoteThread(processInfo.hProcess, NULL, NULL, pLoadLibraryW, lpLibName, NULL, NULL); WaitForSingleObject(hThread, INFINITE); - MessageBoxA(0, std::to_string(GetLastError()).c_str(), "", MB_OK); + //MessageBoxA(0, std::to_string(GetLastError()).c_str(), "", MB_OK); CloseHandle(hThread); -- cgit v1.2.3