Function at 0x4030b0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x420
push ebx
push esi
push edi
mov esi, dword [ebp + 8]
mov edi, dword [ebp + 0x10]
cmp esi, dword [0x4063f8]
jae 0x40331f
mov eax, esi
and eax, 0x1f
mov dword [ebp - 0x410], eax
mov eax, esi
shr eax, 5
mov dword [ebp - 0x40c], eax
mov eax, dword [ebp - 0x410]
mov edx, dword [ebp - 0x40c]
mov edx, dword [edx*4 + 0x4062f8]
test byte [edx + eax*8 + 4], 1
je 0x40331f
test edi, edi
je 0x40331b
mov eax, dword [ebp - 0x410]
mov edx, dword [ebp - 0x40c]
mov edx, dword [edx*4 + 0x4062f8]
test byte [edx + eax*8 + 4], 0x20
je 0x403131
push 2
push 0
push esi
call fcn.00403480
add esp, 0xc
mov eax, dword [ebp - 0x410]
mov edx, dword [ebp - 0x40c]
mov edx, dword [edx*4 + 0x4062f8]
test byte [edx + eax*8 + 4], 0x80
je 0x403280
mov eax, dword [ebp + 0xc]
mov ebx, eax
mov dword [ebp - 0x414], 0
mov dword [ebp - 0x418], 0
jmp 0x403259
lea eax, [ebp - 0x405]
jmp 0x40318a
cmp byte [ebx], 0xa
jne 0x403184
inc dword [ebp - 0x414]
mov byte [eax], 0xd
inc eax
mov dl, byte [ebx]
mov byte [eax], dl
inc ebx
inc eax
mov edx, eax
mov dword [ebp - 0x420], edx
lea ecx, [ebp - 0x405]
sub edx, ecx
cmp edx, 0x400
jge 0x4031ae
mov edx, ebx
sub edx, dword [ebp - 0x41c]
cmp edi, edx
ja 0x403175
mov eax, dword [ebp - 0x410]
mov edx, dword [ebp - 0x40c]
mov edx, dword [edx*4 + 0x4062f8]
test byte [edx + eax*8 + 4], 0x40
je 0x403209
push esi
call fcn.004036d0
pop ecx
lea edx, [ebp - 4]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x403209
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
mov edx, dword [ebp - 0x420]
lea ecx, [ebp - 0x405]
sub edx, ecx
push edx
lea edx, [ebp - 0x405]
push edx
push dword [0x405cf8]
push eax
call fcn.004037e0
add esp, 0x10
push esi
call fcn.004036d0
pop ecx
push 0
lea edx, [ebp - 4]
push edx
mov edx, dword [ebp - 0x420]
lea ecx, [ebp - 0x405]
sub edx, ecx
push edx
lea edx, [ebp - 0x405]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x403276
mov eax, dword [ebp - 0x418]
add eax, dword [ebp - 4]
mov dword [ebp - 0x418], eax
mov eax, dword [ebp - 0x420]
lea edx, [ebp - 0x405]
sub eax, edx
cmp dword [ebp - 4], eax
jb 0x403272
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x41c], eax
mov eax, ebx
sub eax, dword [ebp - 0x41c]
cmp edi, eax
ja 0x40316d
xor ebx, ebx
jmp 0x4032cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
jmp 0x4032cf
push esi
call fcn.004036d0
pop ecx
push 0
lea edx, [ebp - 4]
push edx
push edi
push dword [ebp + 0xc]
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4032b3
mov eax, dword [ebp - 4]
mov dword [ebp - 0x418], eax
mov dword [ebp - 0x414], 0
xor ebx, ebx
jmp 0x4032cf
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
mov dword [ebp - 0x414], 0
mov dword [ebp - 0x418], 0
cmp dword [ebp - 0x418], 0
jne 0x40333d
test ebx, ebx
je 0x4032f9
cmp ebx, 5
jne 0x4032ed
mov dword [0x405bec], 9
jmp 0x4032f4
push ebx
call fcn.00403890
pop ecx
or eax, 0xffffffff
jmp 0x403349
mov eax, dword [ebp - 0x410]
mov edx, dword [ebp - 0x40c]
mov edx, dword [edx*4 + 0x4062f8]
test byte [edx + eax*8 + 4], 0x40
je 0x40332e
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0x1a
jne 0x40332e
xor eax, eax
jmp 0x403349
mov dword [0x405bec], 9
or eax, 0xffffffff
jmp 0x403349
mov dword [0x405bec], 0x1c
or eax, 0xffffffff
jmp 0x403349
mov eax, dword [ebp - 0x418]
sub eax, dword [ebp - 0x414]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret