Function at 0x420380
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
push ebx
sub esp, 0x2c
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
mov dword [ebp - 0x24], eax
mov eax, edx
dec eax
mov esi, dword [ebp + 0xc]
mov dword [ebp - 0x28], edx
cmp eax, 0x20
ja 0x4203a7
mov dword [ebp - 0x28], 0x22
mov eax, dword [ebp - 0x24]
mov edi, 1
mov ebx, dword [eax + 4]
test ebx, ebx
je 0x42048c
mov eax, dword [ebp - 0x24]
sub esp, 0xc
xor edi, edi
mov ebx, dword [eax]
mov eax, dword [ebx]
push eax
call sub.msvcrt.dll_strlen
add esp, 0x10
mov dword [ebp - 0x10], eax
mov dword [ebp - 0x20], 0
lea esi, [esi]
push eax
push eax
push esi
inc edi
mov edx, dword [ebp - 0x20]
mov eax, dword [edx + ebx]
push eax
call sub.msvcrt.dll_fputs
mov eax, dword [ebp - 0x24]
add esp, 0x10
cmp dword [eax + 4], edi
jbe 0x420488
mov eax, dword [ebp - 0x24]
lea edx, [edi*4]
sub esp, 0xc
mov dword [ebp - 0x20], edx
mov ebx, dword [eax]
mov ecx, dword [ebx + edx]
push ecx
call sub.msvcrt.dll_strlen
mov edx, dword [ebp - 0x10]
add esp, 0x10
add edx, eax
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x10], edx
test edi, edi
je 0x4203e0
mov ebx, dword [ebp - 0x28]
test ebx, ebx
je 0x420460
mov edx, dword [ebp - 0x28]
cmp dword [ebp - 0x10], edx
jbe 0x420460
push esi
push 4
push 1
push str.__n
call sub.msvcrt.dll_fwrite
mov edx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x2c]
add esp, 0x10
inc eax
mov ebx, dword [edx]
mov dword [ebp - 0x10], eax
jmp 0x4203e0
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
test eax, eax
js 0x420578
mov eax, dword [esi]
mov byte [eax], 0x20
inc eax
mov dword [esi], eax
mov eax, dword [ebp - 0x24]
mov edx, dword [ebp - 0x10]
inc edx
mov ebx, dword [eax]
mov dword [ebp - 0x10], edx
jmp 0x4203e0
mov edi, dword [ebp - 0x10]
inc edi
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
test eax, eax
js 0x4205a0
mov eax, dword [esi]
mov byte [eax], 0x3a
inc eax
mov dword [esi], eax
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 0x10]
test eax, eax
je 0x42054a
mov eax, dword [ebp - 0x28]
mov dword [ebp - 0x14], 0
test eax, eax
setne byte [ebp - 0x19]
jmp 0x42050a
cmp byte [ebp - 0x19], 0
je 0x420534
push esi
push 4
push 1
push str.__n
lea edi, [ebx + 1]
call sub.msvcrt.dll_fwrite
add esp, 0x10
nop
push ecx
push ecx
push esi
mov edx, dword [ebp - 0x24]
mov eax, dword [edx + 0xc]
mov edx, dword [ebp - 0x18]
mov edx, dword [eax + edx]
push edx
call sub.msvcrt.dll_fputs
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0x24]
inc eax
add esp, 0x10
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0x14]
cmp dword [edx + 0x10], eax
jbe 0x42054a
mov eax, dword [ebp - 0x14]
mov edx, dword [ebp - 0x24]
shl eax, 2
sub esp, 0xc
mov dword [ebp - 0x18], eax
mov eax, dword [edx + 0xc]
mov edx, dword [ebp - 0x18]
mov eax, dword [eax + edx]
push eax
call sub.msvcrt.dll_strlen
add edi, eax
add esp, 0x10
mov ebx, eax
cmp edi, dword [ebp - 0x28]
ja 0x4204c3
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
test eax, eax
js 0x420565
mov eax, dword [esi]
inc edi
mov byte [eax], 0x20
inc eax
mov dword [esi], eax
jmp 0x4204e0
mov eax, dword [esi + 4]
dec eax
mov dword [esi + 4], eax
test eax, eax
js 0x42058a
mov eax, dword [esi]
mov byte [eax], 0xa
inc eax
mov dword [esi], eax
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
push ebx
push ebx
push esi
push 0x20
call sub.msvcrt.dll__flsbuf
inc edi
add esp, 0x10
jmp 0x4204e0
push ecx
push ecx
push esi
push 0x20
call sub.msvcrt.dll__flsbuf
add esp, 0x10
jmp 0x420477
mov dword [ebp + 0xc], esi
mov dword [ebp + 8], 0xa
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
jmp sub.msvcrt.dll__flsbuf
push eax
push eax
push esi
push 0x3a
call sub.msvcrt.dll__flsbuf
add esp, 0x10
jmp 0x4204a3