Function at 0x401440
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:
lea ecx, [esp + 4]
and esp, 0xfffffff8
push dword [ecx - 4]
push ebp
mov ebp, esp
push edi
push esi
push ebx
push ecx
sub esp, 0x1b8
mov esi, dword [ecx]
mov ebx, dword [ecx + 4]
test esi, esi
je 0x401ae2
mov dword [ebp - 0x170], 2
mov dword [ebp - 0x168], 0
mov dword [ebp - 0x16c], 0
mov edi, dword [sym.imp.ucrtbase.dll__wcsicmp]
jmp 0x4014ba
cmp esi, 1
jle 0x401868
mov eax, dword [ebp - 0x168]
test eax, eax
jne 0x401888
mov eax, dword [ebx + 4]
sub esi, 2
mov dword [ebp - 0x168], eax
add ebx, 8
test esi, esi
je 0x40150e
mov dword [esp + 4], str._xml
mov eax, dword [ebx]
mov dword [esp], eax
call edi
test eax, eax
je 0x401490
mov dword [esp + 4], 0x406080
mov eax, dword [ebx]
mov dword [esp], eax
call edi
test eax, eax
jne 0x401808
cmp esi, 1
jle 0x401a75
mov ecx, dword [ebp - 0x16c]
test ecx, ecx
jne 0x401a8f
mov eax, dword [ebx + 4]
sub esi, 2
add ebx, 8
mov dword [ebp - 0x16c], eax
test esi, esi
jne 0x4014ba
mov ebx, dword [ebp - 0x16c]
test ebx, ebx
je 0x401ae2
mov ecx, dword [ebp - 0x168]
test ecx, ecx
je 0x401e7c
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 0x401b8f
lea eax, [ebp - 0x140]
mov dword [esp], esi
mov dword [esp + 4], eax
call dword [sym.imp.kernel32.dll_GetFileSizeEx]
test eax, eax
push edx
push edx
je 0x4019bc
mov eax, dword [ebp - 0x140]
mov ecx, eax
or ecx, dword [ebp - 0x13c]
je 0x4019bc
mov edx, dword fs:[0x18]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
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 0x401c6f
lea eax, [ebp - 0x150]
mov dword [esp], esi
mov dword [esp + 0xc], eax
mov eax, dword [ebp - 0x140]
mov dword [esp + 0x10], 0
mov dword [esp + 8], eax
mov dword [esp + 4], ebx
call dword [sym.imp.kernel32.dll_ReadFile]
sub esp, 0x14
mov edi, eax
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CloseHandle]
test edi, edi
push esi
je 0x401c79
mov eax, dword [ebp - 0x150]
cmp eax, 2
jbe 0x40162b
cmp byte [ebx], 0xff
je 0x401c1b
mov edx, dword [sym.imp.kernel32.dll_MultiByteToWideChar]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
mov dword [esp], 0
mov dword [ebp - 0x168], edx
call edx
sub esp, 0x18
mov edi, eax
mov dword [esp + 4], eax
mov dword [esp], 0
call dword [sym.imp.oleaut32.dll_SysAllocStringLen]
mov esi, eax
test eax, eax
push edx
push edx
je 0x401ca6
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
mov eax, dword fs:[0x18]
sub esp, 0x18
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
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 fcn.004012b0
mov ebx, eax
test eax, eax
je 0x401bde
mov eax, dword [ebp - 0x16c]
mov dword [esp], eax
call dword [sym.imp.oleaut32.dll_SysAllocString]
mov word [ebp - 0x150], 0
mov word [ebp - 0x140], 0
mov edi, eax
push edx
lea edx, [ebp - 0x164]
mov eax, dword [ebx]
mov dword [esp + 0x44], edx
mov edx, dword [ebp - 0x140]
mov word [ebp - 0x160], 0
mov dword [esp + 0x34], edx
mov edx, dword [ebp - 0x13c]
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 ecx, dword [ebp - 0x170]
mov dword [esp + 0x18], edx
mov edx, dword [ebp - 0x154]
mov dword [esp + 0x30], 0
mov dword [esp + 0x1c], edx
mov dword [esp + 0xc], ecx
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
push ecx
mov dword [esp], esi
call edi
push esi
mov eax, dword [ebx]
mov dword [esp], ebx
call dword [eax + 8]
mov edx, dword [ebp - 0x168]
test edx, edx
push edi
js 0x401875
mov eax, dword [ebp - 0x164]
xor ebx, ebx
mov edx, dword [eax]
mov dword [esp], eax
call dword [edx + 8]
push eax
lea esp, [ebp - 0x10]
mov eax, ebx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov dword [esp + 4], 0x4060b4
mov eax, dword [ebx]
mov dword [esp], eax
call edi
test eax, eax
jne 0x401830
dec esi
add ebx, 4
mov dword [ebp - 0x170], 6
jmp 0x4014b6
mov dword [esp + 4], 0x4060ba
mov eax, dword [ebx]
mov dword [esp], eax
call edi
test eax, eax
jne 0x401ccf
mov al, byte [section..data]
and eax, 1
cmp esi, 1
jle 0x401da5
test al, al
jne 0x4018a0
sub esi, 2
add ebx, 8
jmp 0x4014b6
test byte [section..data], 1
jne 0x401993
mov ebx, 1
lea esp, [ebp - 0x10]
mov eax, ebx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
test byte [section..data], 1
je 0x401875
mov dword [esp + 0xc], str.Duplicated__xml_argument_n
jmp 0x40199b
mov ecx, dword [ebx + 4]
test ecx, ecx
je 0x401bd4
mov eax, ecx
shr eax, 0x10
je 0x401b1d
mov dword [esp + 4], 0xffffffff
mov dword [esp], ecx
mov dword [ebp - 0x174], ecx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
test eax, eax
push edx
push edx
jne 0x401bca
mov ecx, dword [ebp - 0x174]
cmp word [ecx], 0
je 0x401b6f
nop
mov edx, eax
lea eax, [eax + 1]
cmp word [ecx + edx*2 + 2], 0
jne 0x4018e8
lea eax, [ebp - 0x13e]
mov dword [ebp - 0x17c], ebx
mov word [ebp - 0x140], 0x224c
mov dword [ebp - 0x174], ecx
mov dword [ebp - 0x178], esi
mov ebx, eax
jmp 0x401958
cmp ax, 9
je 0x4019f8
cmp ax, 0xa
jne 0x401a12
mov word [ebx], 0x6e5c
add ebx, 2
lea esi, [esi]
lea eax, [edx - 1]
test edx, edx
jle 0x401aa9
lea ecx, [ebp - 0x1e]
cmp ebx, ecx
ja 0x401aa9
mov edx, eax
mov eax, dword [ebp - 0x174]
add eax, 2
mov dword [ebp - 0x174], eax
mov eax, dword [ebp - 0x174]
mov ax, word [eax - 2]
cmp ax, 0xd
je 0x4019e6
jbe 0x401920
cmp ax, 0x22
je 0x401a68
cmp ax, 0x5c
jne 0x401a05
mov word [ebx], 0x5c5c
add ebx, 2
jmp 0x401940
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 fcn.00401260
jmp 0x401875
test byte [section..data], 1
jne 0x401bf2
mov dword [esp], esi
mov ebx, 1
call dword [sym.imp.kernel32.dll_CloseHandle]
push eax
lea esp, [ebp - 0x10]
mov eax, ebx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov word [ebx], 0x725c
add ebx, 2
jmp 0x401940
mov word [ebx], 0x745c
add ebx, 2
jmp 0x401940
lea esi, [eax - 0x20]
cmp si, 0x5e
jbe 0x401b67
mov esi, eax
mov byte [ebx], 0x5c
shr si, 0xc
add ebx, 5
and esi, 0xffff
mov cl, byte [esi + str.0123456789abcdefwmain]
mov esi, eax
shr si, 8
mov byte [ebx - 4], cl
and esi, 0xf
mov cl, byte [esi + str.0123456789abcdefwmain]
mov esi, eax
shr si, 4
and eax, 0xf
and esi, 0xf
mov byte [ebx - 3], cl
mov al, byte [eax + str.0123456789abcdefwmain]
mov cl, byte [esi + str.0123456789abcdefwmain]
mov byte [ebx - 1], al
mov byte [ebx - 2], cl
jmp 0x401940
mov word [ebx], 0x225c
add ebx, 2
jmp 0x401940
test byte [section..data], 1
je 0x401875
mov dword [esp + 0xc], str.Missing__tn_value_n
jmp 0x40199b
test byte [section..data], 1
je 0x401875
mov dword [esp + 0xc], str.Duplicated__tn_argument_n
jmp 0x40199b
mov edx, ebx
mov esi, dword [ebp - 0x178]
mov ebx, dword [ebp - 0x17c]
test eax, eax
mov byte [edx], 0x22
jle 0x401b87
lea eax, [edx + 4]
mov word [edx + 1], 0x2e2e
mov byte [edx + 3], 0x2e
mov byte [eax], 0
lea eax, [ebp - 0x140]
mov dword [esp], eax
call fcn.00403080
jmp 0x401b34
test byte [section..data], 1
je 0x401875
mov dword [esp + 0xc], str.Missing__tn_argument_n
mov dword [esp + 8], str.create_command
mov dword [esp + 4], 0x404000
mov dword [esp], 0
call fcn.00401260
mov ebx, 1
jmp 0x40187a
mov eax, ecx
mov dword [esp], str._04x
and eax, 0xffff
mov dword [esp + 4], eax
call fcn.004011a0
mov dword [esp + 0x10], eax
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
sub esi, 2
call fcn.00401260
add ebx, 8
jmp 0x4014b6
mov byte [ebx], al
inc ebx
jmp 0x401940
lea eax, [ebp - 0x13e]
mov word [ebp - 0x140], 0x224c
mov byte [ebp - 0x13e], 0x22
mov edx, eax
mov eax, edx
inc eax
jmp 0x401acf
test byte [section..data], 1
je 0x401875
mov dword [esp + 0xc], str.Could_not_open_file_n
mov dword [esp + 8], str.read_file_to_bstr
mov dword [esp + 4], 0x404000
mov dword [esp], 0
call fcn.00401260
mov ebx, 1
jmp 0x40187a
mov eax, str._invalid_
jmp 0x401b34
mov eax, str._null_
jmp 0x401b34
mov dword [esp], esi
mov ebx, 1
call dword [sym.imp.oleaut32.dll_SysFreeString]
push eax
jmp 0x40187a
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 fcn.00401260
jmp 0x4019c9
cmp byte [ebx + 1], 0xfe
jne 0x40162b
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]
mov esi, eax
push ecx
push ecx
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 0x4016d6
jmp 0x401875
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_CloseHandle]
push edi
test byte [section..data], 1
je 0x401ca6
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 fcn.00401260
mov eax, dword fs:[0x18]
mov dword [esp + 8], ebx
mov dword [esp + 4], 0
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 0x401875
test byte [section..data], 1
je 0x401875
mov ebx, dword [ebx]
test ebx, ebx
je 0x401ef4
mov eax, ebx
shr eax, 0x10
je 0x401ed9
mov dword [esp + 4], 0xffffffff
mov dword [esp], ebx
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
test eax, eax
push edi
push edi
jne 0x401f1c
cmp word [ebx], 0
je 0x401efe
mov ecx, eax
lea eax, [eax + 1]
cmp word [ebx + ecx*2 + 2], 0
jne 0x401d16
mov word [ebp - 0x140], 0x224c
lea eax, [ebp - 0x13e]
lea edi, [ebp - 0x1e]
mov dword [ebp - 0x168], ebx
jmp 0x401d66
cmp dx, 9
je 0x401e6f
cmp dx, 0xa
jne 0x401e1f
mov word [eax], 0x6e5c
add eax, 2
lea edx, [ecx - 1]
test ecx, ecx
jle 0x401dc4
cmp eax, edi
ja 0x401dc4
mov ecx, edx
mov esi, dword [ebp - 0x168]
add esi, 2
mov dword [ebp - 0x168], esi
mov edx, dword [ebp - 0x168]
mov dx, word [edx - 2]
cmp dx, 0xd
je 0x401dba
jbe 0x401d3d
cmp dx, 0x22
je 0x401ecc
cmp dx, 0x5c
jne 0x401eb7
mov word [eax], 0x5c5c
add eax, 2
jmp 0x401d59
test al, al
je 0x401875
mov dword [esp + 0xc], str.Missing__ru_value_n
jmp 0x40199b
mov word [eax], 0x725c
add eax, 2
jmp 0x401d59
mov byte [eax], 0x22
test edx, edx
jle 0x401f14
lea edx, [eax + 4]
mov word [eax + 1], 0x2e2e
mov byte [eax + 3], 0x2e
lea eax, [ebp - 0x140]
mov byte [edx], 0
mov dword [esp], eax
call fcn.00403080
mov dword [esp + 0x10], eax
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
mov ebx, 1
call fcn.00401260
jmp 0x40187a
mov esi, edx
mov byte [eax], 0x5c
shr si, 0xc
add eax, 5
and esi, 0xffff
mov bl, byte [esi + str.0123456789abcdefwmain]
mov esi, edx
shr si, 8
mov byte [eax - 4], bl
and esi, 0xf
mov bl, byte [esi + str.0123456789abcdefwmain]
mov esi, edx
shr si, 4
and edx, 0xf
and esi, 0xf
mov byte [eax - 3], bl
mov dl, byte [edx + str.0123456789abcdefwmain]
mov bl, byte [esi + str.0123456789abcdefwmain]
mov byte [eax - 1], dl
mov byte [eax - 2], bl
jmp 0x401d59
mov word [eax], 0x745c
add eax, 2
jmp 0x401d59
test byte [section..data], 1
mov ebx, 0x80004005
je 0x40187a
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 fcn.00401260
jmp 0x40187a
lea esi, [edx - 0x20]
cmp si, 0x5e
ja 0x401e1f
mov byte [eax], dl
inc eax
jmp 0x401d59
mov word [eax], 0x225c
add eax, 2
jmp 0x401d59
and ebx, 0xffff
mov dword [esp], str._04x
mov dword [esp + 4], ebx
call fcn.004011a0
jmp 0x401ded
mov eax, str._null_
jmp 0x401ded
mov word [ebp - 0x140], 0x224c
mov byte [ebp - 0x13e], 0x22
lea eax, [ebp - 0x13e]
lea edx, [eax + 1]
jmp 0x401ddc
mov eax, str._invalid_
jmp 0x401ded