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 ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x1dc
test eax, eax
je 0x401b55
mov dword [ebp - 0x180], 2
mov edi, eax
mov ebx, edx
xor esi, esi
mov dword [ebp - 0x17c], 0
jmp 0x4014be
cmp edi, 1
jle 0x401888
test esi, esi
jne 0x4018a8
mov esi, dword [ebx + 4]
sub edi, 2
add ebx, 8
test edi, edi
je 0x40151a
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 0x4014a0
mov dword [esp + 4], 0x405080
mov eax, dword [ebx]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x401818
cmp edi, 1
jle 0x401b21
mov eax, dword [ebp - 0x17c]
test eax, eax
jne 0x401b3b
mov eax, dword [ebx + 4]
sub edi, 2
add ebx, 8
mov dword [ebp - 0x17c], eax
test edi, edi
jne 0x4014be
mov ebx, dword [ebp - 0x17c]
test ebx, ebx
je 0x401b55
test esi, esi
je 0x401ef4
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 0x401bd5
lea eax, [ebp - 0x148]
mov dword [esp], ebx
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetFileSizeEx]
sub esp, 8
test eax, eax
je 0x4019e5
mov eax, dword [ebp - 0x148]
mov ecx, eax
or ecx, dword [ebp - 0x144]
je 0x4019e5
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 0x401cae
lea eax, [ebp - 0x158]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x148]
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 0x401cb8
mov eax, dword [ebp - 0x158]
cmp eax, 2
jbe 0x40162e
cmp byte [esi], 0xff
je 0x401c59
mov edx, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [ebp - 0x184], 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 0x401cc5
mov dword [esp + 0x10], eax
mov eax, dword [ebp - 0x158]
mov edx, dword [ebp - 0x184]
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 0x401c10
mov eax, dword [ebp - 0x17c]
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SysAllocString]
lea ecx, [ebp - 0x16c]
mov edi, eax
xor eax, eax
sub esp, 4
mov word [ebp - 0x168], ax
xor eax, eax
mov word [ebp - 0x158], ax
xor eax, eax
mov word [ebp - 0x148], ax
mov eax, dword [esi]
mov dword [esp + 0x44], ecx
mov ecx, dword [ebp - 0x148]
mov dword [esp + 0x30], 0
mov dword [esp + 0x34], ecx
mov ecx, dword [ebp - 0x144]
mov dword [esp + 0x38], ecx
mov ecx, dword [ebp - 0x140]
mov dword [esp + 0x3c], ecx
mov ecx, dword [ebp - 0x13c]
mov dword [esp + 0x40], ecx
mov ecx, dword [ebp - 0x158]
mov dword [esp + 0x20], ecx
mov ecx, dword [ebp - 0x154]
mov dword [esp + 0x24], ecx
mov ecx, dword [ebp - 0x150]
mov dword [esp + 0x28], ecx
mov ecx, dword [ebp - 0x14c]
mov dword [esp + 0x2c], ecx
mov ecx, dword [ebp - 0x168]
mov dword [esp + 0x10], ecx
mov ecx, dword [ebp - 0x164]
mov dword [esp + 0x14], ecx
mov ecx, dword [ebp - 0x160]
mov dword [esp + 0x18], ecx
mov ecx, dword [ebp - 0x15c]
mov dword [esp + 0x1c], ecx
mov ecx, dword [ebp - 0x180]
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 - 0x17c], 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 - 0x17c]
sub esp, 4
test edx, edx
js 0x401895
mov eax, dword [ebp - 0x16c]
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
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 0x401848
mov dword [ebp - 0x180], 6
dec edi
add ebx, 4
jmp 0x4014ba
mov dword [esp + 4], 0x4050ba
mov eax, dword [ebx]
mov dword [esp], eax
call dword [sym.imp.ucrtbase.dll__wcsicmp]
test eax, eax
jne 0x401cee
movzx eax, byte [0x404020]
and eax, 1
cmp edi, 1
jle 0x401dc2
test al, al
jne 0x4018c0
sub edi, 2
add ebx, 8
jmp 0x4014ba
test byte [0x404020], 1
jne 0x4019bc
mov ebx, 1
lea esp, [ebp - 0xc]
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [0x404020], 1
je 0x401895
mov dword [esp + 0xc], str.Duplicated__xml_argument_n
jmp 0x4019c4
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x401c26
mov eax, ecx
shr eax, 0x10
je 0x401b90
mov dword [esp + 4], 0xffffffff
mov dword [esp], ecx
mov dword [ebp - 0x184], ecx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x401a4f
mov ecx, dword [ebp - 0x184]
cmp word [ecx], 0
je 0x401bb2
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [ecx + edx*2 + 2], 0
jne 0x401910
mov eax, 0x224c
mov dword [ebp - 0x184], esi
mov word [ebp - 0x148], ax
lea eax, [ebp - 0x146]
mov dword [ebp - 0x188], edi
mov esi, eax
mov dword [ebp - 0x18c], ebx
jmp 0x401988
cmp ax, 9
je 0x401a88
cmp ax, 0xa
jne 0x401ab7
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea esi, [esi]
nop
lea eax, [edx - 1]
test edx, edx
jle 0x401a0d
lea edx, [ebp - 0x26]
cmp esi, edx
ja 0x401a0d
mov edx, eax
movzx eax, word [ecx]
add ecx, 2
cmp ax, 0xd
je 0x401a99
jbe 0x401948
cmp ax, 0x22
je 0x401b10
cmp ax, 0x5c
jne 0x401aaa
mov ebx, 0x5c5c
add esi, 2
mov word [esi - 2], bx
jmp 0x401970
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 0x401895
test byte [0x404020], 1
jne 0x401c30
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
ret
mov ecx, esi
mov edi, dword [ebp - 0x188]
mov esi, dword [ebp - 0x184]
mov byte [ecx], 0x22
mov ebx, dword [ebp - 0x18c]
test eax, eax
jle 0x401bcd
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [ebp - 0x148]
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 0x4014ba
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x401970
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x401970
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x401baa
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 0x401970
mov edi, 0x225c
add esi, 2
mov word [esi - 2], di
jmp 0x401970
test byte [0x404020], 1
je 0x401895
mov dword [esp + 0xc], str.Missing__tn_value_n
jmp 0x4019c4
test byte [0x404020], 1
je 0x401895
mov dword [esp + 0xc], str.Duplicated__tn_argument_n
jmp 0x4019c4
test byte [0x404020], 1
je 0x401895
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 0x40189a
movzx eax, cx
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov edx, eax
jmp 0x401a4f
mov byte [esi], al
inc esi
jmp 0x401970
mov eax, 0x224c
mov byte [ebp - 0x146], 0x22
mov word [ebp - 0x148], ax
lea eax, [ebp - 0x146]
mov ecx, eax
mov eax, ecx
inc eax
jmp 0x401a3c
test byte [0x404020], 1
je 0x401895
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 0x40189a
mov dword [esp], ebx
mov ebx, 1
call dword [sym.imp.oleaut32.dll_SysFreeString]
sub esp, 4
jmp 0x40189a
mov edx, str._null_
jmp 0x401a4f
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 0x4019f2
cmp byte [esi + 1], 0xfe
jne 0x40162e
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 0x4016da
jmp 0x401895
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
push ecx
test byte [0x404020], 1
jne 0x401dd7
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 0x401895
test byte [0x404020], 1
je 0x401895
mov ebx, dword [ebx]
test ebx, ebx
je 0x401f5e
mov eax, ebx
shr eax, 0x10
je 0x401e5b
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 0x401e29
cmp word [ebx], 0
je 0x401f40
mov esi, edx
lea edx, [edx + 1]
cmp word [ebx + esi*2 + 2], 0
jne 0x401d3d
mov eax, 0x224c
lea edi, [ebp - 0x26]
mov word [ebp - 0x148], ax
lea eax, [ebp - 0x146]
jmp 0x401d8e
cmp dx, 9
je 0x401ee3
cmp dx, 0xa
jne 0x401e79
mov edx, 0x6e5c
add eax, 2
mov word [eax - 2], dx
lea edx, [esi - 1]
test esi, esi
jle 0x401e00
cmp eax, edi
ja 0x401e00
mov esi, edx
movzx edx, word [ebx]
add ebx, 2
cmp dx, 0xd
je 0x401f2f
jbe 0x401d61
cmp dx, 0x22
je 0x401ed2
cmp dx, 0x5c
jne 0x401e70
mov edx, 0x5c5c
add eax, 2
mov word [eax - 2], dx
jmp 0x401d81
test al, al
je 0x401895
mov dword [esp + 0xc], str.Missing__ru_value_n
jmp 0x4019c4
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 0x401cc5
mov byte [eax], 0x22
test edx, edx
jle 0x401f56
mov word [eax + 1], 0x2e2e
lea edx, [eax + 4]
mov byte [eax + 3], 0x2e
lea eax, [ebp - 0x148]
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 0x40189a
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x401e29
lea ecx, [edx - 0x20]
cmp cx, 0x5e
jbe 0x401eca
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 0x401d81
mov byte [eax], dl
inc eax
jmp 0x401d81
mov ecx, 0x225c
add eax, 2
mov word [eax - 2], cx
jmp 0x401d81
mov edx, 0x745c
add eax, 2
mov word [eax - 2], dx
jmp 0x401d81
mov ebx, 0x80004005
test byte [0x404020], 1
je 0x40189a
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 0x40189a
mov ecx, 0x725c
add eax, 2
mov word [eax - 2], cx
jmp 0x401d81
mov word [ebp - 0x148], 0x224c
lea eax, [ebp - 0x146]
mov byte [ebp - 0x146], 0x22
lea edx, [eax + 1]
jmp 0x401e18
mov eax, str._null_
jmp 0x401e29