Function at 0x40d4d0
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 0x40d52c
jl 0x40d51a
cmp edx, edi
jae 0x40d52c
mov dword [esp + 0x20], edx
mov dword [esp + 0x24], eax
mov dword [esp + 0x28], edi
mov dword [esp + 0x2c], ecx
jmp 0x40d548
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 0x40d554
cmp eax, ecx
je 0x40d8f4
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 ecx, dword [esi + 0x4930b4]
push ebx
push ebx
push ebx
push 1
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 0x40d5e1
mov eax, dword [esi + 0x48b008]
push 0x64
push 1
push 0x400
push eax
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 ecx, dword [esi + 0x4930b4]
mov edi, dword [ecx + 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 0x40d6c4
mov dword [esp + 0x14], edx
xor edi, edi
test ebx, ebx
jle 0x40d6a0
mov ebp, edx
lea esp, [esp]
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 0x40d660
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 0x40d654
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 0x40d896
jl 0x40d6ea
cmp eax, dword [esp + 0x28]
jae 0x40d896
fld qword [0x428428]
fdiv qword [esp + 0x40]
fstp qword [esp + 0x60]
jmp 0x40d702
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 0x40d74a
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 0x40d826
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 0x40d78b
mov eax, dword [esi + 0x4930b4]
cmp dword [eax + 0x30], 1
je 0x40d80f
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 0x40d7f9
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 0x40d7f0
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 0x40d772
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]
inc eax
cdq
idiv dword [esi + 0x48abf4]
mov edi, dword [esp + 0x18]
mov eax, dword [esp + 0x1c]
mov ecx, dword [esp + 0x2c]
add edi, 1
adc eax, 0
cmp eax, ecx
mov dword [esp + 0x18], edi
mov dword [esp + 0x1c], eax
mov dword [esp + 0x34], edx
jl 0x40d6fa
jg 0x40d88e
mov ecx, dword [esp + 0x28]
mov eax, edi
cmp eax, ecx
jb 0x40d6fa
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