Function at 0x4048a5
Capabilities:
Write file on windows

Disassembly:
push ebp
push ebx
push edi
push esi
sub esp, 0xc
mov edi, dword [esp + 0x24]
mov ebx, dword [esp + 0x20]
test edi, edi
je 0x4046e1
cmp byte [edi + 0x1390], 0
je 0x4046f3
mov esi, dword [edi]
push esi
call sub.msvcrt.dll_ferror
add esp, 4
test eax, eax
je 0x40470f
test ebx, ebx
je 0x4046d5
mov dword [ebx], 0xfffffffa
mov dword [edi + 0x13c4], 0xfffffffa
jmp 0x4046eb
test ebx, ebx
je 0x4046eb
mov dword [ebx], 0
add esp, 0xc
jmp 0x40483c
test ebx, ebx
je 0x4046fd
mov dword [ebx], 0xffffffff
mov dword [edi + 0x13c4], 0xffffffff
add esp, 0xc
jmp 0x40483c
mov eax, dword [esp + 0x30]
mov ebp, dword [esp + 0x2c]
test ebp, ebp
je 0x404722
mov dword [ebp], 0
mov edx, dword [esp + 0x34]
test eax, eax
je 0x404730
mov dword [eax], 0
mov ecx, dword [esp + 0x38]
test edx, edx
je 0x40473e
mov dword [edx], 0
mov eax, dword [esp + 0x28]
test ecx, ecx
je 0x40474c
mov dword [ecx], 0
test eax, eax
jne 0x404776
cmp dword [edi + 0x13c4], 0
je 0x404841
push esi
call sub.msvcrt.dll_ferror
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x38]
add esp, 4
test eax, eax
je 0x404960
test ebp, ebp
je 0x404783
mov eax, dword [edi + 0x139c]
mov dword [ebp], eax
mov eax, dword [esp + 0x30]
test eax, eax
je 0x404799
mov ecx, eax
mov eax, dword [edi + 0x13a0]
mov dword [ecx], eax
mov ecx, dword [esp + 0x38]
test edx, edx
je 0x4047a5
mov eax, dword [edi + 0x13ac]
mov dword [edx], eax
test ecx, ecx
je 0x4047b1
mov eax, dword [edi + 0x13b0]
mov dword [ecx], eax
test ebx, ebx
je 0x4047bb
mov dword [ebx], 0
mov dword [edi + 0x13c4], 0
mov esi, dword [edi + 0x13b4]
test esi, esi
je 0x404833
lea eax, [edi + 0x1394]
cmp dword [esi], eax
jne 0x404833
mov eax, dword [esi + 0x10]
test eax, eax
je 0x4047f0
push eax
push dword [edi + 0x13c0]
call dword [edi + 0x13bc]
add esp, 8
mov eax, dword [esi + 0x14]
test eax, eax
je 0x404807
push eax
push dword [edi + 0x13c0]
call dword [edi + 0x13bc]
add esp, 8
mov eax, dword [esi + 0x18]
test eax, eax
je 0x40481e
push eax
push dword [edi + 0x13c0]
call dword [edi + 0x13bc]
add esp, 8
push dword [edi + 0x13b4]
push dword [edi + 0x13c0]
call dword [edi + 0x13bc]
add esp, 8
push edi
call sub.msvcrt.dll_free
add esp, 0x10
pop esi
pop edi
pop ebx
pop ebp
ret
lea eax, [edi + 4]
mov dword [esp + 4], eax
lea eax, [edi + 0x1394]
mov dword [esp + 8], eax
jmp 0x40485e
cmp byte [esp], 0
jne 0x4049a1
mov dword [edi + 0x13a8], 0x1388
mov eax, dword [esp + 4]
mov dword [edi + 0x13a4], eax
mov esi, dword [edi + 0x13b4]
mov eax, 0xfffffffe
test esi, esi
je 0x40498d
mov ecx, dword [esp + 8]
cmp dword [esi], ecx
jne 0x40498d
mov eax, dword [esi + 4]
dec eax
cmp eax, 3
ja case.default.0x40489e
jmp dword [eax*4 + 0x6af1e0]
mov eax, dword [edi + 0x1398]
mov dword [esi + 0xc], eax
mov dword [esi + 4], 4
jmp 0x4048c6
mov eax, dword [esi + 0xc]
cmp eax, dword [edi + 0x1398]
jne case.0x40489e.1
mov ecx, esi
call fcn.00402be0
test al, al
je case.0x40489e.1
cmp dword [esi + 0xc], 0
je 0x40492a
mov dword [esp], 0
mov eax, dword [edi + 0x13a8]
cmp eax, 0x1387
ja 0x404854
mov esi, 0x1388
sub esi, eax
push dword [edi]
push esi
push 1
push dword [esp + 0x10]
call sub.msvcrt.dll_fwrite
add esp, 0x10
cmp esi, eax
jne 0x4046cb
push dword [edi]
call sub.msvcrt.dll_ferror
add esp, 4
test eax, eax
je 0x404854
jmp 0x4046cb
cmp dword [esi + 0x34], 0xff
ja 0x404939
cmp dword [esi + 0x38], 0
jg 0x4048db
mov eax, dword [esi + 0x50]
cmp eax, dword [esi + 0x4c]
jl 0x4048db
mov dword [esi + 4], 1
mov al, 1
mov dword [esp], eax
mov eax, dword [edi + 0x13a8]
cmp eax, 0x1387
ja 0x404854
jmp 0x4048f3
push esi
call sub.msvcrt.dll_fflush
add esp, 4
push dword [edi]
call sub.msvcrt.dll_ferror
mov ecx, dword [esp + 0x3c]
mov edx, dword [esp + 0x38]
add esp, 4
test eax, eax
jne 0x4046cb
jmp 0x404776
mov eax, 0xffffffff
test ebx, ebx
je 0x404993
mov dword [ebx], eax
mov dword [edi + 0x13c4], eax
add esp, 0xc
jmp 0x40483c
mov esi, dword [edi]
jmp 0x40475d
xor eax, eax
test ebx, ebx
jne 0x404991
jmp 0x404993