Function at 0x5187d5
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x28
push ebx
push esi
mov esi, ecx
xor ebx, ebx
push edi
mov dword [ebp - 0x10], ebx
cmp dword [esi + 0x18], 1
jne 0x518826
lea eax, [ebp - 0x10]
push ebx
push eax
lea eax, [ebp - 0x14]
push 2
push eax
push dword [ebp + 8]
mov dword [ebp - 0x14], 0xfeff
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x518826
mov ecx, esi
call fcn.00517bb2
lea eax, [ebp + 8]
push 0x5af2c0
push eax
mov dword [ebp + 8], 0x101
call fcn.00529cc7
push 4
push 0x1000
push 0xa0000
push ebx
call dword [sym.imp.KERNEL32.dll_VirtualAlloc]
cmp eax, ebx
mov dword [ebp - 0xc], eax
jne 0x51885c
mov ecx, esi
call fcn.00517bb2
lea eax, [ebp + 8]
push 0x5af2c0
push eax
mov dword [ebp + 8], 0x201
call fcn.00529cc7
cmp dword [esi + 0x18], ebx
mov dword [ebp - 8], ebx
setne al
inc eax
cmp dword [esi + 8], ebx
mov byte [ebp - 1], al
jbe 0x5189b4
mov eax, dword [esi + 4]
mov ecx, dword [ebp - 8]
lea edi, [eax + ecx*8]
mov eax, dword [eax + ecx*8]
cmp eax, ebx
je 0x518937
xor ecx, ecx
cmp eax, dword [esi + 0x44]
mov eax, dword [0x64cbfc]
sete cl
mov dword [ebp - 0x14], ecx
movzx ecx, word [edi + 4]
add ecx, eax
add ecx, dword [ebp - 0x14]
cmp ecx, 0xa0000
jb 0x5188c9
lea ecx, [ebp - 0x10]
push ebx
push ecx
push eax
push dword [ebp - 0xc]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5189f3
mov dword [0x64cbfc], ebx
mov eax, ebx
movzx ecx, word [edi + 4]
push ecx
mov ecx, dword [ebp - 0xc]
push dword [edi]
add eax, ecx
push eax
call fcn.005244d0
movzx eax, word [edi + 4]
add dword [0x64cbfc], eax
add esp, 0xc
cmp dword [ebp - 0x14], ebx
je 0x51891e
cmp dword [esi + 0x18], ebx
mov eax, 0x5c06fc
je 0x5188fc
mov eax, 0x5cb280
movzx edi, byte [ebp - 1]
lea ecx, [edi + edi]
push ecx
push eax
mov eax, dword [0x64cbfc]
sub eax, edi
add eax, dword [ebp - 0xc]
push eax
call fcn.005244d0
add esp, 0xc
add dword [0x64cbfc], edi
mov eax, dword [ebp - 8]
xor edx, edx
mov ecx, 0x3e8
div ecx
test edx, edx
jne 0x518937
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
mov eax, dword [esi + 0x24]
cmp eax, ebx
mov dword [ebp - 0x14], eax
je 0x5189a5
push 4
pop edi
cmp dword [esi + 0x3c], edi
je 0x518961
push ebx
push ebx
push edi
mov dword [esi + 0x3c], edi
push dword [esi + 0x28]
mov byte [esi + 0x40], bl
call eax
test eax, eax
je 0x518a0f
jmp 0x5189a5
mov eax, dword [ebp - 8]
mov dword [ebp - 0x1c], ebx
inc eax
mov dword [ebp - 0x24], ebx
mov dword [ebp - 0x20], eax
mov eax, dword [esi + 8]
fild qword [ebp - 0x20]
mov dword [ebp - 0x28], eax
fmul dword [0x58de4c]
fild qword [ebp - 0x28]
fdivp st(1)
call fcn.00528c4c
cmp byte [esi + 0x40], al
mov byte [ebp - 0x18], al
je 0x5189a5
push ebx
mov byte [esi + 0x40], al
push dword [ebp - 0x18]
push edi
push dword [esi + 0x28]
call dword [ebp - 0x14]
test eax, eax
je 0x518a2b
inc dword [ebp - 8]
mov eax, dword [ebp - 8]
cmp eax, dword [esi + 8]
jb 0x518872
mov eax, dword [0x64cbfc]
cmp eax, ebx
je 0x518a4d
lea ecx, [ebp - 0x10]
push ebx
push ecx
push eax
push dword [ebp - 0xc]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x518a47
mov ecx, esi
call fcn.00517bb2
lea eax, [ebp + 8]
push 0x5af2c0
push eax
mov dword [ebp + 8], 0x101
call fcn.00529cc7
mov ecx, esi
call fcn.00517bb2
lea eax, [ebp + 8]
push 0x5af2c0
push eax
mov dword [ebp + 8], 0x101
call fcn.00529cc7
mov ecx, esi
call fcn.00517bb2
lea eax, [ebp + 8]
push 0x5af2c0
push eax
mov dword [ebp + 8], 0x1001
call fcn.00529cc7
mov ecx, esi
call fcn.00517bb2
lea eax, [ebp + 8]
push 0x5af2c0
push eax
mov dword [ebp + 8], 0x1001
call fcn.00529cc7
mov dword [0x64cbfc], ebx
push 0x8000
push ebx
push dword [ebp - 0xc]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
pop edi
pop esi
pop ebx
leave
ret 4