Function at 0x4045f7
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
jne 0x404634
cmp dword [ebp + 8], 0
je 0x404618
mov eax, dword [ebp + 8]
mov dword [eax], 0
cmp dword [ebp - 0xc], 0
je 0x40492b
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x13c4], 0
jmp 0x40492b
mov eax, dword [ebp - 0xc]
movzx eax, byte [eax + 0x1390]
test al, al
jne 0x40466d
cmp dword [ebp + 8], 0
je 0x404651
mov eax, dword [ebp + 8]
mov dword [eax], 0xffffffff
cmp dword [ebp - 0xc], 0
je 0x40492e
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x13c4], 0xffffffff
jmp 0x40492e
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
test eax, eax
setne al
test al, al
je 0x4046ae
cmp dword [ebp + 8], 0
je 0x404692
mov eax, dword [ebp + 8]
mov dword [eax], 0xfffffffa
cmp dword [ebp - 0xc], 0
je 0x404931
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x13c4], 0xfffffffa
jmp 0x404931
cmp dword [ebp + 0x14], 0
je 0x4046bd
mov eax, dword [ebp + 0x14]
mov dword [eax], 0
cmp dword [ebp + 0x18], 0
je 0x4046cc
mov eax, dword [ebp + 0x18]
mov dword [eax], 0
cmp dword [ebp + 0x1c], 0
je 0x4046db
mov eax, dword [ebp + 0x1c]
mov dword [eax], 0
cmp dword [ebp + 0x20], 0
je 0x4046ea
mov eax, dword [ebp + 0x20]
mov dword [eax], 0
cmp dword [ebp + 0x10], 0
jne 0x404824
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x13c4]
test eax, eax
jne 0x404824
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x13a8], 0x1388
mov eax, dword [ebp - 0xc]
lea edx, [eax + 4]
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x13a4], edx
mov eax, dword [ebp - 0xc]
add eax, 0x1394
mov dword [esp + 4], 2
mov dword [esp], eax
call fcn.004021f1
sub esp, 8
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 3
je 0x404774
cmp dword [ebp - 0x10], 4
je 0x404774
cmp dword [ebp + 8], 0
je 0x404759
mov eax, dword [ebp + 8]
mov edx, dword [ebp - 0x10]
mov dword [eax], edx
cmp dword [ebp - 0xc], 0
je 0x404934
mov eax, dword [ebp - 0xc]
mov edx, dword [ebp - 0x10]
mov dword [eax + 0x13c4], edx
jmp 0x404934
mov eax, dword [ebp - 0xc]
mov eax, dword [eax + 0x13a8]
cmp eax, 0x1387
ja 0x404818
mov eax, dword [ebp - 0xc]
mov edx, dword [eax + 0x13a8]
mov eax, 0x1388
sub eax, edx
mov dword [ebp - 0x14], eax
mov eax, dword [ebp - 0xc]
mov edx, dword [eax]
mov eax, dword [ebp - 0x14]
mov ecx, dword [ebp - 0xc]
add ecx, 4
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov dword [esp], ecx
call sub.msvcrt.dll_fwrite
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x14]
cmp eax, dword [ebp - 0x18]
jne 0x4047dd
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
test eax, eax
je 0x4047e4
mov eax, 1
jmp 0x4047e9
mov eax, 0
test al, al
je 0x404818
cmp dword [ebp + 8], 0
je 0x4047fc
mov eax, dword [ebp + 8]
mov dword [eax], 0xfffffffa
cmp dword [ebp - 0xc], 0
je 0x404937
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x13c4], 0xfffffffa
jmp 0x404937
cmp dword [ebp - 0x10], 4
je 0x404823
jmp 0x404705
nop
cmp dword [ebp + 0x10], 0
jne 0x404842
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
test eax, eax
jne 0x404842
mov eax, 1
jmp 0x404847
mov eax, 0
test al, al
je 0x404899
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_fflush
mov eax, dword [ebp - 0xc]
mov eax, dword [eax]
mov dword [esp], eax
call sub.msvcrt.dll_ferror
test eax, eax
setne al
test al, al
je 0x404899
cmp dword [ebp + 8], 0
je 0x40487d
mov eax, dword [ebp + 8]
mov dword [eax], 0xfffffffa
cmp dword [ebp - 0xc], 0
je 0x40493a
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x13c4], 0xfffffffa
jmp 0x40493a
cmp dword [ebp + 0x14], 0
je 0x4048ad
mov eax, dword [ebp - 0xc]
mov edx, dword [eax + 0x139c]
mov eax, dword [ebp + 0x14]
mov dword [eax], edx
cmp dword [ebp + 0x18], 0
je 0x4048c1
mov eax, dword [ebp - 0xc]
mov edx, dword [eax + 0x13a0]
mov eax, dword [ebp + 0x18]
mov dword [eax], edx
cmp dword [ebp + 0x1c], 0
je 0x4048d5
mov eax, dword [ebp - 0xc]
mov edx, dword [eax + 0x13ac]
mov eax, dword [ebp + 0x1c]
mov dword [eax], edx
cmp dword [ebp + 0x20], 0
je 0x4048e9
mov eax, dword [ebp - 0xc]
mov edx, dword [eax + 0x13b0]
mov eax, dword [ebp + 0x20]
mov dword [eax], edx
cmp dword [ebp + 8], 0
je 0x4048f8
mov eax, dword [ebp + 8]
mov dword [eax], 0
cmp dword [ebp - 0xc], 0
je 0x40490b
mov eax, dword [ebp - 0xc]
mov dword [eax + 0x13c4], 0
mov eax, dword [ebp - 0xc]
add eax, 0x1394
mov dword [esp], eax
call fcn.00402421
sub esp, 4
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sub.msvcrt.dll_free
jmp 0x40493b
nop
jmp 0x40493b
nop
jmp 0x40493b
nop
jmp 0x40493b
nop
jmp 0x40493b
nop
jmp 0x40493b
nop
leave
ret 0x1c