Function at 0x401380
Capabilities:
Get process heap flags
Write file on windows

Disassembly:
lea ecx, [esp + 4]
and esp, 0xfffffff0
push dword [ecx - 4]
push ebp
mov ebp, esp
push esi
push ebx
mov ebx, ecx
push ecx
sub esp, 0x3c
mov eax, dword [0x406008]
mov esi, dword [ecx]
test eax, eax
je 0x401560
lea edx, [ebp - 0x24]
add ebx, 4
mov dword [esp + 0x10], eax
mov dword [ebp - 0x24], ebx
mov dword [esp + 0x18], edx
mov dword [esp + 0x14], 0x7fff
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov dword [esp], 0x400
call dword [sym.imp.kernel32.dll_FormatMessageW]
sub esp, 0x1c
mov ebx, eax
test eax, eax
jne 0x401488
mov eax, dword fs:[0x18]
cmp dword [eax + 0x34], 0xeb
je 0x401488
test byte [0x404004], 1
je 0x40159e
test esi, esi
je 0x4016a8
mov eax, esi
shr eax, 0x10
test eax, eax
je 0x4016b8
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call dword [sym.imp.kernel32.dll_IsBadStringPtrW]
mov edx, eax
sub esp, 8
mov eax, str._invalid_
test edx, edx
jne 0x401446
mov eax, esi
call section..text
mov dword [esp + 0x14], eax
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x34]
mov dword [esp + 0xc], str.Could_not_format_string:_le_u__fmt_s_n
mov dword [esp + 8], str.ATTRIB_wprintf
mov dword [esp + 4], 0x404004
mov dword [esp], 0
mov dword [esp + 0x10], eax
call fcn.004011e0
jmp 0x401552
mov edx, dword [section..data]
test edx, edx
jne 0x4015b0
mov eax, dword [0x406004]
mov dword [ebp - 0x1c], 0
mov dword [section..data], 0
test eax, eax
je 0x401630
mov dword [esp + 0x10], eax
mov eax, dword [0x406008]
lea edx, [ebp - 0x1c]
mov dword [esp + 0x1c], edx
mov dword [esp + 0xc], ebx
mov dword [esp + 0x18], 0x4050a4
mov dword [esp + 0x14], 0xffff
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov dword [esp], 0
call dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov esi, dword [0x406004]
sub esp, 0x20
mov ebx, eax
mov dword [esp], 0xfffffff5
call dword [sym.imp.kernel32.dll_GetStdHandle]
lea edx, [ebp - 0x20]
sub esp, 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edx
mov dword [esp + 8], ebx
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteFile]
sub esp, 0x14
mov eax, dword [section..bss]
test eax, eax
jne 0x40154f
test byte [0x404004], 8
jne 0x401670
mov dword [section..bss], 1
mov ebx, dword [ebp - 0x20]
lea esp, [ebp - 0xc]
mov eax, ebx
pop ecx
pop ebx
pop esi
pop ebp
lea esp, [ecx - 4]
ret
mov dword [esp + 8], 0x1fffe
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_HeapAlloc]
sub esp, 0xc
mov dword [0x406008], eax
test eax, eax
jne 0x4013a4
test byte [0x404004], 1
jne 0x401600
xor ebx, ebx
lea esp, [ebp - 0xc]
mov eax, ebx
pop ecx
pop ebx
pop esi
pop ebp
lea esp, [ecx - 4]
ret
mov esi, dword [0x406008]
mov dword [esp], 0xfffffff5
call dword [sym.imp.kernel32.dll_GetStdHandle]
lea edx, [ebp - 0x20]
sub esp, 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edx
mov dword [esp + 8], ebx
mov dword [esp + 4], esi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteConsoleW]
sub esp, 0x14
test eax, eax
je 0x401496
jmp 0x40152f
mov dword [esp + 0xc], str.Out_of_memory___could_not_allocate_2_x_64_KB_buffers_n
xor ebx, ebx
mov dword [esp + 8], str.ATTRIB_wprintf
mov dword [esp + 4], 0x404004
mov dword [esp], 0
call fcn.004011e0
jmp 0x4015a0
mov dword [esp + 8], 0xffff
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_HeapAlloc]
sub esp, 0xc
mov dword [0x406004], eax
test eax, eax
je 0x401595
jmp 0x4014b4
mov eax, dword [section..data]
mov dword [esp + 0xc], str.Writing_to_console____d__n
mov dword [esp + 8], str.ATTRIB_wprintf
mov dword [esp + 4], 0x404004
mov dword [esp], 3
mov dword [esp + 0x10], eax
call fcn.004011e0
jmp 0x401545
mov eax, str._null_
jmp 0x401446
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call fcn.00401320
jmp 0x401446