Function at 0x4016f0
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 0x4017d5
mov eax, dword [ebp + 0x10]
test eax, eax
je 0x4017d5
mov eax, dword [edi + 0x24]
mov dword [ebp - 0x20], eax
test eax, eax
jne 0x401785
mov eax, dword [edi + 0x28]
lea ecx, [eax - 2]
cmp ecx, 1
jbe 0x401990
cmp eax, 4
je 0x4017f0
cmp eax, 1
je 0x4017f0
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 0x4017a1
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 0x401792
jmp 0x401772
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 0x401aa8
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 0x401ab4
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 0x4018c1
mov dword [ebp + 8], edi
mov edx, dword [ebp + 8]
mov edi, ebx
nop
mov ebx, edi
cmp byte [ebx], 0xa
je 0x4018f0
add ebx, 1
sub esi, 1
jne 0x401882
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 0x401930
mov edi, ebx
jmp 0x401880
cmp edi, ebx
je 0x401944
jae 0x401a84
cmp byte [ebx - 1], 0xd
je 0x401a84
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x40629a
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 0x4018c1
mov edi, ebx
jmp 0x401880
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 0x4019d0
add ebx, 2
sub esi, 1
jne 0x4019a1
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 0x401760
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 0x401a10
mov edi, ebx
jmp 0x40199f
cmp edi, ebx
je 0x401a1d
jae 0x401a63
cmp word [ebx - 2], 0xd
je 0x401a63
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 4
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x406290
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 0x401772
mov edi, ebx
jmp 0x40199f
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 2
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x406296
jmp 0x401a3c
mov eax, dword [ebp - 0x1c]
mov dword [esp + 0x10], 0
mov dword [esp + 8], 1
mov dword [esp + 0xc], eax
mov dword [esp + 4], 0x40629d
jmp 0x401963
call sym._GetConsoleOutputCP_0
mov ecx, eax
jmp 0x4017fc
mov dword [esp], 8
call sym._SetLastError_4
sub esp, 4
jmp 0x401778