Function at 0x4f64df
Capabilities:
Encode data using xor
Get file size
Read file on windows
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x61dc40]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 8]
mov edx, dword [ebp + 0x10]
push ebx
push esi
push edi
mov esi, str.SQLite_format_3
lea edi, [ebp - 0x14]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
movsd dword es:[edi], dword [esi]
mov dword [ebp - 0x3c], eax
mov eax, dword [ebp + 0xc]
mov dword [ebp - 0x30], eax
movsd dword es:[edi], dword [esi]
mov dword [ebp - 0x38], 0x63b9e0
cmp edx, 0x100
je 0x4f6523
mov dword [ebp - 0x38], 0x63b8f8
mov eax, dword [ebp - 0x38]
call fcn.004f5a49
xor ebx, ebx
push ebx
push 0x80
push 3
push ebx
push 3
push 0x120089
push dword [ebp - 0x3c]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x24], eax
cmp eax, 0xffffffff
jne 0x4f6555
xor eax, eax
jmp 0x4f6766
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_GetFileSize]
mov dword [ebp - 0x3c], eax
cmp eax, ebx
jne 0x4f6577
xor esi, esi
inc esi
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_CloseHandle]
mov eax, esi
jmp 0x4f6766
cmp eax, 0x20
jae 0x4f6581
push 2
pop esi
jmp 0x4f6567
mov esi, dword [sym.imp.KERNEL32.dll_VirtualAlloc]
push 4
push 0x1000
push 0x20
push ebx
call esi
mov edi, eax
mov dword [ebp - 0x1c], edi
cmp edi, ebx
jne 0x4f65a0
push 4
jmp 0x4f657e
push ebx
lea eax, [ebp - 0x40]
push eax
push 0x20
push edi
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x4f65b9
push 0x10
jmp 0x4f657e
mov al, byte [edi + 0x10]
mov byte [ebp - 0x1f], al
mov al, byte [edi + 0x11]
mov byte [ebp - 0x20], al
movzx edi, word [ebp - 0x20]
mov eax, edi
and eax, 0x800003ff
jns 0x4f65d9
dec eax
or eax, 0xfffffc00
inc eax
je 0x4f65df
push 0x12
jmp 0x4f657e
mov eax, dword [ebp - 0x1c]
mov cl, byte [eax + 0x14]
push 0x4000
push 0x20
push eax
mov byte [ebp - 0x15], cl
call dword [sym.imp.KERNEL32.dll_VirtualFree]
push ebx
push ebx
push ebx
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
push 4
push 0x1000
push edi
push ebx
call esi
mov dword [ebp - 0x1c], eax
cmp eax, ebx
je 0x4f659c
push 4
push 0x1000
push edi
push ebx
call esi
mov dword [ebp - 0x28], eax
cmp eax, ebx
je 0x4f659c
push ebx
push 0x80
push 2
push ebx
xor esi, esi
inc esi
push esi
push 0x12019f
push dword [ebp - 0x30]
call dword [sym.imp.KERNEL32.dll_CreateFileA]
mov dword [ebp - 0x34], eax
cmp eax, 0xffffffff
jne 0x4f6654
push 8
jmp 0x4f657e
push ebx
push ebx
push ebx
push eax
call dword [sym.imp.KERNEL32.dll_SetFilePointer]
mov dword [ebp - 0x30], ebx
mov dword [ebp - 0x2c], esi
cmp edi, dword [ebp - 0x3c]
ja 0x4f672b
push ebx
lea eax, [ebp - 0x40]
push eax
push edi
push dword [ebp - 0x1c]
push dword [ebp - 0x24]
call dword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x4f6775
push edi
push ebx
push dword [ebp - 0x28]
call fcn.00596530
movsx esi, byte [ebp - 0x15]
mov edx, dword [ebp - 0x38]
add esp, 0xc
cmp dword [ebp + 0x10], 0x100
mov ecx, edi
jne 0x4f66aa
push 6
jmp 0x4f66ac
push 4
push esi
push dword [ebp - 0x28]
push dword [ebp - 0x2c]
push dword [ebp - 0x1c]
call fcn.004f6419
add esp, 0x14
push esi
mov esi, dword [ebp - 0x1c]
push dword [ebp - 0x28]
mov eax, edi
mov edi, esi
call fcn.004f649f
cmp dword [ebp - 0x2c], 1
pop ecx
pop ecx
jne 0x4f66fd
push 0xf
pop ecx
lea edi, [ebp - 0x14]
xor eax, eax
repe cmpsb byte [esi], byte es:[edi]
jne 0x4f678c
mov ecx, dword [ebp - 0x1c]
mov esi, dword [ebp - 0x28]
push 8
lea eax, [ecx + 0x10]
sub esi, ecx
pop edi
mov cl, byte [esi + eax]
xor byte [eax], cl
inc eax
dec edi
jne 0x4f66f4
movzx edi, word [ebp - 0x20]
push ebx
lea eax, [ebp - 0x40]
push eax
push edi
push dword [ebp - 0x1c]
push dword [ebp - 0x34]
call dword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x4f6791
add dword [ebp - 0x30], edi
mov eax, dword [ebp - 0x30]
inc dword [ebp - 0x2c]
add eax, edi
cmp eax, dword [ebp - 0x3c]
jbe 0x4f666d
mov esi, dword [sym.imp.KERNEL32.dll_VirtualFree]
push 0x4000
push edi
push dword [ebp - 0x1c]
call esi
push 0x4000
push edi
push dword [ebp - 0x28]
call esi
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [ebp - 0x24], ebx
je 0x4f6757
push dword [ebp - 0x24]
call esi
cmp dword [ebp - 0x34], ebx
je 0x4f6761
push dword [ebp - 0x34]
call esi
mov eax, 0x10000
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.0058f3cf
leave
ret
push 0x10
pop edi
push dword [ebp - 0x24]
mov esi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call esi
push dword [ebp - 0x34]
call esi
mov eax, edi
jmp 0x4f6766
or edi, 0xffffffff
jmp 0x4f6778
push 0x11
jmp 0x4f6777