Function at 0x40d900
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 + 0x4930b8]
mov ecx, dword [esi + 0x4930bc]
mov edx, dword [eax + 0xb8]
mov eax, dword [eax + 0xbc]
push edi
mov edi, dword [ecx + 0xb8]
mov ecx, dword [ecx + 0xbc]
cmp eax, ecx
lea ebp, [esi + 0x489ff0]
mov dword [esp + 0x58], ebp
jg 0x40d95c
jl 0x40d94a
cmp edx, edi
jae 0x40d95c
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], ecx
jmp 0x40d978
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 0x40d984
cmp eax, ecx
je 0x40dd37
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.004060c0
mov edx, dword [esi + 0x48b008]
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 + 0x48abf4]
mov ecx, dword [esi + 0x4930b4]
push ebx
push ebx
push ebx
push eax
push ebp
call fcn.00401630
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 0x40da16
mov ecx, dword [esi + 0x48b008]
push 0x64
push 1
push 0x400
push ecx
call edi
mov dword [esi + 0x48b008], 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 + 0x4930b4]
mov edi, dword [edx + 0x2c]
imul edi, dword [esi + 0x48abf4]
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 + 0x4930b4]
mov ebx, dword [eax + 0x2c]
mov eax, dword [esi + 0x48abf4]
test eax, eax
mov dword [esp + 0x3c], edx
mov dword [esp + 0x34], 0
mov dword [esp + 0x10], 0
jbe 0x40db04
mov dword [esp + 0x14], edx
lea esp, [esp]
xor edi, edi
test ebx, ebx
jle 0x40dae0
mov ebp, edx
jmp 0x40daa0
mov eax, dword [esi + 0x48abf4]
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 + 0x4930b4]
call fcn.004014c0
inc edi
fstp dword [ebp]
add ebp, 4
cmp edi, ebx
jl 0x40daa0
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 + 0x48abf4]
inc ecx
cmp ecx, eax
mov dword [esp + 0x10], ecx
mov dword [esp + 0x14], edx
jb 0x40da90
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 0x40dcd9
jl 0x40db2a
cmp eax, dword [esp + 0x28]
jae 0x40dcd9
fld qword [0x428428]
fdiv qword [esp + 0x40]
fstp qword [esp + 0x60]
jmp 0x40db42
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 [0x4276c0]
call fcn.00412e7c
mov ebp, eax
cmp ebp, dword [esp + 0x38]
je 0x40db8a
mov ecx, dword [esi + 0x48b008]
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 0x40dc66
mov eax, dword [esp + 0x3c]
lea edi, [esp + 0x68]
mov ecx, edi
lea edx, [esi + 0x48a7f0]
sub eax, ecx
mov dword [esp + 0x10], edx
mov dword [esp + 0x50], eax
mov edx, dword [esp + 0x10]
cmp dword [edx], 0
jne 0x40dbcb
mov eax, dword [esi + 0x4930b4]
cmp dword [eax + 0x30], 1
je 0x40dc4f
mov eax, dword [esi + 0x48abf4]
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 + 0x4930b4]
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 + 0x48abf4]
test eax, eax
mov dword [esp + 0x54], eax
jle 0x40dc39
mov eax, dword [esp + 0x50]
fld dword [0x4274dc]
mov ecx, dword [esi + 0x48abf4]
lea edx, [ebx*4]
add eax, edi
mov edi, edi
fadd dword [eax]
add eax, edx
dec ecx
jne 0x40dc30
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 0x40dbb2
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 + 0x48abf4]
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 0x40db3a
jg 0x40dcd1
mov ecx, dword [esp + 0x28]
mov eax, ebp
cmp eax, ecx
jb 0x40db3a
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.0040ce30
push ebp
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov edx, dword [esi + 0x48b008]
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 + 0x48b008], 0
mov ecx, dword [0x42f9e0]
push 0x400
push ecx
call edi
pop edi
pop esi
pop ebp
pop ebx
mov esp, ebp
pop ebp
ret