Function at 0x404510
Capabilities:
Write file on windows

Disassembly:
push ebp
push edi
push esi
push ebx
sub esp, 0x1c
mov edx, dword [0x412028]
test edx, edx
jne 0x404640
mov edx, 0xcccccccd
mov eax, edx
mul dword [esp + 0x30]
mov ebx, edx
shr ebx, 3
cmp ebx, 1
ja 0x4046a2
cmp dword [esp + 0x30], 1
je 0x4046a2
cmp dword [0x412064], 5
mov ebx, 3
jg 0x4046b9
mov dword [esp + 4], 0x404500
mov dword [esp], 0xe
call sub.cygwin1.dll_signal
mov dword [esp], ebx
call sub.cygwin1.dll_alarm
mov eax, dword [0x4120e0]
mov edx, dword [0x4120e8]
mov dword [0x4144dc], eax
mov dword [esp + 4], eax
mov eax, dword [0x4120e4]
mov dword [esp + 8], edx
mov dword [esp], eax
call sub.cygwin1.dll_read
mov esi, eax
mov dword [0x4120d8], eax
mov eax, dword [0x412028]
test eax, eax
je 0x4047f2
test esi, esi
jle 0x4046f0
mov ebx, dword [0x412100]
test ebx, ebx
je 0x404674
mov eax, dword [0x4120dc]
add eax, esi
mov esi, dword [0x40c03c]
mov dword [0x4120dc], eax
mov ecx, eax
jmp 0x404608
mov eax, ecx
cdq
idiv ebx
mov eax, esi
add esi, 1
add edx, dword [0x4144dc]
xor byte [edx], al
mov ebx, dword [0x412100]
sub ecx, ebx
cmp esi, 0x100
mov eax, ecx
je 0x4046e4
cmp ecx, ebx
jg 0x4045e0
cmp dword [0x412064], 5
mov dword [0x40c03c], esi
mov dword [0x4120dc], eax
mov esi, dword [0x4120d8]
jg 0x404700
test esi, esi
jg 0x404681
nop
add esp, 0x1c
mov eax, 0xfffffffe
pop ebx
pop esi
pop edi
pop ebp
ret
cmp dword [0x412064], 5
jle 0x404577
mov ebx, dword [0x4120e8]
call sub.cygwin1.dll___getreent
mov dword [esp + 4], str.Calling_read:_Readnum_d
mov dword [esp + 8], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
jmp 0x404577
cmp dword [0x412064], 5
jg 0x404700
lea eax, [esi - 1]
mov dword [0x4120d8], eax
mov eax, dword [0x4144dc]
lea edx, [eax + 1]
mov dword [0x4144dc], edx
movzx eax, byte [eax]
add esp, 0x1c
pop ebx
pop esi
pop edi
pop ebp
ret
test ebx, ebx
mov eax, 1
cmove ebx, eax
cmp dword [0x412064], 5
jle 0x40455b
mov esi, dword [0x4120e8]
call sub.cygwin1.dll___getreent
mov dword [esp + 8], ebx
mov dword [esp + 4], str.Calling_read:_alarm_d__Readnum_d
mov dword [esp + 0xc], esi
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
jmp 0x40455b
mov si, 1
jmp 0x404608
cmp dword [0x412064], 5
jle 0x404630
lea esi, [esi]
call sub.cygwin1.dll___getreent
mov dword [esp + 8], esi
mov dword [esp + 4], str.Read_returned__d_bytes_n
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov esi, dword [0x4120d8]
cmp esi, 0xffffffff
je 0x40482c
cmp dword [0x412064], 9
jle 0x40462a
test esi, esi
jle 0x404630
cmp esi, 0x30
mov eax, 0x30
mov edi, 0x2aaaaaab
cmovg esi, eax
xor ebx, ebx
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 0xc]
mov dword [esp + 8], 4
mov dword [esp + 4], 1
mov dword [esp], str.
mov dword [esp + 0xc], eax
call sub.cygwin1.dll_fwrite
lea esi, [esi]
mov eax, dword [0x4144dc]
movzx ebp, byte [eax + ebx]
add ebx, 1
call sub.cygwin1.dll___getreent
mov dword [esp + 4], str._02x
mov dword [esp + 8], ebp
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
cmp ebx, esi
je 0x404809
mov eax, ebx
imul edi
mov eax, ebx
sar eax, 0x1f
sar edx, 2
sub edx, eax
lea eax, [edx + edx*2]
shl eax, 3
cmp ebx, eax
jne 0x404780
test ebx, ebx
je 0x404780
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 0xc]
mov dword [esp + 8], 5
mov dword [esp + 4], 1
mov dword [esp], str._n
mov dword [esp + 0xc], eax
call sub.cygwin1.dll_fwrite
jmp 0x404780
mov dword [esp], 0
call sub.cygwin1.dll_alarm
mov esi, dword [0x4120d8]
jmp 0x4045b0
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 0xc]
mov dword [esp], 0xa
mov dword [esp + 4], eax
call sub.cygwin1.dll_fputc
mov esi, dword [0x4120d8]
jmp 0x40462a
call sub.cygwin1.dll___errno
mov eax, dword [eax]
mov dword [esp], eax
call sub.cygwin1.dll_strerror
mov esi, eax
call sub.cygwin1.dll___errno
mov ebx, dword [eax]
call sub.cygwin1.dll___getreent
mov dword [esp + 0xc], esi
mov dword [esp + 4], str.errno_d:_s_n
mov dword [esp + 8], ebx
mov eax, dword [eax + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_fprintf
mov esi, dword [0x4120d8]
jmp 0x40472b