Function at 0x5147be
Capabilities:
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x20
push ebx
push esi
mov esi, ecx
xor ebx, ebx
push edi
mov dword [ebp - 0x10], ebx
cmp dword [esi + 0x14], 1
jne 0x51480f
lea eax, [ebp - 0x10]
push ebx
push eax
lea eax, [ebp - 0xc]
push 2
push eax
push dword [ebp + 8]
mov dword [ebp - 0xc], 0xfeff
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x51480f
mov ecx, esi
call fcn.00512f20
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 [esi + 0x18c], eax
jne 0x514848
mov ecx, esi
call fcn.00512f20
lea eax, [ebp + 8]
push 0x5af2c0
push eax
mov dword [ebp + 8], 0x201
call fcn.00529cc7
cmp dword [esi + 0x14], ebx
mov dword [ebp - 8], ebx
setne cl
inc ecx
cmp dword [esi + 8], ebx
mov byte [ebp - 2], cl
jbe 0x514980
mov dword [ebp - 0xc], ebx
jmp 0x514866
mov cl, byte [ebp - 2]
mov edi, dword [esi + 4]
add edi, dword [ebp - 0xc]
mov eax, dword [edi]
cmp eax, ebx
je 0x514937
cmp eax, dword [esi + 0x2a4]
movzx eax, word [edi + 4]
sete byte [ebp - 1]
cmp byte [ebp - 1], bl
je 0x51488e
movzx ecx, cl
add eax, ecx
mov ecx, dword [0x64cbe8]
add eax, ecx
cmp eax, 0xa0000
jb 0x5148c2
lea eax, [ebp - 0x10]
push ebx
push eax
push ecx
push dword [esi + 0x18c]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x5149be
xor ecx, ecx
mov dword [0x64cbe8], ecx
movzx eax, word [edi + 4]
push eax
mov eax, dword [esi + 0x18c]
push dword [edi]
add eax, ecx
push eax
call fcn.005244d0
movzx eax, word [edi + 4]
add dword [0x64cbe8], eax
add esp, 0xc
cmp byte [ebp - 1], bl
je 0x51491e
cmp dword [esi + 0x14], ebx
mov eax, 0x5c06fc
je 0x5148f8
mov eax, 0x5cb280
movzx edi, byte [ebp - 2]
lea ecx, [edi + edi]
push ecx
push eax
mov eax, dword [esi + 0x18c]
sub eax, edi
add eax, dword [0x64cbe8]
push eax
call fcn.005244d0
add esp, 0xc
add dword [0x64cbe8], edi
mov eax, dword [ebp - 8]
xor edx, edx
mov ecx, 0x3e8
div ecx
test edx, edx
jne 0x514937
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_FlushFileBuffers]
cmp dword [esi + 0x20], ebx
je 0x51496d
mov eax, dword [ebp - 8]
mov dword [ebp - 0x14], ebx
inc eax
mov dword [ebp - 0x1c], ebx
mov dword [ebp - 0x18], eax
mov eax, dword [esi + 8]
fild qword [ebp - 0x18]
mov dword [ebp - 0x20], eax
push ebx
fmul dword [0x58de4c]
fild qword [ebp - 0x20]
fdivp st(1)
call fcn.00528c4c
push eax
push 4
mov ecx, esi
call fcn.00514cf7
inc dword [ebp - 8]
add dword [ebp - 0xc], 0xc
mov eax, dword [ebp - 8]
cmp eax, dword [esi + 8]
jb 0x514863
mov eax, dword [0x64cbe8]
cmp eax, ebx
je 0x5149e0
lea ecx, [ebp - 0x10]
push ebx
push ecx
push eax
push dword [esi + 0x18c]
push dword [ebp + 8]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x5149da
mov ecx, esi
call fcn.00512f20
lea eax, [ebp + 8]
push 0x5af2c0
push eax
mov dword [ebp + 8], 0x101
call fcn.00529cc7
mov ecx, esi
call fcn.00512f20
lea eax, [ebp + 8]
push 0x5af2c0
push eax
mov dword [ebp + 8], 0x101
call fcn.00529cc7
mov dword [0x64cbe8], ebx
push 0x8000
push ebx
push dword [esi + 0x18c]
call dword [sym.imp.KERNEL32.dll_VirtualFree]
mov dword [esi + 0x18c], ebx
pop edi
pop esi
pop ebx
leave
ret 4