Function at 0x401380
Capabilities:
Access peb ldr_data
Get kernel32 base address
Get process heap flags
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
mov esi, eax
lea eax, [ebp - 0x2c]
push ebx
sub esp, 0x5c
mov dword [ebp - 0x2c], edx
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x20]
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov dword [esp], 0x500
call dword [sym.imp.kernel32.dll_FormatMessageW]
sub esp, 0x1c
mov ebx, eax
test eax, eax
jne 0x401430
mov edi, dword fs:[0x18]
cmp dword [edi + 0x34], 0xeb
je 0x401430
test byte [0x404000], 1
je 0x40147d
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.output_formatstring
mov dword [esp + 4], global___dbch
mov dword [esp], 0
call sym._wine_dbg_log.constprop.0
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword [sym.imp.kernel32.dll_GetStdHandle]
mov edi, dword [ebp - 0x20]
mov dword [esp], 0xfffffff5
lea esi, [ebp - 0x1c]
mov dword [ebp - 0x30], eax
call eax
sub esp, 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], esi
mov dword [esp + 8], ebx
mov dword [esp + 4], edi
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteConsoleW]
sub esp, 0x14
test eax, eax
je 0x401488
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_LocalFree]
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov ecx, dword [sym.imp.kernel32.dll_GetOEMCP]
mov dword [ebp - 0x44], ecx
call ecx
mov dword [esp + 0x1c], 0
mov dword [esp], eax
mov eax, dword [sym.imp.kernel32.dll_WideCharToMultiByte]
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], edi
mov dword [esp + 4], 0
mov dword [ebp - 0x3c], eax
call eax
sub esp, 0x20
mov dword [ebp - 0x34], eax
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov edx, dword fs:[0x18]
mov eax, dword [edx + 0x30]
mov dword [ebp - 0x40], edx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [ebp - 0x38], eax
sub esp, 0xc
test eax, eax
je 0x40146e
mov ecx, dword [ebp - 0x44]
call ecx
mov ecx, dword [ebp - 0x38]
mov edx, dword [ebp - 0x34]
mov dword [esp + 0xc], ebx
mov dword [esp + 8], edi
mov edi, dword [ebp - 0x3c]
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], edx
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 4], 0
mov dword [esp], eax
call edi
mov edi, dword [ebp - 0x30]
sub esp, 0x20
mov dword [esp], 0xfffffff5
call edi
mov edx, dword [ebp - 0x34]
mov ebx, dword [ebp - 0x38]
sub esp, 4
mov dword [esp + 8], edx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], esi
mov dword [esp + 4], ebx
mov dword [esp], eax
call dword [sym.imp.kernel32.dll_WriteFile]
mov edx, dword [ebp - 0x40]
sub esp, 0x14
mov dword [esp + 8], ebx
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_HeapFree]
sub esp, 0xc
jmp 0x40146e