Function at 0x401dc0
Capabilities:
Accept command line arguments
Access peb ldr_data
Check for peb beingdebugged flag
Create process on windows
Get file size
Get kernel32 base address
Get process heap flags
Query environment variable
Read file on windows

Disassembly:
push ebp
xor eax, eax
mov ecx, 0x11
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x674]
push ebx
sub esp, 0x70c
mov byte [ebp - 0x69d], 3
rep stosd dword es:[edi], eax
lea eax, [ebp - 0x69d]
mov dword [esp], 1
mov dword [esp + 4], eax
mov eax, dword [sym.imp.ucrtbase.dll__write]
mov dword [esp + 8], 1
mov dword [ebp - 0x6b0], eax
call eax
xor ecx, ecx
lea eax, [ebp - 0x630]
mov dword [esp + 8], 0x104
mov word [ebp - 0x630], cx
mov dword [esp + 4], eax
mov dword [esp], str.PROTON_ORIG_LAUNCHER_NAME
call dword [sym.imp.kernel32.dll_GetEnvironmentVariableW]
mov dword [ebp - 0x698], eax
dec eax
sub esp, 0xc
cmp eax, 0x103
jbe 0x4020b0
lea eax, [ebp - 0x630]
lea ebx, [ebp - 0x428]
mov dword [esp + 4], eax
mov eax, dword [sym.imp.ucrtbase.dll_wcscpy]
mov dword [esp], ebx
mov dword [ebp - 0x6bc], eax
call eax
mov dword [esp], ebx
mov dword [esp + 4], str.BattleyeBELauncher.ini
call dword [sym.imp.ucrtbase.dll_wcscat]
mov dword [esp], ebx
mov esi, dword [sym.imp.kernel32.dll_CreateFileW]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0x80000000
call esi
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
je 0x402020
lea eax, [ebp - 0x690]
mov dword [esp], ebx
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetFileSizeEx]
sub esp, 8
test eax, eax
je 0x401ee9
mov eax, dword [ebp - 0x68c]
mov dword [ebp - 0x6ac], eax
test eax, eax
je 0x401f68
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
test byte [section..data], 2
je 0x401f22
mov dword [esp + 0xc], str.Failed._n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
lea eax, [ebp - 0x69d]
mov byte [ebp - 0x69d], 4
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x6b0]
mov dword [esp + 8], 1
mov dword [esp], 1
call eax
mov dword [ebp - 0x6ac], 0
mov eax, dword [ebp - 0x6ac]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0x10
mov edx, dword [ebp - 0x690]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], edx
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x6c4], eax
call eax
sub esp, 0xc
mov dword [ebp - 0x6c0], eax
mov edi, eax
lea eax, [ebp - 0x698]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x690]
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov dword [esp + 4], edi
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x401fe3
mov eax, dword [ebp - 0x698]
cmp dword [ebp - 0x690], eax
je 0x402140
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
mov esi, dword [ebp - 0x6c0]
sub esp, 4
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
jmp 0x401ef5
xor eax, eax
mov dword [esp + 0x18], 0
mov word [ebp - 0x630], ax
mov dword [esp + 0x14], pe_nt_image_headers32
mov dword [esp + 0x10], 3
mov dword [esp + 0xc], 0
mov dword [esp + 8], 1
mov dword [esp + 4], 0x80000000
mov dword [esp], str.BattleyeBELauncher.ini
call esi
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
jne 0x401ebf
test byte [section..data], 2
je 0x401f22
mov dword [esp + 0xc], str.BELauncher.ini_not_found._n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x401ef5
test byte [section..data], 8
jne 0x402108
lea eax, [ebp - 0x630]
lea esi, [ebp - 0x630]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcslen]
lea eax, [ebp + eax*2 - 0x630]
cmp eax, esi
jne 0x4020f1
jmp 0x402550
sub eax, 2
lea edx, [ebp - 0x630]
cmp eax, edx
je 0x402550
cmp word [eax], 0x5c
jne 0x4020e0
add eax, 2
xor edx, edx
mov word [eax], dx
jmp 0x401e45
lea eax, [ebp - 0x630]
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0xc], str.PROTON_ORIG_LAUNCHER_NAME__s._n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4020b9
mov eax, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], ebx
xor ebx, ebx
mov dword [ebp - 0x6dc], eax
call eax
mov edx, dword [ebp - 0x6c0]
mov dword [ebp - 0x6b4], 0
mov dword [ebp - 0x6b8], 0
sub esp, 4
jmp 0x402180
cmp byte [eax], 0
lea edx, [eax + 1]
je 0x4021fd
mov ecx, 9
mov esi, edx
lea eax, [edx + 9]
mov edi, str.32BitExe
repe cmpsb byte [esi], byte es:[edi]
mov esi, edx
mov edi, str.64BitExe
seta cl
sbb cl, 0
test cl, cl
mov ecx, 9
cmove ebx, eax
repe cmpsb byte [esi], byte es:[edi]
mov esi, edx
mov edi, str.BEArg
seta cl
sbb cl, 0
test cl, cl
mov ecx, 6
cmovne eax, dword [ebp - 0x6b8]
repe cmpsb byte [esi], byte es:[edi]
lea ecx, [edx + 6]
mov dword [esp + 4], 0xa
mov dword [ebp - 0x6b8], eax
mov dword [esp], edx
seta al
sbb al, 0
test al, al
cmovne ecx, dword [ebp - 0x6b4]
mov dword [ebp - 0x6b4], ecx
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
jne 0x402178
xor eax, eax
mov word [ebp - 0x220], ax
lea eax, [ebp - 0x69c]
mov dword [esp + 4], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call dword [sym.imp.shcore.dll_CommandLineToArgvW]
sub esp, 8
mov esi, eax
test eax, eax
je 0x402266
mov edi, dword [ebp - 0x69c]
test edi, edi
jle 0x402266
xor edi, edi
lea esi, [esi]
mov dword [esp + 4], str._exe
mov eax, dword [esi + edi*4]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcscmp]
test eax, eax
mov eax, dword [ebp - 0x69c]
jne 0x402261
lea edx, [eax - 1]
cmp edx, edi
jg 0x4028b2
inc edi
cmp edi, eax
jl 0x402238
cmp word [ebp - 0x220], 0
je 0x402570
mov eax, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
lea edi, [ebp - 0x220]
mov dword [ebp - 0x6cc], eax
mov eax, dword [ebp - 0x6b4]
test eax, eax
je 0x402899
mov dword [esp + 4], 0xd
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
je 0x4022ab
mov byte [eax], 0
mov eax, dword [ebp - 0x6b4]
mov dword [esp + 4], 0xa
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
je 0x4022c9
mov byte [eax], 0
mov eax, dword [ebp - 0x6b4]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x6cc]
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 4], 0
mov dword [esp], 0
call eax
mov dword [ebp - 0x6d4], eax
add eax, 2
sub esp, 0x18
mov dword [ebp - 0x6d8], eax
test byte [section..data], 8
jne 0x40286c
lea eax, [ebp - 0x69d]
mov dword [esp + 8], 1
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x6b0]
mov dword [esp], 1
mov byte [ebp - 0x69d], 9
call eax
mov dword [esp], edi
call dword [sym.imp.shlwapi.dll_PathIsRelativeW]
sub esp, 4
test eax, eax
jne 0x402839
mov eax, dword [ebp - 0x6d0]
mov ebx, dword [sym.imp.ucrtbase.dll_wcslen]
xor esi, esi
mov dword [ebp - 0x6b8], eax
mov dword [ebp - 0x6c0], ebx
mov dword [ebp - 0x6c8], eax
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
mov eax, dword [ebp - 0x6c0]
call eax
add eax, dword [ebp - 0x6d8]
add eax, dword [ebp - 0x6b8]
mov dword [esp + 4], 0
add eax, eax
mov ebx, dword [ebp - 0x6c4]
mov edx, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
lea ecx, [ebp - 0x630]
sub esp, 0xc
mov ebx, eax
mov dword [esp + 4], ecx
mov dword [esp + 8], esi
add esi, ebx
mov dword [esp], eax
call sym._memcpy
mov eax, dword [ebp - 0x6d0]
mov dword [esp], esi
mov dword [esp + 4], edi
add eax, eax
mov dword [esp + 8], eax
call sym._memcpy
mov edx, dword [ebp - 0x6b8]
mov ecx, 0x20
mov word [ebx + edx*2], cx
mov ecx, dword [ebp + 0x10]
mov dword [esp + 4], ecx
mov ecx, dword [ebp - 0x6c8]
lea eax, [ebx + ecx*2 + 2]
mov dword [esp], eax
mov eax, dword [ebp - 0x6bc]
call eax
mov eax, dword [ebp + 0x10]
mov esi, dword [ebp - 0x6c0]
mov dword [esp], eax
call esi
mov edx, dword [ebp - 0x6b8]
lea eax, [edx + eax + 1]
mov edx, 0x20
mov word [ebx + eax*2], dx
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
call esi
mov ecx, dword [ebp - 0x6c8]
mov esi, dword [ebp - 0x6d4]
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 4], 0
lea eax, [ecx + eax + 2]
mov dword [esp + 0x14], esi
lea eax, [ebx + eax*2]
mov dword [esp], 0
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x6b4]
mov dword [esp + 8], eax
mov eax, dword [ebp - 0x6cc]
call eax
sub esp, 0x18
test eax, eax
je 0x402816
test byte [section..data], 8
jne 0x402747
lea eax, [ebp - 0x684]
mov dword [esp + 0x1c], 0
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x674]
mov dword [esp + 0x20], eax
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0x10
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], ebx
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateProcessW]
sub esp, 0x28
test eax, eax
jne 0x4026f0
test byte [section..data], 2
jne 0x4028df
lea eax, [ebp - 0x69d]
mov byte [ebp - 0x69d], 0xa
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x6b0]
mov dword [esp + 8], 1
mov dword [esp], 1
call eax
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [ebp - 0x6ac], eax
jmp 0x401f54
cmp word [ebp - 0x630], 0x5c
lea eax, [ebp - 0x630]
jne 0x4020fa
jmp 0x4020f7
mov esi, dword [ebp - 0x6b8]
test esi, esi
je 0x402680
lea eax, [ebp - 0x694]
mov dword [esp], 0xffffffff
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_IsWow64Process]
sub esp, 8
test eax, eax
je 0x402680
mov ecx, dword [ebp - 0x694]
test ecx, ecx
je 0x402680
mov ebx, dword [ebp - 0x6b8]
lea esi, [esi]
mov dword [esp + 4], 0xd
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
je 0x4025d0
mov byte [eax], 0
mov dword [esp + 4], 0xa
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
je 0x4025e8
mov byte [eax], 0
mov eax, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
lea edi, [ebp - 0x220]
mov dword [esp + 8], ebx
mov dword [esp + 0x14], 0x104
mov dword [esp + 0x10], edi
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [ebp - 0x6cc], eax
call eax
lea esi, [eax - 1]
sub esp, 0x18
mov dword [ebp - 0x6d0], esi
test eax, eax
jne 0x402285
test byte [section..data], 2
je 0x401f22
mov eax, ebx
call sym._wine_dbgstr_an.constprop.0
mov dword [esp + 0xc], str.Failed_to_convert_game_exe__s._n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x401ef5
test ebx, ebx
jne 0x4025b8
mov edi, dword [ebp - 0x6c0]
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov dword [esp + 8], edi
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
sub esp, 0xc
test byte [section..data], 2
je 0x401f22
mov dword [esp + 0xc], str.Failed_to_find_game_executable_name_from_BattlEye_config._n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x401ef5
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov eax, dword [ebp - 0x684]
sub esp, 0xc
mov dword [esp + 4], 0xffffffff
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov eax, dword [ebp - 0x684]
sub esp, 8
mov dword [esp], eax
mov eax, dword [ebp - 0x6dc]
call eax
sub esp, 4
jmp 0x401f54
mov eax, dword [ebp + 0x10]
call sym._wine_dbgstr_wn.constprop.0
mov esi, eax
mov eax, edi
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.game_exe__s__cmdline__s._n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
test byte [section..data], 8
je 0x4024a2
mov eax, dword [ebp - 0x6b4]
call sym._wine_dbgstr_an.constprop.0
mov esi, eax
lea eax, [ebp - 0x630]
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], str.path__s__be_arg__s._n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
test byte [section..data], 8
je 0x4024a2
mov eax, ebx
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0xc], str.launch_cmd__s._n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4024a2
mov eax, dword [ebp + 0x10]
mov dword [esp], eax
mov eax, dword [ebp - 0x6c0]
call eax
mov esi, dword [ebp - 0x6b8]
xor edx, edx
lea eax, [esi + eax + 1]
mov word [ebx + eax*2], dx
jmp 0x402495
lea eax, [ebp - 0x630]
mov dword [esp], eax
mov eax, dword [sym.imp.ucrtbase.dll_wcslen]
mov dword [ebp - 0x6c0], eax
call eax
mov ebx, dword [ebp - 0x6d0]
lea esi, [eax + ebx]
mov dword [ebp - 0x6c8], esi
mov dword [ebp - 0x6b8], esi
lea esi, [eax + eax]
jmp 0x40237d
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], str.Launching_game_executable__s_for_BattlEye._n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x402321
mov dword [ebp - 0x6d8], 3
mov dword [ebp - 0x6d4], 1
jmp 0x402314
mov eax, dword [esi + edi*4 + 4]
lea edi, [ebp - 0x220]
mov dword [esp], edi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x6bc]
call eax
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_wcslen]
mov dword [ebp - 0x6d0], eax
jmp 0x402266
mov dword [esp + 0xc], str.CreateProcessW_failed._n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x403000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x40250f