Function at 0x412520
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x858
push ebx
push ebp
push esi
mov esi, ecx
mov eax, dword [esi + 0x10cc07c]
mov ecx, dword [esi + 0x10cc080]
mov edx, dword [eax + 0xe0]
mov eax, dword [eax + 0xe4]
push edi
mov edi, dword [ecx + 0xe0]
mov ecx, dword [ecx + 0xe4]
cmp eax, ecx
lea ebp, [esi + 0x10969f8]
mov dword [esp + 0x58], ebp
jg 0x41257c
jl 0x41256a
cmp edx, edi
jae 0x41257c
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], ecx
jmp 0x412598
mov dword [esp + 0x20], edi
mov dword [esp + 0x2c], eax
mov dword [esp + 0x24], ecx
mov dword [esp + 0x28], edx
mov eax, ecx
mov ecx, dword [esp + 0x2c]
mov edi, edx
mov edx, dword [esp + 0x20]
cmp edx, edi
jne 0x4125a4
cmp eax, ecx
je 0x412957
xor ebx, ebx
sub edi, edx
sbb ecx, eax
mov dword [esp + 0x1c], ecx
mov dword [esp + 0x18], edi
fild qword [esp + 0x18]
push 0xcf
mov dword [esp + 0x3c], ebx
fstp qword [esp + 0x44]
call fcn.004159d0
mov edx, dword [esi + 0x1097a10]
mov edi, dword [sym.imp.USER32.dll_SendMessageW]
add esp, 4
push eax
push 2
push 0x400
push edx
call edi
mov eax, dword [esi + 0x10975fc]
mov ecx, dword [esi + 0x10cc078]
push ebx
push ebx
push ebx
push eax
push ebp
call fcn.00401850
push ebx
push 0x20
push 3
push ebx
push ebx
push 0x40000000
push ebp
call dword [sym.imp.KERNEL32.dll_CreateFileW]
mov ebp, eax
cmp ebp, 0xffffffff
mov dword [esp + 0x30], ebp
jne 0x412636
mov ecx, dword [esi + 0x1097a10]
push 0x64
push 1
push 0x400
push ecx
call edi
mov dword [esi + 0x1097a10], ebx
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret
push 2
push ebx
push ebx
push ebp
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov edx, dword [esi + 0x10cc078]
mov edi, dword [edx + 0x2c]
imul edi, dword [esi + 0x10975fc]
shl edi, 2
push edi
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
push eax
mov dword [esp + 0x50], eax
call dword [sym.imp.KERNEL32.dll_GlobalLock]
mov edx, eax
mov ecx, edi
mov ebx, ecx
shr ecx, 2
xor eax, eax
mov edi, edx
rep stosd dword es:[edi], eax
mov ecx, ebx
and ecx, 3
rep stosb byte es:[edi], al
mov eax, dword [esi + 0x10cc078]
mov ebx, dword [eax + 0x2c]
mov eax, dword [esi + 0x10975fc]
test eax, eax
mov dword [esp + 0x3c], edx
mov dword [esp + 0x34], 0
mov dword [esp + 0x10], 0
jbe 0x412724
mov dword [esp + 0x14], edx
lea esp, [esp]
xor edi, edi
test ebx, ebx
jle 0x412700
mov ebp, edx
jmp 0x4126c0
mov eax, dword [esi + 0x10975fc]
mov ecx, dword [esp + 0x10]
cdq
sub eax, edx
sar eax, 1
cdq
sub ecx, eax
mov eax, 0
sbb eax, edx
add ecx, dword [esp + 0x20]
mov edx, dword [esp + 0x24]
push edi
adc eax, edx
push eax
push ecx
mov ecx, dword [esi + 0x10cc078]
call fcn.004014c0
inc edi
fstp dword [ebp]
add ebp, 4
cmp edi, ebx
jl 0x4126c0
mov ebp, dword [esp + 0x30]
mov edx, dword [esp + 0x14]
mov ecx, dword [esp + 0x10]
lea eax, [ebx*4]
add edx, eax
mov eax, dword [esi + 0x10975fc]
inc ecx
cmp ecx, eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], edx
jb 0x4126b0
mov edi, dword [esp + 0x24]
cmp edi, dword [esp + 0x2c]
mov eax, dword [esp + 0x20]
mov dword [esp + 0x18], eax
mov dword [esp + 0x1c], edi
jg 0x4128f9
jl 0x41274a
cmp eax, dword [esp + 0x28]
jae 0x4128f9
fld qword [0x4307c8]
fdiv qword [esp + 0x40]
fstp qword [esp + 0x60]
jmp 0x412762
mov edi, dword [esp + 0x24]
mov eax, dword [esp + 0x20]
mov edx, dword [esp + 0x18]
sub edx, eax
mov eax, dword [esp + 0x1c]
sbb eax, edi
mov dword [esp + 0x40], edx
mov dword [esp + 0x44], eax
fild qword [esp + 0x40]
fmul qword [esp + 0x60]
fmul qword [0x42f6f0]
call fcn.0041a7f8
mov ebp, eax
cmp ebp, dword [esp + 0x38]
je 0x4127aa
mov ecx, dword [esi + 0x1097a10]
push ebp
push 1
push 0x400
push ecx
call dword [sym.imp.USER32.dll_SendMessageW]
mov dword [esp + 0x38], ebp
xor ebp, ebp
test ebx, ebx
mov dword [esp + 0x14], ebp
jle 0x412886
mov eax, dword [esp + 0x3c]
lea edi, [esp + 0x68]
mov ecx, edi
lea edx, [esi + 0x10971f8]
sub eax, ecx
mov dword [esp + 0x10], edx
mov dword [esp + 0x50], eax
mov edx, dword [esp + 0x10]
cmp dword [edx], 0
jne 0x4127eb
mov eax, dword [esi + 0x10cc078]
cmp dword [eax + 0x30], 1
je 0x41286f
mov eax, dword [esi + 0x10975fc]
mov ecx, dword [esp + 0x18]
cdq
sub eax, edx
sar eax, 1
cdq
add eax, ecx
mov ecx, dword [esp + 0x1c]
push ebp
adc edx, ecx
mov ecx, dword [esi + 0x10cc078]
push edx
push eax
call fcn.004014c0
mov edx, dword [esp + 0x3c]
mov ecx, ebx
imul ecx, dword [esp + 0x34]
add ecx, ebp
mov dword [edi], 0
fstp dword [edx + ecx*4]
mov eax, dword [esi + 0x10975fc]
test eax, eax
mov dword [esp + 0x54], eax
jle 0x412859
mov eax, dword [esp + 0x50]
fld dword [0x432af8]
mov ecx, dword [esi + 0x10975fc]
lea edx, [ebx*4]
add eax, edi
mov edi, edi
fadd dword [eax]
add eax, edx
dec ecx
jne 0x412850
fstp dword [edi]
fild dword [esp + 0x54]
mov eax, dword [esp + 0x14]
inc eax
mov dword [esp + 0x14], eax
fdivr dword [edi]
fstp dword [esp + eax*4 + 0x464]
mov edx, dword [esp + 0x10]
inc ebp
add edx, 4
add edi, 4
cmp ebp, ebx
mov dword [esp + 0x10], edx
jl 0x4127d2
mov edx, dword [esp + 0x14]
push 0
lea ecx, [esp + 0x60]
push ecx
lea eax, [edx*4]
mov edx, dword [esp + 0x38]
push eax
lea ecx, [esp + 0x474]
push ecx
push edx
call dword [sym.imp.KERNEL32.dll_WriteFile]
mov eax, dword [esp + 0x34]
mov ecx, dword [esi + 0x10975fc]
inc eax
cdq
idiv ecx
mov ebp, dword [esp + 0x18]
mov eax, ecx
mov ecx, dword [esp + 0x2c]
mov dword [esp + 0x34], edx
cdq
add ebp, eax
mov eax, dword [esp + 0x1c]
adc eax, edx
cmp eax, ecx
mov dword [esp + 0x18], ebp
mov dword [esp + 0x1c], eax
jl 0x41275a
jg 0x4128f1
mov ecx, dword [esp + 0x28]
mov eax, ebp
cmp eax, ecx
jb 0x41275a
mov ebp, dword [esp + 0x30]
mov edi, dword [esp + 0x24]
mov ebx, dword [esp + 0x4c]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalUnlock]
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov ecx, dword [esp + 0x20]
push edi
push ecx
push ebp
mov ecx, esi
call fcn.00411a40
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esi + 0x1097a10]
mov edi, dword [sym.imp.USER32.dll_SendMessageW]
push 0x64
push 1
push 0x400
push edx
call edi
mov eax, dword [esp + 0x58]
push eax
push 1
mov dword [esi + 0x1097a10], 0
mov ecx, dword [0x4405b4]
push 0x400
push ecx
call edi
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret