Function at 0x401e40
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:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
lea edi, [ebp - 0x674]
push ebx
push ecx
sub esp, 0x708
mov eax, dword [ecx + 8]
mov ecx, 0x11
mov byte [ebp - 0x69d], 3
mov dword [ebp - 0x6bc], eax
xor eax, eax
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 0x402150
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 - 0x6c0], 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 0x4020c0
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 0x401f81
mov eax, dword [ebp - 0x68c]
mov dword [ebp - 0x6ac], eax
test eax, eax
je 0x402000
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
test byte [section..data], 2
je 0x401fba
mov dword [esp + 0xc], str.Failed._n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x404000
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 - 0x10]
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
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 - 0x6c8], eax
call eax
sub esp, 0xc
mov dword [ebp - 0x6c4], 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 0x40207b
mov eax, dword [ebp - 0x698]
cmp dword [ebp - 0x690], eax
je 0x4021e0
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
mov esi, dword [ebp - 0x6c4]
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 0x401f8d
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 0x401f53
test byte [section..data], 2
je 0x401fba
mov dword [esp + 0xc], str.BELauncher.ini_not_found._n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x404000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x401f8d
test byte [section..data], 8
jne 0x4021a8
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 0x402191
jmp 0x4025f8
sub eax, 2
lea edx, [ebp - 0x630]
cmp eax, edx
je 0x4025f8
cmp word [eax], 0x5c
jne 0x402180
add eax, 2
xor edx, edx
mov word [eax], dx
jmp 0x401ed9
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], 0x404000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x402159
mov eax, dword [sym.imp.kernel32.dll_CloseHandle]
mov dword [esp], ebx
xor ebx, ebx
mov dword [ebp - 0x6e0], eax
call eax
mov edx, dword [ebp - 0x6c4]
mov dword [ebp - 0x6b4], 0
mov dword [ebp - 0x6b8], 0
sub esp, 4
jmp 0x402220
cmp byte [eax], 0
lea edx, [eax + 1]
je 0x40229d
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 0x402218
xor eax, eax
mov word [ebp - 0x220], ax
lea eax, [ebp - 0x69c]
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x6bc]
mov dword [esp], eax
call dword [sym.imp.shcore.dll_CommandLineToArgvW]
sub esp, 8
mov esi, eax
test eax, eax
je 0x402306
mov edi, dword [ebp - 0x69c]
test edi, edi
jle 0x402306
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 0x402301
lea edx, [eax - 1]
cmp edx, edi
jg 0x402957
inc edi
cmp edi, eax
jl 0x4022d8
cmp word [ebp - 0x220], 0
je 0x402618
mov eax, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
lea edi, [ebp - 0x220]
mov dword [ebp - 0x6d0], eax
mov eax, dword [ebp - 0x6b4]
test eax, eax
je 0x40293e
mov dword [esp + 4], 0xd
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
je 0x40234b
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 0x402369
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 - 0x6d0]
mov dword [esp + 0xc], 0xffffffff
mov dword [esp + 4], 0
mov dword [esp], 0
call eax
mov dword [ebp - 0x6d8], eax
add eax, 2
sub esp, 0x18
mov dword [ebp - 0x6dc], eax
test byte [section..data], 8
jne 0x402911
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 0x4028df
mov eax, dword [ebp - 0x6d4]
mov ebx, dword [sym.imp.ucrtbase.dll_wcslen]
xor esi, esi
mov dword [ebp - 0x6b8], eax
mov dword [ebp - 0x6c4], ebx
mov dword [ebp - 0x6cc], eax
mov eax, dword [ebp - 0x6bc]
mov ebx, dword [ebp - 0x6c4]
mov dword [esp], eax
call ebx
add eax, dword [ebp - 0x6dc]
add eax, dword [ebp - 0x6b8]
mov dword [esp + 4], 0
add eax, eax
mov ecx, dword [ebp - 0x6c8]
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 ecx
lea ecx, [ebp - 0x630]
sub esp, 0xc
mov ebx, eax
mov dword [esp + 8], esi
add esi, ebx
mov dword [esp + 4], ecx
mov dword [esp], eax
call sym._memcpy
mov ecx, dword [ebp - 0x6d4]
mov dword [esp], esi
mov dword [esp + 4], edi
add ecx, ecx
mov dword [esp + 8], ecx
call sym._memcpy
mov edx, dword [ebp - 0x6b8]
mov ecx, 0x20
mov esi, dword [ebp - 0x6bc]
mov word [ebx + edx*2], cx
mov ecx, dword [ebp - 0x6cc]
mov dword [esp + 4], esi
lea eax, [ebx + ecx*2 + 2]
mov dword [esp], eax
mov eax, dword [ebp - 0x6c0]
call eax
mov dword [esp], esi
mov eax, dword [ebp - 0x6c4]
call eax
mov edx, dword [ebp - 0x6b8]
lea eax, [edx + eax + 1]
mov edx, 0x20
mov word [ebx + eax*2], dx
mov eax, dword [ebp - 0x6c4]
mov dword [esp], esi
call eax
mov ecx, dword [ebp - 0x6cc]
mov esi, dword [ebp - 0x6d8]
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 - 0x6d0]
call eax
sub esp, 0x18
test eax, eax
je 0x4028b9
test byte [section..data], 8
jne 0x4027e7
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 0x402790
test byte [section..data], 2
jne 0x402984
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 0x401fec
cmp word [ebp - 0x630], 0x5c
lea eax, [ebp - 0x630]
jne 0x40219a
jmp 0x402197
mov esi, dword [ebp - 0x6b8]
test esi, esi
je 0x402720
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 0x402720
mov ecx, dword [ebp - 0x694]
test ecx, ecx
je 0x402720
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 0x402678
mov byte [eax], 0
mov dword [esp + 4], 0xa
mov dword [esp], ebx
call dword [sym.imp.ucrtbase.dll_strchr]
test eax, eax
je 0x402690
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 - 0x6d0], eax
call eax
lea edx, [eax - 1]
sub esp, 0x18
mov dword [ebp - 0x6d4], edx
test eax, eax
jne 0x402325
test byte [section..data], 2
je 0x401fba
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], 0x404000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x401f8d
test ebx, ebx
jne 0x402660
mov edi, dword [ebp - 0x6c4]
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 0x401fba
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], 0x404000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x401f8d
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 - 0x6e0]
call eax
sub esp, 4
jmp 0x401fec
mov eax, dword [ebp - 0x6bc]
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], 0x404000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
test byte [section..data], 8
je 0x402548
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], 0x404000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
test byte [section..data], 8
je 0x402548
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], 0x404000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x402548
mov eax, dword [ebp - 0x6bc]
mov dword [esp], eax
mov eax, dword [ebp - 0x6c4]
call eax
mov esi, dword [ebp - 0x6b8]
xor edx, edx
lea eax, [esi + eax + 1]
mov word [ebx + eax*2], dx
jmp 0x40253b
lea eax, [ebp - 0x630]
mov dword [esp], eax
mov eax, dword [sym.imp.ucrtbase.dll_wcslen]
mov dword [ebp - 0x6c4], eax
call eax
mov ebx, dword [ebp - 0x6d4]
lea esi, [eax + eax]
add ebx, eax
mov dword [ebp - 0x6cc], ebx
mov dword [ebp - 0x6b8], ebx
jmp 0x40241d
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], 0x404000
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x4023c1
mov dword [ebp - 0x6dc], 3
mov dword [ebp - 0x6d8], 1
jmp 0x4023b4
mov eax, dword [esi + edi*4 + 4]
lea edi, [ebp - 0x220]
mov dword [esp], edi
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x6c0]
call eax
mov dword [esp], edi
call dword [sym.imp.ucrtbase.dll_wcslen]
mov dword [ebp - 0x6d4], eax
jmp 0x402306
mov dword [esp + 0xc], str.CreateProcessW_failed._n
mov dword [esp + 8], str.wWinMain
mov dword [esp + 4], 0x404000
mov dword [esp], 1
call sym._wine_dbg_log.constprop.0
jmp 0x4025b5