Function at 0x401350
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x3c
mov esi, dword [ebp + 0xc]
mov edi, dword [ebp + 8]
mov dword [ebp - 0x14], 0
test esi, esi
je 0x401435
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x401435
mov eax, dword [edi + 0x24]
mov dword [ebp - 0x20], eax
test eax, eax
jne 0x4013e5
mov eax, dword [edi + 0x28]
lea ecx, [eax - 2]
cmp ecx, 1
jbe 0x4015f0
cmp eax, 4
je 0x401450
cmp eax, 1
je 0x401450
lea eax, [ebp - 0x14]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0x10]
mov dword [esp + 8], eax
lea esi, [esi]
mov dword [esp + 4], esi
mov eax, dword [edi + 0x20]
mov dword [esp], eax
call sym._WriteFile_20
sub esp, 0x14
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x20], eax
mov eax, dword [ebp - 0x20]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0xc
lea eax, [ebp - 0x14]
mov ecx, dword [ebp + 0x10]
mov edx, esi
mov dword [ebp - 0x1c], eax
mov esi, ecx
mov ebx, esi
cmp esi, 0x7fff
jbe 0x401401
mov ebx, 0x7fff
mov eax, dword [ebp - 0x1c]
mov dword [esp + 4], edx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
mov eax, dword [edi + 0x20]
mov dword [ebp + 0xc], edx
mov dword [esp], eax
call sym._WriteConsoleW_20
mov edx, dword [ebp + 0xc]
sub esp, 0x14
lea edx, [edx + ebx*2]
sub esi, ebx
jne 0x4013f2
jmp 0x4013d2
mov dword [ebp - 0x20], 0
mov eax, dword [ebp - 0x20]
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0xc
mov ecx, dword [edi + 0x2c]
cmp ecx, 0xffffffff
je 0x401708
mov eax, dword [ebp + 0x10]
mov dword [ebp - 0x1c], ecx
lea ebx, [eax + eax*4]
call sym._GetProcessHeap_0
mov dword [esp + 8], ebx
mov dword [esp + 4], 8
mov dword [esp], eax
call sym._HeapAlloc_12
mov ecx, dword [ebp - 0x1c]
sub esp, 0xc
test eax, eax
mov dword [ebp - 0x24], eax
je 0x401714
mov eax, dword [ebp + 0x10]
mov dword [esp + 0x14], ebx
mov ebx, dword [ebp - 0x24]
mov dword [esp + 8], esi
mov dword [esp + 0x1c], 0
mov dword [esp + 0x18], 0
mov dword [esp + 0x10], ebx
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0
mov dword [esp], ecx
mov dword [ebp - 0x20], eax
call sym._WideCharToMultiByte_32
mov esi, eax
lea eax, [ebp - 0x14]
sub esp, 0x20
mov dword [ebp - 0x1c], eax
test esi, esi
je 0x401521
mov dword [ebp + 8], edi
mov edx, dword [ebp + 8]
mov edi, ebx
nop
mov ebx, edi
cmp byte [ebx], 0xa
je 0x401550
add ebx, 1
sub esi, 1
jne 0x4014e2
mov dword [ebp + 8], edx
mov eax, dword [ebp - 0x1c]
mov edx, edi
mov edi, dword [ebp + 8]
sub ebx, edx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
mov dword [esp + 4], edx
mov eax, dword [edi + 0x20]
mov dword [ebp - 0x14], ebx
mov dword [esp], eax
call sym._WriteFile_20
sub esp, 0x14
call sym._GetProcessHeap_0
mov ecx, dword [ebp - 0x24]
mov dword [esp + 4], 0
mov dword [esp], eax
mov dword [esp + 8], ecx
call sym._HeapFree_12
mov eax, dword [ebp - 0x20]
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret 0xc
mov ecx, dword [ebp - 0x1c]
mov eax, ebx
mov dword [esp + 0x10], 0
sub eax, edi
mov dword [esp + 4], edi
mov dword [ebp - 0x14], eax
mov dword [esp + 0xc], ecx
mov dword [esp + 8], eax
mov eax, dword [edx + 0x20]
mov dword [ebp + 8], edx
mov dword [esp], eax
call sym._WriteFile_20
mov edx, dword [ebp + 8]
sub esp, 0x14
cmp byte [ebx], 0xa
je 0x401590
mov edi, ebx
jmp 0x4014e0
cmp edi, ebx
je 0x4015a4
jae 0x4016e4
cmp byte [ebx - 1], 0xd
je 0x4016e4
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x406012
mov eax, dword [edx + 0x20]
mov dword [ebp + 8], edx
add ebx, 1
mov dword [esp], eax
call sym._WriteFile_20
mov edx, dword [ebp + 8]
sub esp, 0x14
sub esi, 1
je 0x401521
mov edi, ebx
jmp 0x4014e0
lea eax, [ebp - 0x14]
mov ecx, dword [ebp + 0x10]
mov edx, edi
mov edi, esi
mov dword [ebp - 0x1c], eax
mov esi, ecx
mov ebx, edi
cmp word [ebx], 0xa
je 0x401630
add ebx, 2
sub esi, 1
jne 0x401601
mov esi, edi
mov eax, dword [ebp - 0x1c]
mov edi, edx
mov dword [esp + 0x10], 0
sub ebx, esi
mov dword [ebp - 0x14], ebx
mov dword [esp + 0xc], eax
mov dword [esp + 8], ebx
jmp 0x4013c0
mov ecx, dword [ebp - 0x1c]
mov eax, ebx
mov dword [esp + 0x10], 0
sub eax, edi
mov dword [esp + 4], edi
mov dword [ebp - 0x14], eax
mov dword [esp + 0xc], ecx
mov dword [esp + 8], eax
mov eax, dword [edx + 0x20]
mov dword [ebp + 8], edx
mov dword [esp], eax
call sym._WriteFile_20
mov edx, dword [ebp + 8]
sub esp, 0x14
cmp word [ebx], 0xa
je 0x401670
mov edi, ebx
jmp 0x4015ff
cmp edi, ebx
je 0x40167d
jae 0x4016c3
cmp word [ebx - 2], 0xd
je 0x4016c3
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 4
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x406008
mov eax, dword [edx + 0x20]
mov dword [ebp + 8], edx
add ebx, 2
mov dword [esp], eax
call sym._WriteFile_20
mov edx, dword [ebp + 8]
sub esp, 0x14
sub esi, 1
je 0x4013d2
mov edi, ebx
jmp 0x4015ff
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x40600e
jmp 0x40169c
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 1
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x406015
jmp 0x4015c3
call sym._GetConsoleOutputCP_0
mov ecx, eax
jmp 0x40145c
mov dword [esp], 8
call sym._SetLastError_4
sub esp, 4
jmp 0x4013d8