1
0
mirror of synced 2025-02-01 04:15:50 +01:00

- Fixed loader arguments

This commit is contained in:
Harm 2022-01-07 20:07:26 +01:00
parent 9e267ab1c0
commit 17925506a9

View File

@ -1,4 +1,4 @@
#define _CRT_SECURE_NO_WARNINGS
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <windows.h>
#include <winternl.h>
@ -204,11 +204,12 @@ int wmain(int argc, wchar_t* argv[])
// With arguments
if (argc == 4)
{
wchar_t args[MAX_PATH];
swprintf(args, MAX_PATH, L"%ls", argv[3]);
size_t cmdSize = wcslen(gamePathW) + wcslen(argv[3]) + 4;
wchar_t* cmdW = new wchar_t[cmdSize]{ 0 };
swprintf(cmdW, cmdSize, L"\"%ls\" %ls", gamePathW, argv[3]);
if (!CreateProcess(gamePathW, // No module name (use command line).
args, // Command line.
cmdW, // Command line.
NULL, // Process handle not inheritable.
NULL, // Thread handle not inheritable.
FALSE, // Set handle inheritance to FALSE.