
.486
.model flat, stdcall
option casemap:none

include EasyAntiCheat_x86.inc

.code

CreateGameLauncher proc
	;ebx holds filename and path in Halo: The Master Chief Collection
	;ebx+F8 holds filename and path in Tom Clancy's Ghost Recon: Wildlands
	invoke lstrcatW, addr szlpCommandLine, [ebx+0F8h]
    invoke lstrcatW, addr szlpCommandLine, addr szDblQuote
    ;invoke lstrcatW, addr sztmpCommandLine, [ebx+0F8h]
	;invoke CharLowerW,addr sztmpCommandLine
	;invoke wcsstr,addr sztmpCommandLine,addr wszSteam
	invoke StrStrW,[ebx+0F8h],addr wszSteam
	test eax,eax
	je short @f
		invoke lstrcatW, addr szlpCommandLine, addr szCmdLineSteam
		jmp _continue
	@@:
	;invoke wcsstr,addr sztmpCommandLine,addr wszUPlay
	invoke StrStrW,[ebx+0F8h],addr wszUPlay
	test eax,eax
	je short @f
		invoke lstrcatW, addr szlpCommandLine, addr szCmdLineUPlay
	@@:
_continue:
    invoke lstrcatW, addr szlpCommandLine, addr szCmdExtra
    invoke CreateProcessW, [ebx+0F8h], addr szlpCommandLine, NULL, NULL, NULL, CREATE_DEFAULT_ERROR_MODE, NULL, NULL, addr lpStartupInfo, addr lpProcessInformation
    invoke ExitProcess, NULL
    ret
CreateGameLauncher endp

start:

;option prologue:none
;option epilogue:none

DllMain proc hModule:HMODULE, dwReason:DWORD, lpReserved:LPVOID
    .if dwReason == DLL_PROCESS_ATTACH
        invoke DisableThreadLibraryCalls,hModule
        invoke OutputDebugString,addr szDllLoaded
    .elseif dwReason == DLL_PROCESS_DETACH
        invoke OutputDebugString,addr szDllUnloaded        
    .endif
    mov eax,TRUE
    ret
DllMain endp

;option prologue:PROLOGUEDEF
;option epilogue:EPILOGUEDEF

end start