Function at 0x401090
Capabilities:
Access peb ldr_data
Check for peb beingdebugged flag
Create process on windows
Get file size
Get kernel32 base address
Get process heap flags
Get process heap force flags
Read file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
xor edx, edx
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0xd8
mov eax, dword [ecx + 8]
mov dword [ebp - 0x8c], eax
xor eax, eax
mov dword [ebp + eax - 0x5c], edx
mov dword [ebp + eax - 0x58], edx
add eax, 8
cmp eax, 0x40
jb 0x4010b4
mov dword [esp], 1
xor ebx, ebx
mov esi, 1
mov dword [ebp + eax - 0x5c], ebx
lea eax, [ebp - 0x81]
xor edi, edi
mov dword [esp + 8], esi
mov dword [esp + 4], eax
mov byte [ebp - 0x81], 3
call sym.__write
mov eax, pe_nt_image_headers32
mov dword [esp + 0x14], eax
mov eax, 3
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0xc], eax
mov eax, 1
mov dword [esp + 8], eax
mov eax, 0x80000000
mov dword [esp + 0x18], edi
mov dword [esp + 4], eax
mov dword [esp], str.BattleyeBELauncher.ini
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
cmp eax, 0xffffffff
mov ebx, eax
je 0x401205
mov dword [esp], ebx
lea eax, [ebp - 0x78]
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetFileSizeEx]
sub esp, 8
test eax, eax
je 0x401240
mov edx, dword [ebp - 0x74]
test edx, edx
jne 0x401240
mov dword [ebp - 0x90], edx
mov ecx, dword [ebp - 0x78]
xor edx, edx
mov dword [esp + 4], edx
mov eax, dword fs:[0x18]
mov dword [esp + 8], ecx
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 - 0xa0], eax
call eax
xor ecx, ecx
mov dword [ebp - 0x98], eax
sub esp, 0xc
mov esi, eax
mov dword [esp + 0x10], ecx
lea eax, [ebp - 0x80]
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x78]
mov dword [esp + 4], esi
mov dword [esp], ebx
mov dword [esp + 8], eax
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
test eax, eax
je 0x4011d1
mov eax, dword [ebp - 0x80]
cmp dword [ebp - 0x78], eax
mov edx, dword [ebp - 0x90]
je 0x401250
mov dword [esp], ebx
xor edi, edi
call dword [sym.imp.kernel32.dll_CloseHandle]
mov ebx, dword [ebp - 0x98]
mov eax, dword fs:[0x18]
sub esp, 4
mov dword [esp + 8], ebx
mov dword [esp + 4], 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
mov dword [esp], 1
mov eax, 1
mov dword [esp + 8], eax
lea eax, [ebp - 0x81]
mov dword [esp + 4], eax
mov byte [ebp - 0x81], 4
call sym.__write
xor edx, edx
lea esp, [ebp - 0x10]
mov eax, edx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret 0x10
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
jmp 0x401205
mov dword [esp], ebx
mov eax, dword [sym.imp.kernel32.dll_CloseHandle]
xor ebx, ebx
mov dword [ebp - 0xa4], edx
xor esi, esi
mov dword [ebp - 0xac], eax
call eax
xor ecx, ecx
mov eax, dword [ebp - 0x98]
mov dword [ebp - 0x9c], ebx
mov ebx, dword [sym.imp.ucrtbase.dll_strchr]
mov dword [ebp - 0x94], ecx
mov dword [ebp - 0x90], esi
sub esp, 4
jmp 0x401298
cmp byte [edx], 0
lea eax, [eax + 1]
je 0x40130f
mov ecx, 9
mov esi, eax
mov edi, str.32BitExe
repe cmpsb byte [esi], byte es:[edi]
seta dl
sbb dl, 0
test dl, dl
jne 0x4012b9
lea edi, [eax + 9]
mov dword [ebp - 0x90], edi
mov ecx, 9
mov esi, eax
mov edi, str.64BitExe
repe cmpsb byte [esi], byte es:[edi]
seta dl
sbb dl, 0
test dl, dl
jne 0x4012da
lea edi, [eax + 9]
mov dword [ebp - 0x9c], edi
mov ecx, 6
mov esi, eax
mov edi, str.BEArg
repe cmpsb byte [esi], byte es:[edi]
seta dl
sbb dl, 0
test dl, dl
jne 0x4012fb
lea esi, [eax + 6]
mov dword [ebp - 0x94], esi
mov dword [esp], eax
mov edx, 0xa
mov dword [esp + 4], edx
call ebx
test eax, eax
mov edx, eax
jne 0x401290
mov eax, dword [ebp - 0x9c]
mov edx, dword [ebp - 0xa4]
test eax, eax
je 0x401360
mov dword [esp], 0xffffffff
lea eax, [ebp - 0x7c]
mov dword [esp + 4], eax
mov dword [ebp - 0xa4], edx
call dword [sym.imp.kernel32.dll_IsWow64Process]
mov edx, dword [ebp - 0xa4]
sub esp, 8
test eax, eax
je 0x401360
mov esi, dword [ebp - 0x7c]
test esi, esi
je 0x401360
mov eax, dword [ebp - 0x9c]
mov dword [ebp - 0x90], eax
jmp 0x40136e
mov edi, dword [ebp - 0x90]
test edi, edi
je 0x401732
mov dword [ebp - 0x98], edx
mov eax, 0xd
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x90]
mov dword [esp], eax
call ebx
mov edx, dword [ebp - 0x98]
test eax, eax
je 0x401395
mov byte [eax], 0
mov dword [ebp - 0x98], edx
mov eax, 0xa
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x90]
mov dword [esp], eax
call ebx
mov edx, dword [ebp - 0x98]
test eax, eax
je 0x4013bc
mov byte [eax], 0
mov eax, dword [ebp - 0x90]
xor ecx, ecx
xor esi, esi
mov dword [esp + 0x10], esi
mov edi, 0xffffffff
mov esi, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [esp + 0xc], edi
mov dword [esp + 0x14], ecx
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], eax
mov dword [esp], 0
mov dword [ebp - 0x98], edx
call esi
mov edx, dword [ebp - 0x98]
mov edi, eax
mov eax, dword [ebp - 0x94]
sub esp, 0x18
test eax, eax
je 0x401680
mov dword [esp], eax
mov edx, 0xd
mov dword [esp + 4], edx
call ebx
mov edx, dword [ebp - 0x98]
test eax, eax
je 0x40142a
mov byte [eax], 0
mov dword [ebp - 0x98], edx
mov eax, 0xa
mov dword [esp + 4], eax
mov eax, dword [ebp - 0x94]
mov dword [esp], eax
call ebx
mov edx, dword [ebp - 0x98]
test eax, eax
je 0x401451
mov byte [eax], 0
mov dword [esp], 0
xor eax, eax
xor ebx, ebx
mov dword [esp + 0x10], eax
mov eax, 0xffffffff
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x94]
mov dword [esp + 0x14], ebx
mov dword [ebp - 0x98], edx
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], eax
call esi
mov edx, dword [ebp - 0x98]
mov dword [ebp - 0x9c], eax
lea ebx, [eax - 1]
sub esp, 0x18
test byte [section..data], 8
jne 0x4016f0
mov dword [esp], 1
mov eax, 1
mov dword [esp + 8], eax
lea eax, [ebp - 0x81]
mov dword [esp + 4], eax
mov dword [ebp - 0xa8], edx
mov byte [ebp - 0x81], 9
call sym.__write
mov eax, dword [ebp - 0x8c]
mov edx, dword [sym.imp.ucrtbase.dll_wcslen]
mov dword [esp], eax
mov dword [ebp - 0x98], edx
call edx
mov ecx, dword fs:[0x18]
mov dword [ebp - 0xa4], ecx
mov edx, ecx
lea ecx, [edi + ebx + 2]
mov ebx, dword [ebp - 0xa0]
add eax, ecx
add eax, eax
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], eax
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call ebx
sub esp, 0xc
mov ebx, eax
mov dword [esp + 0x10], eax
mov eax, 0xffffffff
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x90]
mov dword [esp + 0x14], edi
mov dword [esp], 0
mov dword [esp + 8], eax
xor eax, eax
mov dword [esp + 4], eax
call esi
mov ecx, dword [ebp - 0x8c]
lea eax, [edi - 1]
add eax, eax
mov word [ebx + eax], 0x20
lea eax, [ebx + eax + 2]
sub esp, 0x18
mov dword [esp + 4], ecx
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll_wcscpy]
mov ecx, dword [ebp - 0x8c]
mov edx, dword [ebp - 0x98]
mov dword [esp], ecx
call edx
mov ecx, dword [ebp - 0x8c]
mov edx, dword [ebp - 0x98]
add eax, edi
mov word [ebx + eax*2], 0x20
mov dword [esp], ecx
call edx
mov ecx, dword [ebp - 0x9c]
xor edx, edx
mov dword [esp + 4], edx
mov dword [esp], 0
mov dword [esp + 0x14], ecx
lea eax, [edi + eax + 1]
mov edi, 0x10
lea eax, [ebx + eax*2]
mov dword [esp + 0x10], eax
mov eax, 0xffffffff
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x94]
mov dword [esp + 8], eax
call esi
lea eax, [ebp - 0x6c]
xor ecx, ecx
xor esi, esi
sub esp, 0x18
mov dword [esp + 0x24], eax
lea eax, [ebp - 0x5c]
mov dword [esp + 0x20], eax
xor eax, eax
mov dword [esp + 0x10], eax
xor eax, eax
mov dword [esp + 0xc], eax
xor eax, eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], esi
mov dword [esp + 0x14], edi
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_CreateProcessW]
mov edx, dword [ebp - 0xa8]
sub esp, 0x28
test eax, eax
je 0x401698
mov dword [ebp - 0x8c], edx
mov eax, dword [ebp - 0xa4]
xor edx, edx
mov dword [esp + 4], edx
mov dword [esp + 8], ebx
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 - 0x6c]
mov ecx, 0xffffffff
sub esp, 0xc
mov dword [esp + 4], ecx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WaitForSingleObject]
mov eax, dword [ebp - 0x6c]
sub esp, 8
mov dword [esp], eax
mov eax, dword [ebp - 0xac]
call eax
mov edx, dword [ebp - 0x8c]
sub esp, 4
jmp 0x40122d
mov ecx, 1
xor ebx, ebx
mov dword [ebp - 0x9c], ecx
jmp 0x401497
mov dword [esp], 1
lea eax, [ebp - 0x81]
mov esi, 1
mov dword [esp + 8], esi
xor edi, edi
mov dword [esp + 4], eax
mov byte [ebp - 0x81], 0xa
call sym.__write
mov dword [esp + 8], ebx
mov ebx, dword [ebp - 0xa4]
mov dword [esp + 4], edi
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapFree]
mov edx, dword [ebx + 0x34]
sub esp, 0xc
jmp 0x40122d
mov dword [ebp - 0x98], edx
mov eax, dword [ebp - 0x90]
mov edx, section..data
mov dword [esp + 4], edx
mov dword [esp], 3
mov dword [esp + 0x10], eax
mov eax, str.Launching_game_executable__s_for_BattlEye._n
mov dword [esp + 0xc], eax
mov eax, str.wWinMain
mov dword [esp + 8], eax
call sym._wine_dbg_log.constprop.0
mov edx, dword [ebp - 0x98]
jmp 0x4014a4
mov ebx, dword [ebp - 0x98]
xor ecx, ecx
mov dword [esp + 4], ecx
mov eax, dword fs:[0x18]
mov dword [esp + 8], ebx
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], 4
je 0x401205
mov dword [esp], 2
mov eax, str.Failed_to_find_game_executable_name_from_BattlEye_config._n
mov edx, section..data
mov dword [esp + 0xc], eax
mov eax, str.wWinMain
mov dword [esp + 8], eax
mov dword [esp + 4], edx
call sym._wine_dbg_log.constprop.0
jmp 0x401205