Function at 0x518670
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x63800c]
xor eax, ebp
mov dword [ebp - 4], eax
mov eax, dword [ebp + 0x10]
mov ecx, dword [ebp + 0xc]
push ebx
push esi
push edi
mov edi, dword [ebp + 8]
add ecx, ecx
mov dword [ebp - 0x40], eax
mov eax, dword [ebp + 0x14]
mov dword [ebp - 0x3c], eax
mov eax, dword [edi]
mov dword [ebp - 0x2c], edi
mov eax, dword [eax + 0x10]
mov esi, dword [eax + ecx*8]
mov eax, 1
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x34], eax
lea ecx, [ecx]
push eax
push str.sqlite_stat_d
lea eax, [ebp - 0x1c]
push eax
push 0x18
call fcn.004eb3c0
mov eax, dword [edi]
lea ebx, [ebp - 0x1c]
add esp, 0x10
mov dword [ebp - 0x28], eax
xor edi, edi
mov dword [ebp - 0x24], ebx
cmp dword [eax + 0x14], edi
jle 0x518762
lea ebx, [ebx]
mov eax, edi
mov ecx, edi
xor eax, 1
cmp edi, 2
cmovl ecx, eax
mov dword [ebp - 0x30], ecx
test esi, esi
je 0x5187e4
mov bl, byte [esi]
mov edx, ecx
mov ecx, dword [ebp - 0x28]
add edx, edx
mov eax, esi
mov ecx, dword [ecx + 0x10]
mov edx, dword [ecx + edx*8]
movzx ecx, bl
movzx esi, byte [ecx + 0x5df308]
movzx ecx, byte [edx]
movzx ecx, byte [ecx + 0x5df308]
sub esi, ecx
jne 0x51874f
sub edx, dword [ebp - 0x20]
mov dword [ebp - 0x38], edx
test bl, bl
je 0x5187d3
movzx ecx, byte [edx + eax + 1]
inc eax
movzx edx, byte [ecx + 0x5df308]
mov bl, byte [eax]
movzx ecx, bl
movzx esi, byte [ecx + 0x5df308]
sub esi, edx
mov edx, dword [ebp - 0x38]
je 0x518727
mov ebx, dword [ebp - 0x24]
mov eax, dword [ebp - 0x28]
inc edi
mov esi, dword [ebp - 0x20]
cmp edi, dword [eax + 0x14]
jl 0x5186e0
mov dl, byte [ebx]
movzx eax, dl
movzx ecx, byte [eax + 0x5df308]
movzx eax, byte [0x63ce88]
movzx eax, byte [eax + 0x5df308]
sub ecx, eax
jne 0x5187ac
mov esi, 0x63ce88
sub esi, ebx
test dl, dl
je 0x518834
movzx eax, byte [esi + ebx + 1]
inc ebx
movzx ecx, byte [eax + 0x5df308]
mov dl, byte [ebx]
movzx eax, dl
movzx eax, byte [eax + 0x5df308]
sub eax, ecx
je 0x518787
mov edi, dword [ebp - 0x2c]
mov eax, dword [ebp - 0x34]
mov esi, dword [ebp - 0x20]
inc eax
mov dword [ebp - 0x34], eax
cmp eax, 4
jle 0x5186b0
mov ecx, dword [ebp - 4]
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.00462c5a
mov esp, ebp
pop ebp
ret
test esi, esi
jne 0x51874f
mov ecx, dword [ebp - 0x30]
mov ebx, dword [ebp - 0x24]
mov esi, dword [ebp - 0x20]
mov eax, dword [ebp - 0x28]
add ecx, ecx
mov eax, dword [eax + 0x10]
mov eax, dword [eax + ecx*8 + 0xc]
lea ecx, [ebp - 0x30]
push ecx
add eax, 8
push ebx
push eax
call fcn.004ff5b0
add esp, 0xc
test eax, eax
je 0x518752
cmp dword [eax + 8], 0
je 0x518752
push dword [ebp - 0x3c]
mov edi, dword [ebp - 0x2c]
lea eax, [ebp - 0x1c]
push dword [ebp - 0x40]
push eax
push esi
push 0x63c504
push edi
call fcn.00529b60
add esp, 0x18
jmp 0x5187af
mov eax, dword [ebp - 0x28]
mov esi, dword [ebp - 0x20]
mov eax, dword [eax + 0x10]
mov edx, dword [eax + 0x10]
test esi, esi
jne 0x51884a
neg edx
sbb edx, edx
jmp 0x518895
test edx, edx
je 0x5187ac
movzx eax, byte [edx]
mov edi, esi
movzx ecx, byte [eax + 0x5df308]
mov bl, byte [edi]
movzx eax, bl
movzx eax, byte [eax + 0x5df308]
sub eax, ecx
jne 0x518891
sub edx, edi
test bl, bl
je 0x518891
movzx eax, byte [edx + esi + 1]
inc esi
movzx ecx, byte [eax + 0x5df308]
mov bl, byte [esi]
movzx eax, bl
movzx eax, byte [eax + 0x5df308]
sub eax, ecx
je 0x518870
mov edx, eax
mov esi, edi
test edx, edx
jne 0x5187ac
mov eax, dword [ebp - 0x28]
mov ebx, 0x63cf14
jmp 0x5186cc