Function at 0x402880
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 edi
push esi
push ebx
mov ebx, ecx
push ecx
sub esp, 0x38
mov eax, dword [0x40952c]
mov esi, dword [ecx]
test eax, eax
je 0x402a20
add ebx, 4
lea edx, [ebp - 0x24]
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 0x402940
mov edi, dword fs:[0x18]
cmp dword [edi + 0x34], 0xeb
je 0x402940
test byte [0x405030], 1
je 0x402a5e
mov eax, esi
call sym._wine_dbgstr_wn.constprop.0
mov dword [esp + 0x14], eax
mov eax, dword [edi + 0x34]
mov dword [esp + 0xc], str.Could_not_format_string:_le_lu__fmt_s_n
mov dword [esp + 0x10], eax
mov dword [esp + 8], str.XCOPY_wprintf
mov dword [esp + 4], 0x405030
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x402a0e
mov edx, dword [0x409548]
test edx, edx
jne 0x402a70
mov esi, dword [0x409528]
mov dword [ebp - 0x1c], 0
mov dword [0x409548], 0
test esi, esi
je 0x402af0
mov edi, dword [0x40952c]
call dword [sym.imp.kernel32.dll_GetOEMCP]
lea edx, [ebp - 0x1c]
mov dword [esp + 0x10], esi
mov dword [esp + 0x1c], edx
mov dword [esp + 0xc], ebx
mov dword [esp + 0x18], 0x40a075
mov dword [esp + 0x14], 0xffff
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov esi, dword [0x409528]
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 [0x40954c]
test eax, eax
jne 0x402a0b
test byte [0x405030], 8
jne 0x402b30
mov dword [0x40954c], 1
mov ebx, dword [ebp - 0x20]
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 + 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]
mov dword [0x40952c], eax
sub esp, 0xc
test eax, eax
jne 0x4028a5
test byte [0x405030], 1
jne 0x402ac0
xor ebx, ebx
lea esp, [ebp - 0x10]
mov eax, ebx
pop ecx
pop ebx
pop esi
pop edi
pop ebp
lea esp, [ecx - 4]
ret
mov esi, dword [0x40952c]
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 0x40294e
jmp 0x4029eb
mov dword [esp + 0xc], str.Out_of_memory___could_not_allocate_2_x_64K_buffers_n
xor ebx, ebx
mov dword [esp + 8], str.XCOPY_wprintf
mov dword [esp + 4], 0x405030
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
jmp 0x402a60
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]
mov dword [0x409528], eax
sub esp, 0xc
mov esi, eax
test eax, eax
je 0x402a55
jmp 0x40296d
mov eax, dword [0x409548]
mov dword [esp + 0xc], str.Writing_to_console____d__n
mov dword [esp + 8], str.XCOPY_wprintf
mov dword [esp + 0x10], eax
mov dword [esp + 4], 0x405030
mov dword [esp], 3
call sym._wine_dbg_log.constprop.0
jmp 0x402a01