Function at 0x4043a0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x410
push ebx
push esi
push edi
mov ebx, dword [ebp + 8]
cmp ebx, dword [0x40c27c]
jae 0x4045dc
mov eax, ebx
and eax, 0x1f
mov edx, ebx
shr edx, 5
mov edx, dword [edx*4 + 0x40c17c]
test byte [edx + eax*8 + 4], 1
je 0x4045dc
cmp dword [ebp + 0x10], 0
je 0x4045d8
mov eax, ebx
and eax, 0x1f
mov edx, ebx
shr edx, 5
mov edx, dword [edx*4 + 0x40c17c]
test byte [edx + eax*8 + 4], 0x20
jne 0x4045a8
mov eax, ebx
and eax, 0x1f
mov edx, ebx
shr edx, 5
mov edx, dword [edx*4 + 0x40c17c]
test byte [edx + eax*8 + 4], 0x80
je 0x40452b
mov eax, dword [ebp + 0xc]
mov esi, eax
mov dword [ebp - 0x40c], 0
mov dword [ebp - 0x410], 0
jmp 0x40450b
lea edi, [ebp - 0x405]
jmp 0x404454
cmp byte [esi], 0xa
jne 0x40444e
inc dword [ebp - 0x40c]
mov byte [edi], 0xd
inc edi
mov al, byte [esi]
mov byte [edi], al
inc esi
inc edi
lea eax, [ebp - 0x405]
neg eax
add eax, edi
cmp eax, 0x400
jge 0x40446f
mov eax, esi
sub eax, dword [ebp + 0xc]
cmp dword [ebp + 0x10], eax
ja 0x40443f
mov eax, ebx
and eax, 0x1f
mov edx, ebx
shr edx, 5
mov edx, dword [edx*4 + 0x40c17c]
test byte [edx + eax*8 + 4], 0x40
je 0x4044c5
push ebx
call fcn.00406c90
pop ecx
lea edx, [ebp - 4]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x4044c5
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
lea edx, [ebp - 0x405]
neg edx
add edx, edi
push edx
lea edx, [ebp - 0x405]
push edx
mov edx, dword [0x40b888]
push edx
push eax
call fcn.00406db0
add esp, 0x10
push ebx
call fcn.00406c90
pop ecx
push 0
lea edx, [ebp - 4]
push edx
lea edx, [ebp - 0x405]
neg edx
add edx, edi
push edx
lea edx, [ebp - 0x405]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404521
mov eax, dword [ebp - 0x410]
add eax, dword [ebp - 4]
mov dword [ebp - 0x410], eax
lea eax, [ebp - 0x405]
sub edi, eax
cmp dword [ebp - 4], edi
jb 0x40451d
mov eax, esi
sub eax, dword [ebp + 0xc]
cmp dword [ebp + 0x10], eax
ja 0x404437
xor esi, esi
jmp 0x40457e
xor esi, esi
jmp 0x40457e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
jmp 0x40457e
push ebx
call fcn.00406c90
pop ecx
push 0
lea edx, [ebp - 4]
push edx
mov edx, dword [ebp + 0x10]
push edx
mov edx, dword [ebp + 0xc]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404562
mov eax, dword [ebp - 4]
mov dword [ebp - 0x410], eax
mov dword [ebp - 0x40c], 0
xor esi, esi
jmp 0x40457e
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [ebp - 0x40c], 0
mov dword [ebp - 0x410], 0
cmp dword [ebp - 0x410], 0
jne 0x4045fa
test esi, esi
je 0x4045ba
cmp esi, 5
jne 0x40459c
mov dword [0x40b890], 9
jmp 0x4045a3
push esi
call fcn.00406e70
pop ecx
or eax, 0xffffffff
jmp 0x404606
push 2
push 0
push ebx
call fcn.00406ff0
add esp, 0xc
jmp 0x4043fd
mov eax, ebx
and eax, 0x1f
shr ebx, 5
mov ebx, dword [ebx*4 + 0x40c17c]
test byte [ebx + eax*8 + 4], 0x40
je 0x4045eb
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0x1a
jne 0x4045eb
xor eax, eax
jmp 0x404606
mov dword [0x40b890], 9
or eax, 0xffffffff
jmp 0x404606
mov dword [0x40b890], 0x1c
or eax, 0xffffffff
jmp 0x404606
mov eax, dword [ebp - 0x410]
sub eax, dword [ebp - 0x40c]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret