Function at 0x401490
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, 0x1bc
test eax, eax
je 0x401ba5
mov dword [ebp - 0x170], 2
mov edi, dword [sym.imp.ucrtbase.dll__wcsicmp]
mov esi, eax
mov ebx, edx
mov dword [ebp - 0x168], 0
mov dword [ebp - 0x16c], 0
jmp 0x40150a
cmp esi, 1
jle 0x4018d0
mov edx, dword [ebp - 0x168]
test edx, edx
jne 0x4018f0
mov eax, dword [ebx + 4]
sub esi, 2
add ebx, 8
mov dword [ebp - 0x168], eax
test esi, esi
je 0x40155e
mov dword [esp + 4], str._xml
mov eax, dword [ebx]
mov dword [esp], eax
call edi
test eax, eax
je 0x4014e0
mov dword [esp + 4], 0x405080
mov eax, dword [ebx]
mov dword [esp], eax
call edi
test eax, eax
jne 0x401868
cmp esi, 1
jle 0x401b71
mov eax, dword [ebp - 0x16c]
test eax, eax
jne 0x401b8b
mov eax, dword [ebx + 4]
sub esi, 2
add ebx, 8
mov dword [ebp - 0x16c], eax
test esi, esi
jne 0x40150a
mov ebx, dword [ebp - 0x16c]
test ebx, ebx
je 0x401ba5
mov ecx, dword [ebp - 0x168]
test ecx, ecx
je 0x401f4a
mov eax, dword [ebp - 0x168]
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], eax
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov esi, eax
cmp eax, 0xffffffff
je 0x401c29
lea eax, [ebp - 0x140]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetFileSizeEx]
sub esp, 8
test eax, eax
je 0x401a40
mov eax, dword [ebp - 0x140]
mov ecx, eax
or ecx, dword [ebp - 0x13c]
je 0x401a40
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 ebx, eax
test eax, eax
je 0x401d02
lea eax, [ebp - 0x150]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x140]
mov dword [esp + 4], ebx
mov dword [esp + 8], eax
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
mov edi, eax
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
test edi, edi
je 0x401d0c
mov eax, dword [ebp - 0x150]
cmp eax, 2
jbe 0x40167e
cmp byte [ebx], 0xff
je 0x401cad
mov edx, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [ebp - 0x168], edx
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
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 esi, eax
test eax, eax
je 0x401d19
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x150]
mov edx, dword [ebp - 0x168]
mov dword [esp + 0x14], edi
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov dword [esp], 0
call edx
sub esp, 0x18
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]
sub esp, 0xc
call sym._get_tasks_root_folder
mov ebx, eax
test eax, eax
je 0x401c64
mov eax, dword [ebp - 0x16c]
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SysAllocString]
lea edx, [ebp - 0x164]
mov ecx, dword [ebp - 0x170]
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 [ebx]
mov dword [esp + 0x44], edx
mov edx, dword [ebp - 0x140]
mov dword [esp + 0xc], ecx
mov dword [esp + 0x34], edx
mov edx, dword [ebp - 0x13c]
mov dword [esp + 0x30], 0
mov dword [esp + 0x38], edx
mov edx, dword [ebp - 0x138]
mov dword [esp + 0x3c], edx
mov edx, dword [ebp - 0x134]
mov dword [esp + 0x40], edx
mov edx, dword [ebp - 0x150]
mov dword [esp + 0x20], edx
mov edx, dword [ebp - 0x14c]
mov dword [esp + 0x24], edx
mov edx, dword [ebp - 0x148]
mov dword [esp + 0x28], edx
mov edx, dword [ebp - 0x144]
mov dword [esp + 0x2c], edx
mov edx, dword [ebp - 0x160]
mov dword [esp + 0x10], edx
mov edx, dword [ebp - 0x15c]
mov dword [esp + 0x14], edx
mov edx, dword [ebp - 0x158]
mov dword [esp + 0x18], edx
mov edx, dword [ebp - 0x154]
mov dword [esp + 0x1c], edx
mov dword [esp + 8], esi
mov dword [esp + 4], edi
mov dword [esp], ebx
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], esi
call edi
mov eax, dword [ebx]
sub esp, 4
mov dword [esp], ebx
call dword [eax + 8]
mov edx, dword [ebp - 0x168]
sub esp, 4
test edx, edx
js 0x4018dd
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 edi
test eax, eax
jne 0x401890
mov dword [ebp - 0x170], 6
sub esi, 1
add ebx, 4
jmp 0x401506
mov dword [esp + 4], 0x4050ba
mov eax, dword [ebx]
mov dword [esp], eax
call edi
test eax, eax
jne 0x401d42
movzx eax, byte [section..data]
and eax, 1
cmp esi, 1
jle 0x401e16
test al, al
jne 0x401910
sub esi, 2
add ebx, 8
jmp 0x401506
test byte [section..data], 1
jne 0x401a17
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 [section..data], 1
je 0x4018dd
mov dword [esp + 0xc], str.Duplicated__xml_argument_n
jmp 0x401a1f
mov edx, dword [ebx + 4]
test edx, edx
je 0x401c7a
mov eax, edx
shr eax, 0x10
je 0x401be0
mov dword [esp + 4], 0xffffffff
mov dword [esp], edx
mov dword [ebp - 0x174], edx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov ecx, str._invalid_
sub esp, 8
test eax, eax
jne 0x401aa8
mov edx, dword [ebp - 0x174]
cmp word [edx], 0
je 0x401c04
lea esi, [esi]
mov ecx, eax
lea eax, [eax + 1]
cmp word [edx + ecx*2 + 2], 0
jne 0x401960
mov eax, 0x224c
mov dword [ebp - 0x17c], ebx
mov word [ebp - 0x140], ax
lea eax, [ebp - 0x13e]
mov dword [ebp - 0x174], edx
mov ebx, eax
mov dword [ebp - 0x178], esi
jmp 0x4019d8
cmp ax, 9
je 0x401ae0
cmp ax, 0xa
jne 0x401b0f
mov eax, 0x6e5c
add ebx, 2
mov word [ebx - 2], ax
lea esi, [esi]
nop
lea eax, [ecx - 1]
test ecx, ecx
jle 0x401a6c
lea ecx, [ebp - 0x1e]
cmp ebx, ecx
ja 0x401a6c
mov ecx, eax
add dword [ebp - 0x174], 2
mov eax, dword [ebp - 0x174]
movzx eax, word [eax - 2]
cmp ax, 0xd
je 0x401af1
jbe 0x401998
cmp ax, 0x22
je 0x401b60
cmp ax, 0x5c
jne 0x401b02
mov esi, 0x5c5c
add ebx, 2
mov word [ebx - 2], si
jmp 0x4019c0
mov dword [esp + 0xc], str.Missing__xml_value_n
mov dword [esp + 8], str.create_command
mov dword [esp + 4], 0x404000
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4018dd
test byte [section..data], 1
jne 0x401c84
mov dword [esp], esi
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, ebx
mov esi, dword [ebp - 0x178]
mov ebx, dword [ebp - 0x17c]
mov byte [ecx], 0x22
test eax, eax
jle 0x401c1f
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 ecx, eax
mov dword [esp + 0x10], ecx
sub esi, 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], 0x404000
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x401506
mov eax, 0x745c
add ebx, 2
mov word [ebx - 2], ax
jmp 0x4019c0
mov eax, 0x725c
add ebx, 2
mov word [ebx - 2], ax
jmp 0x4019c0
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x401bfa
mov esi, eax
mov byte [ebx], 0x5c
add ebx, 5
shr si, 0xc
movzx esi, si
movzx edx, byte [esi + str.0123456789abcdefwmain]
mov esi, eax
shr si, 8
and esi, 0xf
mov byte [ebx - 4], dl
movzx edx, byte [esi + str.0123456789abcdefwmain]
mov esi, eax
and eax, 0xf
shr si, 4
movzx eax, byte [eax + str.0123456789abcdefwmain]
and esi, 0xf
mov byte [ebx - 3], dl
movzx edx, byte [esi + str.0123456789abcdefwmain]
mov byte [ebx - 1], al
mov byte [ebx - 2], dl
jmp 0x4019c0
mov eax, 0x225c
add ebx, 2
mov word [ebx - 2], ax
jmp 0x4019c0
test byte [section..data], 1
je 0x4018dd
mov dword [esp + 0xc], str.Missing__tn_value_n
jmp 0x401a1f
test byte [section..data], 1
je 0x4018dd
mov dword [esp + 0xc], str.Duplicated__tn_argument_n
jmp 0x401a1f
test byte [section..data], 1
je 0x4018dd
mov dword [esp + 0xc], str.Missing__tn_argument_n
mov ebx, 1
mov dword [esp + 8], str.create_command
mov dword [esp + 4], 0x404000
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4018e2
movzx eax, dx
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov ecx, eax
jmp 0x401aa8
mov byte [ebx], al
add ebx, 1
jmp 0x4019c0
mov eax, 0x224c
mov byte [ebp - 0x13e], 0x22
mov word [ebp - 0x140], ax
lea eax, [ebp - 0x13e]
mov ecx, eax
mov eax, ecx
add eax, 1
jmp 0x401a95
test byte [section..data], 1
je 0x4018dd
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], 0x404000
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4018e2
mov dword [esp], esi
mov ebx, 1
call dword [sym.imp.oleaut32.dll_SysFreeString]
sub esp, 4
jmp 0x4018e2
mov ecx, str._null_
jmp 0x401aa8
mov dword [esp + 0xc], str.Empty_file_n
mov dword [esp + 8], str.read_file_to_bstr
mov dword [esp + 4], 0x404000
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x401a4d
cmp byte [ebx + 1], 0xfe
jne 0x40167e
sub eax, 2
shr eax, 1
mov dword [esp + 4], eax
lea eax, [ebx + 2]
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SysAllocStringLen]
sub esp, 8
mov esi, eax
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]
sub esp, 0xc
test esi, esi
jne 0x40172a
jmp 0x4018dd
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CloseHandle]
push edx
test byte [section..data], 1
jne 0x401e2b
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]
sub esp, 0xc
jmp 0x4018dd
test byte [section..data], 1
je 0x4018dd
mov ebx, dword [ebx]
test ebx, ebx
je 0x401fb4
mov eax, ebx
shr eax, 0x10
je 0x401eaf
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 0x401e7d
cmp word [ebx], 0
je 0x401f96
mov esi, edx
lea edx, [edx + 1]
cmp word [ebx + esi*2 + 2], 0
jne 0x401d91
mov eax, 0x224c
lea edi, [ebp - 0x1e]
mov word [ebp - 0x140], ax
lea eax, [ebp - 0x13e]
jmp 0x401de2
cmp dx, 9
je 0x401f39
cmp dx, 0xa
jne 0x401ecd
mov edx, 0x6e5c
add eax, 2
mov word [eax - 2], dx
lea edx, [esi - 1]
test esi, esi
jle 0x401e54
cmp eax, edi
ja 0x401e54
mov esi, edx
movzx edx, word [ebx]
add ebx, 2
cmp dx, 0xd
je 0x401f85
jbe 0x401db5
cmp dx, 0x22
je 0x401f28
cmp dx, 0x5c
jne 0x401ec4
mov edx, 0x5c5c
add eax, 2
mov word [eax - 2], dx
jmp 0x401dd5
test al, al
je 0x4018dd
mov dword [esp + 0xc], str.Missing__ru_value_n
jmp 0x401a1f
mov dword [esp + 0xc], str.Read_failed_n
mov dword [esp + 8], str.read_file_to_bstr
mov dword [esp + 4], 0x404000
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x401d19
mov byte [eax], 0x22
test edx, edx
jle 0x401fac
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], 0x404000
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4018e2
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x401e7d
lea ecx, [edx - 0x20]
cmp cx, 0x5e
jbe 0x401f1e
mov ecx, edx
mov byte [eax], 0x5c
add eax, 5
shr cx, 0xc
movzx ecx, cx
movzx ecx, byte [ecx + str.0123456789abcdefwmain]
mov byte [eax - 4], cl
mov ecx, edx
shr cx, 8
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefwmain]
mov byte [eax - 3], cl
mov ecx, edx
and edx, 0xf
shr cx, 4
movzx edx, byte [edx + str.0123456789abcdefwmain]
and ecx, 0xf
movzx ecx, byte [ecx + str.0123456789abcdefwmain]
mov byte [eax - 1], dl
mov byte [eax - 2], cl
jmp 0x401dd5
mov byte [eax], dl
add eax, 1
jmp 0x401dd5
mov ecx, 0x225c
add eax, 2
mov word [eax - 2], cx
jmp 0x401dd5
mov edx, 0x745c
add eax, 2
mov word [eax - 2], dx
jmp 0x401dd5
mov ebx, 0x80004005
test byte [section..data], 1
je 0x4018e2
mov dword [esp + 0xc], str.Missing__xml_argument_n
mov dword [esp + 8], str.create_command
mov dword [esp + 4], 0x404000
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x4018e2
mov ecx, 0x725c
add eax, 2
mov word [eax - 2], cx
jmp 0x401dd5
mov word [ebp - 0x140], 0x224c
lea eax, [ebp - 0x13e]
mov byte [ebp - 0x13e], 0x22
lea edx, [eax + 1]
jmp 0x401e6c
mov eax, str._null_
jmp 0x401e7d