Function at 0x401780
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x38
mov dword [ebp - 0xc], ebx
mov ebx, dword [ebp + 8]
mov dword [ebp - 4], edi
mov edi, dword [ebp + 0x14]
mov dword [ebp - 8], esi
test byte [ebx + 0x14], 0x40
jne 0x401960
fld dword [ebp + 0x10]
fmul dword [0x43b394]
fnstcw word [ebp - 0x1a]
movzx eax, word [ebp - 0x1a]
fld dword [0x43b398]
or ax, 0xc00
faddp st(1)
mov word [ebp - 0x1c], ax
fldcw word [ebp - 0x1c]
fistp dword [ebp - 0x20]
fldcw word [ebp - 0x1a]
mov esi, dword [ebp - 0x20]
cmp dword [ebx + 0x1ac], esi
je 0x401960
mov dword [ebx + 0x1ac], esi
xor eax, eax
mov dword [esp + 4], eax
lea eax, [ebp - 0x18]
mov dword [esp], eax
call sub.cygwin1.dll_gettimeofday
mov ecx, dword [ebp - 0x14]
mov edx, 0x431bde83
mov eax, ecx
imul edx
mov eax, ecx
sar eax, 0x1f
sar edx, 0xf
sub edx, eax
mov eax, dword [ebp - 0x18]
lea ecx, [edx + eax*8]
cmp dword [ebx + 0x1b0], ecx
sete dl
xor eax, eax
test esi, esi
setne al
test edx, eax
jne 0x401970
or dword [ebx + 0x14], 0x20
mov eax, dword [ebx + 0x1a8]
mov dword [ebx + 0x1b0], ecx
inc eax
and eax, 3
mov dword [ebx + 0x1a8], eax
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sub.cygwin1.dll_strlen
mov ecx, 0x42
sub ecx, eax
test ecx, ecx
mov eax, ecx
js 0x4019c4
mov ecx, eax
and ecx, 0xfffffff8
test edi, edi
je 0x401864
sub ecx, 8
push ecx
fild dword [esp]
add esp, 4
fmul dword [ebp + 0x10]
fnstcw word [ebp - 0x1a]
movzx eax, word [ebp - 0x1a]
mov dword [esp], str._s_s:__s_s
fadd dword [0x43b39c]
or ax, 0xc00
mov word [ebp - 0x1c], ax
fdiv dword [0x43b3a0]
fldcw word [ebp - 0x1c]
fistp dword [ebp - 0x20]
fldcw word [ebp - 0x1a]
mov edx, dword [ebp - 0x20]
mov eax, edx
sub eax, ecx
add eax, 0x44518f
mov dword [esp + 0x10], eax
mov eax, 0x44510f
sub eax, edx
mov dword [esp + 0xc], eax
mov eax, dword [ebp + 0xc]
mov dword [esp + 8], eax
lea eax, [ebx + 0x1b8]
mov dword [esp + 4], eax
call sub.cygwin1.dll_printf
cmp esi, 0x3e8
je 0x4019ac
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp + 4], eax
mov eax, dword [ebx + 0x1a8]
and eax, 3
movsx eax, byte [eax + str.__]
mov dword [esp], eax
call sub.cygwin1.dll_fputc
fld dword [ebp + 0x10]
mov dword [esp], str.__4.1f__
fstp qword [esp + 4]
call sub.cygwin1.dll_printf
test edi, edi
je 0x40197d
mov dword [esp + 4], edi
mov dword [esp], 0x43b38d
call sub.cygwin1.dll_printf
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp + 4], eax
lea eax, [ebx + 0x1ba]
mov dword [esp], eax
call sub.cygwin1.dll_fputs
cmp esi, 0x3e8
je 0x4019cc
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp], eax
call sub.cygwin1.dll_fflush
mov esi, esi
lea edi, [edi]
mov ebx, dword [ebp - 0xc]
xor eax, eax
mov esi, dword [ebp - 8]
mov edi, dword [ebp - 4]
mov esp, ebp
pop ebp
ret
cmp esi, 0x3e8
jne 0x401960
jmp 0x401822
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov ecx, 2
mov edx, 1
mov dword [esp + 8], ecx
mov dword [esp + 4], edx
mov dword [esp + 0xc], eax
mov dword [esp], 0x43b391
call sub.cygwin1.dll_fwrite
jmp 0x401921
call sub.cygwin1.dll___getreent
mov eax, dword [eax + 8]
mov dword [esp], 0x7c
mov dword [esp + 4], eax
jmp 0x4018f5
lea eax, [ecx + 7]
jmp 0x401858
mov dword [esp], ebx
call fcn.00401720
jmp 0x401947