Function at 0x4074e0
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x414
push ebx
push esi
push edi
mov ebx, dword [ebp + 0x10]
mov eax, dword [ebp + 8]
mov edx, dword [0x40e300]
cmp eax, edx
jae 0x407516
mov eax, dword [ebp + 8]
and eax, 0x1f
mov edx, dword [ebp + 8]
sar edx, 5
mov edx, dword [edx*4 + 0x40e304]
test byte [edx + eax*8 + 4], 1
jne 0x407528
mov dword [0x40d334], 9
or eax, 0xffffffff
jmp 0x40777b
test ebx, ebx
jne 0x407533
xor eax, eax
jmp 0x40777b
mov eax, dword [ebp + 8]
and eax, 0x1f
mov edx, dword [ebp + 8]
sar edx, 5
mov edx, dword [edx*4 + 0x40e304]
test byte [edx + eax*8 + 4], 0x20
je 0x40755d
push 2
push 0
mov eax, dword [ebp + 8]
push eax
call fcn.00408af0
add esp, 0xc
mov eax, dword [ebp + 8]
and eax, 0x1f
mov edx, dword [ebp + 8]
sar edx, 5
mov edx, dword [edx*4 + 0x40e304]
test byte [edx + eax*8 + 4], 0x80
je 0x4076d2
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x40c], eax
xor esi, esi
mov dword [ebp - 0x410], 0
jmp 0x4076bb
lea eax, [ebp - 0x405]
mov dword [ebp - 0x414], eax
jmp 0x4075df
mov eax, dword [ebp - 0x40c]
cmp byte [eax], 0xa
jne 0x4075c3
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 0x407603
mov eax, dword [ebp - 0x40c]
mov edx, dword [ebp + 0xc]
sub eax, edx
cmp ebx, eax
ja 0x4075a3
mov eax, dword [ebp + 8]
and eax, 0x1f
mov edx, dword [ebp + 8]
sar edx, 5
mov edx, dword [edx*4 + 0x40e304]
test byte [edx + eax*8 + 4], 0x40
je 0x407662
mov eax, dword [ebp + 8]
push eax
call fcn.00407980
pop ecx
lea edx, [ebp - 4]
push edx
push eax
call dword [sym.imp.KERNEL32.dll_GetConsoleMode]
test eax, eax
je 0x407662
call dword [sym.imp.KERNEL32.dll_GetConsoleOutputCP]
mov edx, dword [ebp - 0x414]
lea ecx, [ebp - 0x405]
sub edx, ecx
push edx
lea edx, [ebp - 0x405]
push edx
mov edx, dword [0x40d9a0]
push edx
push eax
call fcn.00408b90
add esp, 0x10
mov eax, dword [ebp + 8]
push eax
call fcn.00407980
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 0x4076b1
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 0x4076bb
jmp 0x407719
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x407719
xor edi, edi
mov eax, dword [ebp - 0x40c]
mov edx, dword [ebp + 0xc]
sub eax, edx
cmp ebx, eax
ja 0x407595
jmp 0x407719
mov eax, dword [ebp + 8]
push eax
call fcn.00407980
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 0x407705
mov eax, dword [ebp - 4]
mov esi, eax
xor edi, edi
mov dword [ebp - 0x410], 0
jmp 0x407719
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
xor esi, esi
mov dword [ebp - 0x410], 0
test esi, esi
jne 0x407773
test edi, edi
je 0x40773e
cmp edi, 5
jne 0x407732
mov dword [0x40d334], 9
jmp 0x407739
push edi
call fcn.00407aa0
pop ecx
or eax, 0xffffffff
jmp 0x40777b
mov eax, dword [ebp + 8]
and eax, 0x1f
mov edx, dword [ebp + 8]
sar edx, 5
mov edx, dword [edx*4 + 0x40e304]
test byte [edx + eax*8 + 4], 0x40
je 0x407764
mov eax, dword [ebp + 0xc]
cmp byte [eax], 0x1a
jne 0x407764
xor eax, eax
jmp 0x40777b
mov dword [0x40d334], 0x1c
or eax, 0xffffffff
jmp 0x40777b
mov eax, esi
sub eax, dword [ebp - 0x410]
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret