Function at 0x4012e0
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
push ebx
lea esi, [ebp - 0x818]
sub esp, 0x97c
mov dword [esp], 0
call sym._GetModuleHandleW_4
mov edx, dword [ebp + 8]
sub esp, 4
mov dword [esp + 0xc], 0x400
mov dword [esp + 8], esi
mov dword [esp], eax
mov dword [esp + 4], edx
call sym._LoadStringW_16
sub esp, 0x10
test eax, eax
jne 0x401370
test byte [section..data], 1
jne 0x401334
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.LoadString_failed_with__d_n
mov dword [esp + 8], global___FUNCTION__
mov dword [esp + 4], 0x403000
mov dword [esp], 0
mov dword [esp + 0x10], eax
call sym._wine_dbg_log.constprop.2
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
lea eax, [ebp + 0xc]
mov edi, dword fs:[0x18]
mov dword [ebp - 0x94c], eax
lea eax, [ebp - 0x94c]
mov dword [edi + 0x34], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0xc], 0
mov dword [esp + 0x18], eax
lea eax, [ebp - 0x948]
mov dword [esp + 8], 0
mov dword [esp + 4], esi
mov dword [esp], 0x500
mov dword [esp + 0x10], eax
call sym._FormatMessageW_28
sub esp, 0x1c
test eax, eax
mov ebx, eax
jne 0x401504
mov eax, dword [edi + 0x34]
test eax, eax
je 0x401504
test byte [section..data], 1
je 0x40132c
mov eax, esi
shr eax, 0x10
test eax, eax
je 0x401740
mov dword [esp + 4], 0xffffffff
mov dword [esp], esi
call sym._IsBadStringPtrW_8
sub esp, 8
test eax, eax
mov edx, str._invalid_
jne 0x4014ca
cmp word [ebp - 0x818], 0
je 0x40176c
add eax, 1
cmp word [esi + eax*2], 0
jne 0x401423
lea edx, [ebp - 0x942]
lea edi, [ebp - 0x822]
mov byte [ebp - 0x944], 0x4c
mov byte [ebp - 0x943], 0x22
mov esi, esi
lea edi, [edi]
sub eax, 1
cmp edx, edi
lea ecx, [eax + 1]
ja 0x40149d
test ecx, ecx
jle 0x40149d
add esi, 2
movzx ecx, word [esi - 2]
cmp cx, 0xd
je 0x4016b0
ja 0x401560
cmp cx, 9
je 0x401720
cmp cx, 0xa
jne 0x4016c0
mov byte [edx], 0x5c
mov byte [edx + 1], 0x6e
add edx, 2
sub eax, 1
cmp edx, edi
lea ecx, [eax + 1]
jbe 0x40145a
test eax, eax
mov byte [edx], 0x22
jle 0x401764
lea eax, [edx + 4]
mov byte [edx + 1], 0x2e
mov byte [edx + 2], 0x2e
mov byte [edx + 3], 0x2e
mov byte [eax], 0
lea eax, [ebp - 0x944]
mov dword [esp], eax
call dbg.__wine_dbg_strdup
mov edx, eax
mov eax, dword fs:[0x18]
mov dword [esp + 0x14], edx
mov eax, dword [eax + 0x34]
mov dword [esp + 0xc], str.Could_not_format_string:_le_u__fmt_s_n
mov dword [esp + 8], str.output_formatstring
mov dword [esp + 4], 0x403000
mov dword [esp], 0
mov dword [esp + 0x10], eax
call sym._wine_dbg_log.constprop.2
jmp 0x40132c
mov esi, dword [ebp - 0x948]
mov dword [esp], 0xfffffff5
lea edi, [ebp - 0x944]
call sym._GetStdHandle_4
sub esp, 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edi
mov dword [esp + 8], ebx
mov dword [esp + 4], esi
mov dword [esp], eax
call sym._WriteConsoleW_20
sub esp, 0x14
test eax, eax
je 0x401583
mov eax, dword [ebp - 0x948]
mov dword [esp], eax
call sym._LocalFree_4
sub esp, 4
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
cmp cx, 0x22
je 0x401730
cmp cx, 0x5c
jne 0x4016c0
mov byte [edx], 0x5c
mov byte [edx + 1], 0x5c
add edx, 2
jmp 0x401450
call sym._GetConsoleOutputCP_0
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x14], 0
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._WideCharToMultiByte_32
sub esp, 0x20
mov dword [ebp - 0x95c], eax
mov edx, dword fs:[0x18]
mov dword [esp + 8], eax
mov dword [esp + 4], 0
mov eax, dword [edx + 0x30]
mov dword [ebp - 0x964], edx
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call sym._HeapAlloc_12
sub esp, 0xc
test eax, eax
mov dword [ebp - 0x960], eax
je 0x401542
call sym._GetConsoleOutputCP_0
mov ecx, dword [ebp - 0x960]
mov edx, dword [ebp - 0x95c]
mov dword [esp + 0xc], ebx
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 8], esi
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], edx
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._WideCharToMultiByte_32
sub esp, 0x20
mov dword [esp], 0xfffffff5
call sym._GetStdHandle_4
mov edx, dword [ebp - 0x95c]
mov ebx, dword [ebp - 0x960]
sub esp, 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], edi
mov dword [esp], eax
mov dword [esp + 8], edx
mov dword [esp + 4], ebx
call sym._WriteFile_20
mov edx, dword [ebp - 0x964]
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 sym._HeapFree_12
sub esp, 0xc
jmp 0x401542
mov byte [edx], 0x5c
mov byte [edx + 1], 0x72
add edx, 2
jmp 0x401450
lea ebx, [ecx - 0x20]
cmp bx, 0x5e
jbe 0x40175a
mov ebx, ecx
mov byte [edx], 0x5c
add edx, 5
shr bx, 0xc
movzx ebx, bx
movzx ebx, byte [ebx + str.0123456789abcdefparse_command_line]
mov byte [edx - 4], bl
mov ebx, ecx
shr bx, 8
and ebx, 0xf
movzx ebx, byte [ebx + str.0123456789abcdefparse_command_line]
mov byte [edx - 3], bl
mov ebx, ecx
and ecx, 0xf
shr bx, 4
movzx ecx, byte [ecx + str.0123456789abcdefparse_command_line]
and ebx, 0xf
movzx ebx, byte [ebx + str.0123456789abcdefparse_command_line]
mov byte [edx - 1], cl
mov byte [edx - 2], bl
jmp 0x401450
mov byte [edx], 0x5c
mov byte [edx + 1], 0x74
add edx, 2
jmp 0x401450
mov byte [edx], 0x5c
mov byte [edx + 1], 0x22
add edx, 2
jmp 0x401450
movzx esi, si
mov dword [esp], str._04x
mov dword [esp + 4], esi
call sym._wine_dbg_sprintf.constprop.3
mov edx, eax
jmp 0x4014ca
mov byte [edx], cl
add edx, 1
jmp 0x401450
lea eax, [edx + 1]
jmp 0x4014b7
xor eax, eax
jmp 0x40142d