Function at 0x404d90
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x418
push ebx
push esi
push edi
mov ebx, dword [ebp + 0x10]
test ebx, ebx
jne 0x404daa
xor eax, eax
jmp 0x405013
mov eax, dword [ebp + 8]
and eax, 0x1f
shl eax, 5
mov edx, dword [ebp + 8]
sar edx, 5
add eax, dword [edx*4 + 0x413750]
test byte [eax + 4], 0x20
je 0x404dd6
push 2
push 0
mov eax, dword [ebp + 8]
push eax
call fcn.00407170
add esp, 0xc
mov eax, dword [ebp + 8]
and eax, 0x1f
shl eax, 5
mov edx, dword [ebp + 8]
sar edx, 5
add eax, dword [edx*4 + 0x413750]
test byte [eax + 4], 0x80
je 0x404f66
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x40c], eax
xor esi, esi
mov dword [ebp - 0x410], 0
jmp 0x404f4f
lea eax, [ebp - 0x405]
mov dword [ebp - 0x414], eax
jmp 0x404e5a
mov eax, dword [ebp - 0x40c]
cmp byte [eax], 0xa
jne 0x404e3e
inc dword [ebp - 0x410]
mov eax, dword [ebp - 0x414]
mov byte [eax], 0xd
inc dword [ebp - 0x414]
mov edx, dword [ebp - 0x414]
mov eax, dword [ebp - 0x40c]
mov al, byte [eax]
mov byte [edx], al
inc dword [ebp - 0x40c]
inc dword [ebp - 0x414]
mov eax, dword [ebp - 0x414]
lea edx, [ebp - 0x405]
sub eax, edx
cmp eax, 0x400
jge 0x404e7e
mov eax, dword [ebp - 0x40c]
mov edx, dword [ebp + 0xc]
sub eax, edx
cmp ebx, eax
ja 0x404e1e
mov eax, dword [ebp + 8]
and eax, 0x1f
shl eax, 5
mov edx, dword [ebp + 8]
sar edx, 5
add eax, dword [edx*4 + 0x413750]
test byte [eax + 4], 0x40
je 0x404ef6
mov eax, dword [ebp + 8]
push eax
call fcn.004052f0
pop ecx
lea edx, [ebp - 4]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x404ef6
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
mov dword [ebp - 0x418], eax
call fcn.004040a0
mov edx, dword [ebp - 0x414]
lea ecx, [ebp - 0x405]
sub edx, ecx
push edx
lea edx, [ebp - 0x405]
push edx
mov eax, dword [eax + 0x8c]
mov eax, dword [eax + 0x8c]
push eax
mov eax, dword [ebp - 0x418]
push eax
call fcn.00407260
add esp, 0x10
mov eax, dword [ebp + 8]
push eax
call fcn.004052f0
pop ecx
push 0
lea edx, [ebp - 4]
push edx
mov edx, dword [ebp - 0x414]
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 0x404f45
mov eax, dword [ebp - 4]
lea edx, [esi + eax]
mov esi, edx
xor edi, edi
mov edx, dword [ebp - 0x414]
lea ecx, [ebp - 0x405]
sub edx, ecx
cmp eax, edx
jae 0x404f4f
jmp 0x404fad
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x404fad
xor edi, edi
mov eax, dword [ebp - 0x40c]
mov edx, dword [ebp + 0xc]
sub eax, edx
cmp ebx, eax
ja 0x404e10
jmp 0x404fad
mov eax, dword [ebp + 8]
push eax
call fcn.004052f0
pop ecx
push 0
lea edx, [ebp - 4]
push edx
push ebx
mov edx, dword [ebp + 0xc]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x404f99
mov eax, dword [ebp - 4]
mov esi, eax
xor edi, edi
mov dword [ebp - 0x410], 0
jmp 0x404fad
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
xor esi, esi
mov dword [ebp - 0x410], 0
test esi, esi
jne 0x40500b
test edi, edi
je 0x404fd3
cmp edi, 5
jne 0x404fc7
call fcn.00403500
mov dword [eax], 9
jmp 0x404fce
push edi
call fcn.00403350
pop ecx
or eax, 0xffffffff
jmp 0x405013
mov eax, dword [ebp + 8]
and eax, 0x1f
shl eax, 5
mov edx, dword [ebp + 8]
sar edx, 5
add eax, dword [edx*4 + 0x413750]
test byte [eax + 4], 0x40
je 0x404ffb
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0x1a
jne 0x404ffb
xor eax, eax
jmp 0x405013
call fcn.00403500
mov dword [eax], 0x1c
or eax, 0xffffffff
jmp 0x405013
mov eax, esi
sub eax, dword [ebp - 0x410]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret