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

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x1dc
test eax, eax
je 0x401b88
mov dword [esp + 0x60], 2
mov esi, eax
mov ebx, edx
xor edi, edi
mov dword [esp + 0x5c], 0
mov ebp, dword [sym.imp.ucrtbase.dll__wcsicmp]
jmp 0x4014be
cmp esi, 1
jle 0x401870
test edi, edi
jne 0x401890
mov edi, dword [ebx + 4]
sub esi, 2
add ebx, 8
test esi, esi
je 0x40150e
mov dword [esp + 4], str._xml
mov eax, dword [ebx]
mov dword [esp], eax
call ebp
test eax, eax
je 0x4014a0
mov dword [esp + 4], 0x40507e
mov eax, dword [ebx]
mov dword [esp], eax
call ebp
test eax, eax
jne 0x401800
cmp esi, 1
jle 0x401b12
mov eax, dword [esp + 0x5c]
test eax, eax
jne 0x401b2c
mov eax, dword [ebx + 4]
sub esi, 2
add ebx, 8
mov dword [esp + 0x5c], eax
test esi, esi
jne 0x4014be
mov edx, dword [esp + 0x5c]
test edx, edx
je 0x401b88
test edi, edi
je 0x401edd
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], edi
call dword [sym.imp.kernel32.dll_CreateFileW]
sub esp, 0x1c
mov ebx, eax
cmp eax, 0xffffffff
je 0x401c38
lea eax, [esp + 0xa0]
mov dword [esp], ebx
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetFileSizeEx]
sub esp, 8
test eax, eax
je 0x4019d9
mov eax, dword [esp + 0xa0]
mov ecx, eax
or ecx, dword [esp + 0xa4]
je 0x4019d9
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 edi, eax
test eax, eax
je 0x401b46
lea eax, [esp + 0x90]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [esp + 0xa0]
mov dword [esp + 4], edi
mov dword [esp + 8], eax
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
mov esi, eax
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
test esi, esi
je 0x401b52
mov eax, dword [esp + 0x90]
cmp eax, 2
jbe 0x401626
cmp byte [edi], 0xff
je 0x401cbb
mov dword [esp + 0x14], 0
mov ebp, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], 0
call ebp
sub esp, 0x18
mov ebx, eax
mov dword [esp + 4], eax
mov dword [esp], 0
call sym._SysAllocStringLen_8
sub esp, 8
mov esi, eax
test eax, eax
je 0x401b5f
mov dword [esp + 0x10], eax
mov eax, dword [esp + 0x90]
mov dword [esp + 0x14], ebx
mov dword [esp + 0xc], eax
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], 0
call ebp
sub esp, 0x18
mov dword [esp + 8], edi
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 dbg.get_tasks_root_folder
mov ebx, eax
test eax, eax
je 0x401c7d
mov eax, dword [esp + 0x5c]
mov dword [esp], eax
call sym._SysAllocString_4
sub esp, 4
mov edi, eax
xor eax, eax
mov word [esp + 0x80], ax
xor eax, eax
lea edx, [esp + 0x7c]
mov ecx, dword [esp + 0x60]
mov word [esp + 0x90], ax
xor eax, eax
mov word [esp + 0xa0], ax
mov eax, dword [ebx]
mov dword [esp + 0x44], edx
mov edx, dword [esp + 0xa0]
mov dword [esp + 0xc], ecx
mov dword [esp + 0x34], edx
mov edx, dword [esp + 0xa4]
mov dword [esp + 0x30], 0
mov dword [esp + 0x38], edx
mov edx, dword [esp + 0xa8]
mov dword [esp + 0x3c], edx
mov edx, dword [esp + 0xac]
mov dword [esp + 0x40], edx
mov edx, dword [esp + 0x90]
mov dword [esp + 0x20], edx
mov edx, dword [esp + 0x94]
mov dword [esp + 0x24], edx
mov edx, dword [esp + 0x98]
mov dword [esp + 0x28], edx
mov edx, dword [esp + 0x9c]
mov dword [esp + 0x2c], edx
mov edx, dword [esp + 0x80]
mov dword [esp + 0x10], edx
mov edx, dword [esp + 0x84]
mov dword [esp + 0x14], edx
mov edx, dword [esp + 0x88]
mov dword [esp + 0x18], edx
mov edx, dword [esp + 0x8c]
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 ebp, eax
mov dword [esp], edi
call sym._SysFreeString_4
sub esp, 4
mov dword [esp], esi
call sym._SysFreeString_4
mov eax, dword [ebx]
sub esp, 4
mov dword [esp], ebx
call dword [eax + 8]
sub esp, 4
test ebp, ebp
js 0x40187d
mov eax, dword [esp + 0x7c]
xor ebx, ebx
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
mov eax, ebx
sub esp, 4
add esp, 0x1dc
pop ebx
pop esi
pop edi
pop ebp
ret
mov dword [esp + 4], 0x4050b2
mov eax, dword [ebx]
mov dword [esp], eax
call ebp
test eax, eax
jne 0x401830
mov dword [esp + 0x60], 6
sub esi, 1
add ebx, 4
jmp 0x4014ba
mov dword [esp + 4], 0x4050b8
mov eax, dword [ebx]
mov dword [esp], eax
call ebp
test eax, eax
jne 0x401d10
movzx eax, byte [section..data]
and eax, 1
cmp esi, 1
jle 0x401de6
test al, al
jne 0x4018b0
sub esi, 2
add ebx, 8
jmp 0x4014ba
test byte [section..data], 1
jne 0x4019b0
mov ebx, 1
add esp, 0x1dc
mov eax, ebx
pop ebx
pop esi
pop edi
pop ebp
ret
test byte [section..data], 1
je 0x40187d
mov dword [esp + 0xc], str.Duplicated__xml_argument_n
jmp 0x4019b8
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x401c73
mov eax, ecx
shr eax, 0x10
je 0x401bc3
mov dword [esp + 4], 0xffffffff
mov dword [esp], ecx
mov dword [esp + 0x64], ecx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, str._invalid_
sub esp, 8
test eax, eax
jne 0x401a41
mov ecx, dword [esp + 0x64]
cmp word [ecx], 0
je 0x401be7
lea esi, [esi]
mov edx, eax
lea eax, [eax + 1]
cmp word [ecx + edx*2 + 2], 0
jne 0x401900
mov eax, 0x224c
mov dword [esp + 0x68], esi
mov word [esp + 0xa0], ax
lea eax, [esp + 0xa2]
mov dword [esp + 0x64], edi
mov esi, eax
mov dword [esp + 0x6c], ebx
jmp 0x40197c
cmp ax, 9
je 0x401af0
cmp ax, 0xa
jne 0x401a81
mov eax, 0x6e5c
add esi, 2
mov word [esi - 2], ax
lea esi, [esi]
nop
lea eax, [edx - 1]
test edx, edx
jle 0x401a04
lea edx, [esp + 0x1c2]
cmp esi, edx
ja 0x401a04
mov edx, eax
movzx eax, word [ecx]
add ecx, 2
cmp ax, 0xd
je 0x401b01
jbe 0x401938
cmp ax, 0x22
je 0x401ad8
cmp ax, 0x5c
jne 0x401a74
mov ebx, 0x5c5c
add esi, 2
mov word [esi - 2], bx
jmp 0x401960
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 0x40187d
test byte [section..data], 1
jne 0x401c92
mov dword [esp], ebx
mov ebx, 1
call dword [sym.imp.kernel32.dll_CloseHandle]
mov eax, ebx
sub esp, 4
add esp, 0x1dc
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, esi
mov edi, dword [esp + 0x64]
mov esi, dword [esp + 0x68]
mov byte [ecx], 0x22
mov ebx, dword [esp + 0x6c]
test eax, eax
jle 0x401c05
mov edx, 0x2e2e
mov byte [ecx + 3], 0x2e
lea eax, [ecx + 4]
mov word [ecx + 1], dx
mov byte [eax], 0
lea eax, [esp + 0xa0]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov edx, eax
mov dword [esp + 0x10], edx
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 0x4014ba
lea edi, [eax - 0x20]
cmp di, 0x5e
jbe 0x401bdd
mov edi, eax
mov byte [esi], 0x5c
add esi, 5
shr di, 0xc
movzx edi, di
movzx ebx, byte [edi + str.0123456789abcdefwmain]
mov edi, eax
shr di, 8
and edi, 0xf
mov byte [esi - 4], bl
movzx ebx, byte [edi + str.0123456789abcdefwmain]
mov edi, eax
and eax, 0xf
shr di, 4
movzx eax, byte [eax + str.0123456789abcdefwmain]
and edi, 0xf
mov byte [esi - 3], bl
movzx ebx, byte [edi + str.0123456789abcdefwmain]
mov byte [esi - 1], al
mov byte [esi - 2], bl
jmp 0x401960
mov edi, 0x225c
add esi, 2
mov word [esi - 2], di
jmp 0x401960
mov eax, 0x745c
add esi, 2
mov word [esi - 2], ax
jmp 0x401960
mov eax, 0x725c
add esi, 2
mov word [esi - 2], ax
jmp 0x401960
test byte [section..data], 1
je 0x40187d
mov dword [esp + 0xc], str.Missing__tn_value_n
jmp 0x4019b8
test byte [section..data], 1
je 0x40187d
mov dword [esp + 0xc], str.Duplicated__tn_argument_n
jmp 0x4019b8
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_CloseHandle]
sub esp, 4
test byte [section..data], 1
jne 0x401c0f
mov dword [esp + 8], edi
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 0x40187d
test byte [section..data], 1
je 0x40187d
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 0x401882
movzx eax, cx
mov dword [esp], str._04x
mov dword [esp + 4], eax
call sym._wine_dbg_sprintf.constprop.0
mov edx, eax
jmp 0x401a41
mov byte [esi], al
add esi, 1
jmp 0x401960
mov eax, 0x224c
mov byte [esp + 0xa2], 0x22
mov word [esp + 0xa0], ax
lea eax, [esp + 0xa2]
mov ecx, eax
mov eax, ecx
add eax, 1
jmp 0x401a2d
mov dword [esp + 0xc], str.Read_filed_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 0x401b5f
test byte [section..data], 1
je 0x40187d
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 0x401882
mov edx, str._null_
jmp 0x401a41
mov dword [esp], esi
mov ebx, 1
call sym._SysFreeString_4
sub esp, 4
jmp 0x401882
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 0x4019e6
cmp byte [edi + 1], 0xfe
jne 0x401626
sub eax, 2
shr eax, 1
mov dword [esp + 4], eax
lea eax, [edi + 2]
mov dword [esp], eax
call sym._SysAllocStringLen_8
sub esp, 8
mov esi, eax
mov dword [esp + 8], edi
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 0x4016c6
jmp 0x40187d
test byte [section..data], 1
je 0x40187d
mov ebx, dword [ebx]
test ebx, ebx
je 0x401f62
mov eax, ebx
shr eax, 0x10
je 0x401f18
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 0x401e25
cmp word [ebx], 0
je 0x401f41
mov esi, edx
lea edx, [edx + 1]
cmp word [ebx + esi*2 + 2], 0
jne 0x401d5f
mov eax, 0x224c
lea edi, [esp + 0x1c2]
mov word [esp + 0xa0], ax
lea eax, [esp + 0xa2]
jmp 0x401db6
cmp dx, 9
je 0x401ecc
cmp dx, 0xa
jne 0x401e60
mov ebp, 0x6e5c
add eax, 2
mov word [eax - 2], bp
lea edx, [esi - 1]
test esi, esi
jle 0x401dfb
cmp eax, edi
ja 0x401dfb
mov esi, edx
movzx edx, word [ebx]
add ebx, 2
cmp dx, 0xd
je 0x401f30
jbe 0x401d89
cmp dx, 0x22
je 0x401ebb
cmp dx, 0x5c
jne 0x401e57
mov ecx, 0x5c5c
add eax, 2
mov word [eax - 2], cx
jmp 0x401da9
test al, al
je 0x40187d
mov dword [esp + 0xc], str.Missing__ru_value_n
jmp 0x4019b8
mov byte [eax], 0x22
test edx, edx
jle 0x401f5a
mov word [eax + 1], 0x2e2e
lea edx, [eax + 4]
mov byte [eax + 3], 0x2e
lea eax, [esp + 0xa0]
mov byte [edx], 0
mov dword [esp], eax
call dbg.__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 0x401882
lea ecx, [edx - 0x20]
cmp cx, 0x5e
jbe 0x401eb1
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 0x401da9
mov byte [eax], dl
add eax, 1
jmp 0x401da9
mov ebp, 0x225c
add eax, 2
mov word [eax - 2], bp
jmp 0x401da9
mov edx, 0x745c
add eax, 2
mov word [eax - 2], dx
jmp 0x401da9
mov ebx, 0x80004005
test byte [section..data], 1
je 0x401882
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 0x401882
movzx ebx, bx
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call sym._wine_dbg_sprintf.constprop.0
jmp 0x401e25
mov ecx, 0x725c
add eax, 2
mov word [eax - 2], cx
jmp 0x401da9
mov byte [esp + 0xa2], 0x22
lea eax, [esp + 0xa2]
mov word [esp + 0xa0], 0x224c
lea edx, [eax + 1]
jmp 0x401e13
mov eax, str._null_
jmp 0x401e25