Function at 0x40a178
Capabilities:
Write file on windows

Disassembly:
push ebp
push ebx
push edi
mov edx, 0x2f
sub esp, 4
mov dword [esp], 0
dec edx
jne 0x40a180
mov edx, dword [esp + 0xcc]
lea ecx, [esp]
call fcn.0040d060
mov edx, dword [esp + 0xd0]
lea ecx, [esp + 4]
call fcn.0040d060
lea edx, [esp + 8]
push edx
push 0
push 0xb
push 0x106
push 1
call fcn.0041ccd1
mov dword [esp + 0x7c], 0xffffffff
lea eax, [esp + 0x98]
push eax
call fcn.004315ff
add esp, 4
lea eax, [0x40b1f1]
push eax
lea ebp, [esp + 0x9c]
pop eax
mov dword [ebp], eax
lea eax, [esp + 0x98]
push eax
push dword [esp + 4]
call fcn.00431b50
add esp, 8
mov dword [esp + 0xb8], eax
cmp dword [esp + 0xb8], 0
je 0x40a81f
push dword [esp]
call fcn.0040b859
mov dword [esp - 4], eax
fild dword [esp - 4]
fdivr dword [0x43d484]
fstp dword [esp + 0x94]
push dword [0x43f97c]
push dword [0x43f97c]
push 1
push dword [esp + 0x10]
call fcn.0040dd70
inc dword [0x43f97c]
mov edx, 0x43c22d
pop ecx
mov dword [0x43f97c], ecx
add ecx, dword [0x43d79c]
call fcn.0041cfa0
jne 0x40a296
mov edx, dword [esp + 4]
push dword [0x43f97c]
call fcn.0041d050
mov edx, 0x43c22d
call fcn.0041d050
lea eax, [esp + 8]
push eax
call fcn.0041cfd0
mov ebx, dword [esp + 0x70]
cmp ebx, 0xffffffff
je 0x40a7f0
mov ebx, dword [esp + 0x7c]
inc ebx
mov dword [esp + 0x7c], ebx
cmp dword [esp + 0xd8], 0
je 0x40a322
fild dword [esp + 0x7c]
fmul dword [esp + 0x94]
sub esp, 8
fstp qword [esp]
call fcn.00411860
push eax
push 0
push dword [esp + 0xe0]
call fcn.00411c59
mov ebx, eax
cmp ebx, 1
jne 0x40a322
push dword [esp + 0xb8]
call fcn.00433655
add esp, 4
push dword [esp + 0x88]
call fcn.004163b0
push dword [esp + 0x84]
call fcn.00413af0
push dword [esp + 0xb8]
call fcn.00431ed1
add esp, 4
xor eax, eax
jmp 0x40a827
cmp dword [esp + 0x70], 0
je 0x40a32d
xor eax, eax
jmp 0x40a332
mov eax, 1
and eax, eax
je 0x40a34f
push dword [esp + 0xb8]
call fcn.00432555
add esp, 4
mov dword [esp + 0x70], 1
jmp 0x40a373
push dword [esp + 0xb8]
call fcn.004325e5
add esp, 4
mov dword [esp + 0x78], eax
mov ebx, dword [esp + 0x78]
cmp ebx, 0xffffff9c
jne 0x40a373
mov dword [esp + 0x70], 0xffffffff
push 0
push 0
push 0
push 0
push 0x104
push dword [esp + 0x1c]
lea eax, [esp + 0x28]
push eax
push dword [esp + 0xd4]
call fcn.00432526
add esp, 0x20
push dword [0x43f97c]
push dword [0x43f97c]
push 2
push 0xffffffff
push dword [esp + 0x18]
call fcn.00413cc0
lea ebp, [esp + 0x14]
lea eax, [ebp + 0x50]
push eax
call fcn.0041cfd0
mov eax, dword [ebp + 0x1c]
cdq
push edx
push eax
pop dword [esp + 0x68]
pop dword [esp + 0x68]
push dword [esp + 0x68]
push dword [esp + 0x68]
pop ebx
pop edi
cmp edi, 0
jg 0x40a3f8
jl 0x40a3f4
cmp ebx, 0
ja 0x40a3f8
xor eax, eax
jmp 0x40a3fd
mov eax, 1
or eax, eax
je 0x40a412
fild qword [esp + 0x64]
fdivr dword [0x43d484]
fstp dword [esp + 0x90]
mov edx, dword [esp + 4]
push dword [0x43f97c]
call fcn.0041d050
lea ebp, [esp + 0x14]
mov edx, dword [ebp + 0x50]
call fcn.0041d050
lea eax, [esp + 0x70]
push eax
call fcn.0041cfd0
push dword [0x43f97c]
push dword [0x43f97c]
push 2
push 0x43c22d
push str._01
push dword [esp + 0x80]
call fcn.0040e350
pop dword [0x43f97c]
push dword [esp + 0x68]
push dword [esp + 0x68]
pop ebx
pop edi
cmp ebx, 0
jne 0x40a478
cmp edi, 0
je 0x40a47c
xor eax, eax
jmp 0x40a481
mov eax, 1
or eax, eax
je 0x40a4d0
mov ebx, dword [esp + 0xd4]
cmp ebx, 1
jne 0x40a4d0
push dword [0x43f97c]
push dword [0x43f97c]
push 1
push dword [ebp + 0x50]
call fcn.0040dd70
inc dword [0x43f97c]
mov edx, 0x43c22d
pop ecx
mov dword [0x43f97c], ecx
add ecx, dword [0x43d79c]
call fcn.0041cfa0
je 0x40a4d0
mov eax, 1
jmp 0x40a4d2
xor eax, eax
and eax, eax
je 0x40a52b
push dword [esp + 0x6c]
call fcn.0040a01e
push dword [esp + 0xb8]
call fcn.00433655
add esp, 4
lea ebp, [esp + 0x10]
push dword [ebp + 0x38]
push dword [ebp + 0x3c]
push dword [ebp + 0x40]
push dword [ebp + 0x44]
mov ebx, dword [ebp + 0x48]
inc ebx
push ebx
push dword [ebp + 0x4c]
call fcn.004175f7
push eax
push 2
push dword [esp + 0x74]
call fcn.00416229
push dword [ebp + 0x34]
push dword [esp + 0x70]
call fcn.00416305
jmp 0x40a7eb
push dword [0x43f1c4]
mov edx, 0x43c01e
pop ecx
call fcn.0041cfa0
jne 0x40a564
sub esp, 4
push dword [0x43f1c4]
push dword [esp + 0xc0]
call fcn.00433036
add esp, 8
push eax
pop eax
add esp, 4
mov dword [esp + 0x80], eax
jmp 0x40a57a
push dword [esp + 0xb8]
call fcn.0043301d
add esp, 4
mov dword [esp + 0x80], eax
cmp dword [esp + 0x80], 0
je 0x40a588
xor eax, eax
jmp 0x40a58d
mov eax, 1
and eax, eax
je 0x40a7eb
mov ebx, dword [esp + 0xd4]
and ebx, ebx
jne 0x40a5c4
push dword [0x43f97c]
push dword [0x43f97c]
push dword [esp + 0x74]
call fcn.00415e2d
lea ebp, [esp + 0x14]
lea eax, [ebp + 0x50]
push eax
call fcn.0041cfd0
jmp 0x40a5f3
push dword [0x43f97c]
push dword [0x43f97c]
push dword [0x43f97c]
push dword [esp + 0x78]
call fcn.00415e3f
mov edx, dword [0x43d79c]
add dword [esp], edx
call fcn.0040a01e
pop dword [0x43f97c]
push 0x43d439
push dword [esp + 0x70]
call sub.MSVCRT.dll_fopen
add esp, 8
mov dword [esp + 0x88], eax
cmp dword [esp + 0x88], 0
je 0x40a7dc
push 0x19000
call fcn.004139f0
mov dword [esp + 0x84], eax
cmp dword [esp + 0x84], 0
je 0x40a795
mov dword [esp + 0x74], 0
push 0x19000
push dword [esp + 0x88]
push dword [esp + 0xc0]
call fcn.00433070
add esp, 0xc
cdq
push edx
push eax
pop dword [esp + 0x68]
pop dword [esp + 0x68]
push dword [esp + 0x68]
push dword [esp + 0x68]
pop ebx
pop edi
cmp ebx, 0
jne 0x40a67e
cmp edi, 0
jne 0x40a67e
xor eax, eax
jmp 0x40a683
mov eax, 1
or eax, eax
je 0x40a6a7
push dword [esp + 0x88]
push 1
mov eax, dword [esp + 0x6c]
push eax
push dword [esp + 0x90]
call sub.MSVCRT.dll_fwrite
add esp, 0x10
mov ebx, dword [esp + 0x74]
mov ecx, ebx
sar ecx, 0x1f
push ecx
push ebx
lea eax, [esp + 0x6c]
mov edx, dword [eax]
add dword [esp], edx
mov edx, dword [eax + 4]
adc dword [esp + 4], edx
pop eax
pop edx
mov dword [esp + 0x74], eax
cmp dword [esp + 0xd8], 0
je 0x40a757
fild dword [esp + 0x7c]
fmul dword [esp + 0x94]
sub esp, 8
fstp qword [esp]
call fcn.00411860
push eax
fild dword [esp + 0x78]
fmul dword [esp + 0x94]
sub esp, 8
fstp qword [esp]
call fcn.00411860
push eax
push dword [esp + 0xe0]
call fcn.00411c59
mov ebx, eax
cmp ebx, 1
jne 0x40a757
push dword [esp + 0xb8]
call fcn.00433655
add esp, 4
push dword [esp + 0x88]
call sub.MSVCRT.dll_fclose
add esp, 4
push dword [esp + 0x84]
call fcn.00413af0
push dword [esp + 0xb8]
call fcn.00431ed1
add esp, 4
xor eax, eax
jmp 0x40a827
push dword [esp + 0x68]
push dword [esp + 0x68]
pop ebx
pop edi
cmp ebx, 0
jne 0x40a76f
cmp edi, 0
jne 0x40a76f
xor eax, eax
jmp 0x40a774
mov eax, 1
or eax, eax
je 0x40a77c
xor eax, eax
jmp 0x40a781
mov eax, 1
and eax, eax
je 0x40a640
push dword [esp + 0x84]
call fcn.00413af0
push dword [esp + 0x88]
call sub.MSVCRT.dll_fclose
add esp, 4
lea ebp, [esp + 0x10]
push dword [ebp + 0x38]
push dword [ebp + 0x3c]
push dword [ebp + 0x40]
push dword [ebp + 0x44]
mov ebx, dword [ebp + 0x48]
inc ebx
push ebx
push dword [ebp + 0x4c]
call fcn.004175f7
push eax
push 2
push dword [esp + 0x74]
call fcn.00416229
push dword [ebp + 0x34]
push dword [esp + 0x70]
call fcn.00416305
push dword [esp + 0xb8]
call fcn.00433655
add esp, 4
jmp 0x40a296
cmp dword [esp + 0xd8], 0
je 0x40a810
push 0x64
push 0x64
push dword [esp + 0xe0]
call fcn.00411c59
push dword [esp + 0xb8]
call fcn.00431ed1
add esp, 4
mov eax, dword [esp + 0x7c]
jmp 0x40a827
lea edx, [esp + 0x10]
push 0x43d4a0
push edx
call fcn.0040d0a4
push dword [esp + 0x6c]
call fcn.0041d140
push dword [esp]
call fcn.0041d140
push dword [esp + 4]
call fcn.0041d140
push eax
push dword [esp + 0xc]
call fcn.0041cdf9
pop eax
add esp, 0xbc
pop edi
pop ebx
pop ebp
ret 0x10