Function at 0x404500
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x414
push ebx
push esi
push edi
mov esi, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
cmp eax, dword [0x40c1f4]
jae 0x40474d
mov edx, eax
and edx, 0x1f
shr eax, 5
mov eax, dword [eax*4 + 0x40c0f4]
test byte [eax + edx*8 + 4], 1
je 0x40474d
test esi, esi
je 0x404749
mov eax, dword [ebp + 8]
mov edx, eax
and edx, 0x1f
shr eax, 5
mov eax, dword [eax*4 + 0x40c0f4]
test byte [eax + edx*8 + 4], 0x20
je 0x404569
push 2
push 0
mov eax, dword [ebp + 8]
push eax
call fcn.00406b40
add esp, 0xc
mov eax, dword [ebp + 8]
mov edx, eax
and edx, 0x1f
shr eax, 5
mov eax, dword [eax*4 + 0x40c0f4]
test byte [eax + edx*8 + 4], 0x80
je 0x4046ab
mov eax, dword [ebp + 0xc]
mov edi, eax
mov dword [ebp - 0x40c], 0
mov dword [ebp - 0x410], 0
jmp 0x404684
lea eax, [ebp - 0x405]
jmp 0x4045c1
cmp byte [edi], 0xa
jne 0x4045bb
inc dword [ebp - 0x40c]
mov byte [eax], 0xd
inc eax
mov dl, byte [edi]
mov byte [eax], dl
inc edi
inc eax
mov ebx, eax
lea edx, [ebp - 0x405]
neg edx
add edx, ebx
cmp edx, 0x400
jge 0x4045e1
mov edx, edi
sub edx, dword [ebp - 0x414]
cmp esi, edx
ja 0x4045ac
mov eax, dword [ebp + 8]
mov edx, eax
and edx, 0x1f
shr eax, 5
mov eax, dword [eax*4 + 0x40c0f4]
test byte [eax + edx*8 + 4], 0x40
je 0x40463b
mov eax, dword [ebp + 8]
push eax
call fcn.00406da0
pop ecx
lea edx, [ebp - 4]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x40463b
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
lea edx, [ebp - 0x405]
neg edx
add edx, ebx
push edx
lea edx, [ebp - 0x405]
push edx
mov edx, dword [0x40b868]
push edx
push eax
call fcn.00406ec0
add esp, 0x10
mov eax, dword [ebp + 8]
push eax
call fcn.00406da0
pop ecx
push 0
lea edx, [ebp - 4]
push edx
lea edx, [ebp - 0x405]
neg edx
add edx, ebx
push edx
lea edx, [ebp - 0x405]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4046a1
mov eax, dword [ebp - 0x410]
add eax, dword [ebp - 4]
mov dword [ebp - 0x410], eax
lea eax, [ebp - 0x405]
sub ebx, eax
cmp dword [ebp - 4], ebx
jb 0x40469d
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x414], eax
mov eax, edi
sub eax, dword [ebp - 0x414]
cmp esi, eax
ja 0x4045a4
xor ebx, ebx
jmp 0x4046fe
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x4046fe
mov eax, dword [ebp + 8]
push eax
call fcn.00406da0
pop ecx
push 0
lea edx, [ebp - 4]
push edx
push esi
mov edx, dword [ebp + 0xc]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4046e2
mov eax, dword [ebp - 4]
mov dword [ebp - 0x410], eax
mov dword [ebp - 0x40c], 0
xor ebx, ebx
jmp 0x4046fe
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov dword [ebp - 0x40c], 0
mov dword [ebp - 0x410], 0
cmp dword [ebp - 0x410], 0
jne 0x40476b
test ebx, ebx
je 0x404728
cmp ebx, 5
jne 0x40471c
mov dword [0x40b870], 9
jmp 0x404723
push ebx
call fcn.00406f80
pop ecx
or eax, 0xffffffff
jmp 0x404777
mov eax, dword [ebp + 8]
mov edx, eax
and edx, 0x1f
shr eax, 5
mov eax, dword [eax*4 + 0x40c0f4]
test byte [eax + edx*8 + 4], 0x40
je 0x40475c
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0x1a
jne 0x40475c
xor eax, eax
jmp 0x404777
mov dword [0x40b870], 9
or eax, 0xffffffff
jmp 0x404777
mov dword [0x40b870], 0x1c
or eax, 0xffffffff
jmp 0x404777
mov eax, dword [ebp - 0x410]
sub eax, dword [ebp - 0x40c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret