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

Disassembly:
push edi
lea edi, [esp + 8]
and esp, 0xfffffff8
push dword [edi - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x1b4
test eax, eax
je 0x401b75
mov dword [ebp - 0x16c], 2
mov edi, eax
mov ebx, edx
xor esi, esi
mov dword [ebp - 0x168], 0
jmp 0x4014ce
cmp edi, 1
jle 0x401898
test esi, esi
jne 0x4018c0
mov esi, dword [ebx + 4]
sub edi, 2
add ebx, 8
test edi, edi
je 0x40152a
mov dword [esp + 4], str._xml
mov eax, dword [ebx]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
je 0x4014b0
mov dword [esp + 4], 0x405080
mov eax, dword [ebx]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x401828
cmp edi, 1
jle 0x401b41
mov eax, dword [ebp - 0x168]
test eax, eax
jne 0x401b5b
mov eax, dword [ebx + 4]
sub edi, 2
add ebx, 8
mov dword [ebp - 0x168], eax
test edi, edi
jne 0x4014ce
mov ebx, dword [ebp - 0x168]
test ebx, ebx
je 0x401b75
test esi, esi
je 0x401f14
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
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
je 0x401bf5
lea eax, [ebp - 0x140]
mov dword [esp], ebx
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetFileSizeEx]
sub esp, 8
test eax, eax
je 0x401a05
mov eax, dword [ebp - 0x140]
mov ecx, eax
or ecx, dword [ebp - 0x13c]
je 0x401a05
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
sub esp, 0xc
mov esi, eax
test eax, eax
je 0x401cce
lea eax, [ebp - 0x150]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x140]
mov dword [esp + 4], esi
mov dword [esp + 8], eax
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
mov edi, eax
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
test edi, edi
je 0x401cd8
mov eax, dword [ebp - 0x150]
cmp eax, 2
jbe 0x40163e
cmp byte [esi], 0xff
je 0x401c79
mov edx, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [ebp - 0x170], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], 0
call edx
sub esp, 0x18
mov edi, eax
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.oleaut32.dll_SysAllocStringLen]
sub esp, 8
mov ebx, eax
test eax, eax
je 0x401ce5
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x150]
mov edx, dword [ebp - 0x170]
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], eax
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], 0
call edx
sub esp, 0x18
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
call sym._get_tasks_root_folder
mov esi, eax
test eax, eax
je 0x401c30
mov eax, dword [ebp - 0x168]
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SysAllocString]
lea ecx, [ebp - 0x164]
mov edi, eax
xor eax, eax
sub esp, 4
mov word [ebp - 0x160], ax
xor eax, eax
mov word [ebp - 0x150], ax
xor eax, eax
mov word [ebp - 0x140], ax
mov eax, dword [esi]
mov dword [esp + 0x44], ecx
mov ecx, dword [ebp - 0x140]
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], ecx
mov ecx, dword [ebp - 0x13c]
mov dword [esp + 0x38], ecx
mov ecx, dword [ebp - 0x138]
mov dword [esp + 0x3c], ecx
mov ecx, dword [ebp - 0x134]
mov dword [esp + 0x40], ecx
mov ecx, dword [ebp - 0x150]
mov dword [esp + 0x20], ecx
mov ecx, dword [ebp - 0x14c]
mov dword [esp + 0x24], ecx
mov ecx, dword [ebp - 0x148]
mov dword [esp + 0x28], ecx
mov ecx, dword [ebp - 0x144]
mov dword [esp + 0x2c], ecx
mov ecx, dword [ebp - 0x160]
mov dword [esp + 0x10], ecx
mov ecx, dword [ebp - 0x15c]
mov dword [esp + 0x14], ecx
mov ecx, dword [ebp - 0x158]
mov dword [esp + 0x18], ecx
mov ecx, dword [ebp - 0x154]
mov dword [esp + 0x1c], ecx
mov ecx, dword [ebp - 0x16c]
mov dword [esp + 0xc], ecx
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], esi
call dword [eax + 0x40]
sub esp, 0x48
mov dword [ebp - 0x168], eax
mov dword [esp], edi
mov edi, dword [sym.imp.oleaut32.dll_SysFreeString]
call edi
sub esp, 4
mov dword [esp], ebx
call edi
mov eax, dword [esi]
sub esp, 4
mov dword [esp], esi
call dword [eax + 8]
mov edx, dword [ebp - 0x168]
sub esp, 4
test edx, edx
js 0x4018a5
mov eax, dword [ebp - 0x164]
xor ebx, ebx
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
mov eax, ebx
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov dword [esp + 4], 0x4050b4
mov eax, dword [ebx]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x401858
mov dword [ebp - 0x16c], 6
dec edi
add ebx, 4
jmp 0x4014ca
mov dword [esp + 4], 0x4050ba
mov eax, dword [ebx]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x401d0e
movzx eax, byte [0x404020]
and eax, 1
cmp edi, 1
jle 0x401de2
test al, al
jne 0x4018e0
sub edi, 2
add ebx, 8
jmp 0x4014ca
test byte [0x404020], 1
jne 0x4019dc
mov ebx, 1
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
test byte [0x404020], 1
je 0x4018a5
mov dword [esp + 0xc], str.Duplicated__xml_argument_n
jmp 0x4019e4
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x401c46
mov eax, ecx
shr eax, 0x10
je 0x401bb0
mov dword [esp + 4], 0xffffffff
mov dword [esp], ecx
mov dword [ebp - 0x170], ecx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x401a73
mov ecx, dword [ebp - 0x170]
cmp word [ecx], 0
je 0x401bd2
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [ecx + edx*2 + 2], 0
jne 0x401930
mov eax, 0x224c
mov dword [ebp - 0x170], esi
mov word [ebp - 0x140], ax
lea eax, [ebp - 0x13e]
mov dword [ebp - 0x174], edi
mov esi, eax
mov dword [ebp - 0x178], ebx
jmp 0x4019a8
cmp ax, 9
je 0x401ab0
cmp ax, 0xa
jne 0x401adf
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea esi, cs:[esi]
lea eax, [edx - 1]
test edx, edx
jle 0x401a31
lea edx, [ebp - 0x1e]
cmp esi, edx
ja 0x401a31
mov edx, eax
movzx eax, word [ecx]
add ecx, 2
cmp ax, 0xd
je 0x401ac1
jbe 0x401968
cmp ax, 0x22
je 0x401b30
cmp ax, 0x5c
jne 0x401ad2
mov ebx, 0x5c5c
add esi, 2
mov word [esi - 2], bx
jmp 0x401990
mov dword [esp + 0xc], str.Missing__xml_value_n
mov dword [esp + 8], str.create_command
mov dword [esp + 4], 0x404020
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4018a5
test byte [0x404020], 1
jne 0x401c50
mov dword [esp], ebx
mov ebx, 1
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, ebx
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
lea esp, [edi - 8]
pop edi
ret
mov ecx, esi
mov edi, dword [ebp - 0x174]
mov esi, dword [ebp - 0x170]
mov byte [ecx], 0x22
mov ebx, dword [ebp - 0x178]
test eax, eax
jle 0x401bed
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x140]
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov edx, eax
mov dword [esp + 0x10], edx
sub edi, 2
add ebx, 8
mov dword [esp + 0xc], str.Unsupported__ru_option__s_n
mov dword [esp + 8], str.create_command
mov dword [esp + 4], 0x404020
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4014ca
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x401990
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x401990
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x401bca
mov edi, eax
mov byte [esi], 0x5c
add esi, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [esi - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefGCC:__GNU__10.3.0]
and edi, 0xf
mov byte [esi - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [esi - 1], al
mov byte [esi - 2], bl
jmp 0x401990
mov edi, 0x225c
add esi, 2
mov word [esi - 2], di
jmp 0x401990
test byte [0x404020], 1
je 0x4018a5
mov dword [esp + 0xc], str.Missing__tn_value_n
jmp 0x4019e4
test byte [0x404020], 1
je 0x4018a5
mov dword [esp + 0xc], str.Duplicated__tn_argument_n
jmp 0x4019e4
test byte [0x404020], 1
je 0x4018a5
mov dword [esp + 0xc], str.Missing__tn_argument_n
mov ebx, 1
mov dword [esp + 8], str.create_command
mov dword [esp + 4], 0x404020
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4018aa
movzx eax, cx
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov edx, eax
jmp 0x401a73
mov byte [esi], al
inc esi
jmp 0x401990
mov eax, 0x224c
mov byte [ebp - 0x13e], 0x22
mov word [ebp - 0x140], ax
lea eax, [ebp - 0x13e]
mov ecx, eax
mov eax, ecx
inc eax
jmp 0x401a60
test byte [0x404020], 1
je 0x4018a5
mov dword [esp + 0xc], str.Could_not_open_file_n
mov ebx, 1
mov dword [esp + 8], str.read_file_to_bstr
mov dword [esp + 4], 0x404020
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4018aa
mov dword [esp], ebx
mov ebx, 1
call dword [sym.imp.oleaut32.dll_SysFreeString]
sub esp, 4
jmp 0x4018aa
mov edx, str._null_
jmp 0x401a73
mov dword [esp + 0xc], str.Empty_file_n
mov dword [esp + 8], str.read_file_to_bstr
mov dword [esp + 4], 0x404020
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x401a12
cmp byte [esi + 1], 0xfe
jne 0x40163e
sub eax, 2
shr eax, 1
mov dword [esp + 4], eax
lea eax, [esi + 2]
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SysAllocStringLen]
sub esp, 8
mov ebx, eax
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
test ebx, ebx
jne 0x4016ea
jmp 0x4018a5
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
push ecx
test byte [0x404020], 1
jne 0x401df7
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 0x4018a5
test byte [0x404020], 1
je 0x4018a5
mov ebx, dword [ebx]
test ebx, ebx
je 0x401f7e
mov eax, ebx
shr eax, 0x10
je 0x401e7b
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x401e49
cmp word [ebx], 0
je 0x401f60
mov esi, edx
lea edx, [edx + 1]
cmp word [ebx + esi*2 + 2], 0
jne 0x401d5d
mov eax, 0x224c
lea edi, [ebp - 0x1e]
mov word [ebp - 0x140], ax
lea eax, [ebp - 0x13e]
jmp 0x401dae
cmp dx, 9
je 0x401f03
cmp dx, 0xa
jne 0x401e99
mov edx, 0x6e5c
add eax, 2
mov word [eax - 2], dx
lea edx, [esi - 1]
test esi, esi
jle 0x401e20
cmp eax, edi
ja 0x401e20
mov esi, edx
movzx edx, word [ebx]
add ebx, 2
cmp dx, 0xd
je 0x401f4f
jbe 0x401d81
cmp dx, 0x22
je 0x401ef2
cmp dx, 0x5c
jne 0x401e90
mov edx, 0x5c5c
add eax, 2
mov word [eax - 2], dx
jmp 0x401da1
test al, al
je 0x4018a5
mov dword [esp + 0xc], str.Missing__ru_value_n
jmp 0x4019e4
mov dword [esp + 0xc], str.Read_failed_n
mov dword [esp + 8], str.read_file_to_bstr
mov dword [esp + 4], 0x404020
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x401ce5
mov byte [eax], 0x22
test edx, edx
jle 0x401f76
mov word [eax + 1], 0x2e2e
lea edx, [eax + 4]
mov byte [eax + 3], 0x2e
lea eax, [ebp - 0x140]
mov byte [edx], 0
mov dword [esp], eax
call sym.___wine_dbg_strdup
mov dword [esp + 0x10], eax
mov ebx, 1
mov dword [esp + 0xc], str.Unsupported_argument__s_n
mov dword [esp + 8], str.create_command
mov dword [esp + 4], 0x404020
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4018aa
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x401e49
lea ecx, [edx - 0x20]
cmp cx, 0x5e
jbe 0x401eea
mov ecx, edx
mov byte [eax], 0x5c
add eax, 5
shr cx, 0xc
movzx ecx, cx
movzx ecx, byte [ecx + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [eax - 4], cl
mov ecx, edx
shr cx, 8
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [eax - 3], cl
mov ecx, edx
and edx, 0xf
shr cx, 4
movzx edx, byte [edx + str.0123456789abcdefGCC:__GNU__10.3.0]
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefGCC:__GNU__10.3.0]
mov byte [eax - 1], dl
mov byte [eax - 2], cl
jmp 0x401da1
mov byte [eax], dl
inc eax
jmp 0x401da1
mov ecx, 0x225c
add eax, 2
mov word [eax - 2], cx
jmp 0x401da1
mov edx, 0x745c
add eax, 2
mov word [eax - 2], dx
jmp 0x401da1
mov ebx, 0x80004005
test byte [0x404020], 1
je 0x4018aa
mov dword [esp + 0xc], str.Missing__xml_argument_n
mov dword [esp + 8], str.create_command
mov dword [esp + 4], 0x404020
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4018aa
mov ecx, 0x725c
add eax, 2
mov word [eax - 2], cx
jmp 0x401da1
mov word [ebp - 0x140], 0x224c
lea eax, [ebp - 0x13e]
mov byte [ebp - 0x13e], 0x22
lea edx, [eax + 1]
jmp 0x401e38
mov eax, str._null_
jmp 0x401e49