Function at 0x5650b4
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x38
mov r12, rdx
mov rbx, rcx
lea r14, [rsp + 0x28]
mov esi, 1
xor edi, edi
mov rcx, r14
mov edx, 1
xor r8d, r8d
call fcn.00564cc2
mov eax, dword [r14 + 8]
not eax
or eax, 0xfffffdff
cmp eax, 0xffffffff
je 0x565108
mov rcx, rbx
mov rdx, r12
call fcn.00564d24
mov esi, eax
jmp 0x56538c
cmp r12, 0x15b0
mov r14, rbx
jl 0x565244
xor edi, edi
mov esi, 1
xor r15d, r15d
mov qword [rsp + 0x20], r12
mov r12d, 0x2b6
xor ebp, ebp
mov r13, r14
movzx r14d, byte [r14 + r15]
add r14d, esi
mov rsi, r15
inc rsi
jno 0x565147
call fcn.005463cd
add edi, r14d
movzx esi, byte [r13 + rsi]
add esi, r14d
mov rbx, r15
add rbx, 2
jno 0x565161
call fcn.005463cd
add edi, esi
mov r14, r13
movzx ebx, byte [r13 + rbx]
add ebx, esi
mov rsi, r15
add rsi, 3
jno 0x56517c
call fcn.005463cd
add edi, ebx
movzx esi, byte [r14 + rsi]
add esi, ebx
mov rbx, r15
add rbx, 4
jno 0x565193
call fcn.005463cd
add edi, esi
movzx ebx, byte [r14 + rbx]
add ebx, esi
mov rsi, r15
add rsi, 5
jno 0x5651aa
call fcn.005463cd
add edi, ebx
movzx esi, byte [r14 + rsi]
add esi, ebx
mov rbx, r15
add rbx, 6
jno 0x5651c1
call fcn.005463cd
add edi, esi
movzx ebx, byte [r14 + rbx]
add ebx, esi
mov rsi, r15
add rsi, 7
jno 0x5651d8
call fcn.005463cd
add edi, ebx
movzx esi, byte [r14 + rsi]
add esi, ebx
add r15, 8
jno 0x5651ec
call fcn.005463cd
add edi, esi
inc rbp
dec r12
jne 0x56512f
mov rdx, qword [rsp + 0x20]
lea rax, [rdx - 0x15b0]
mov ecx, esi
mov ebp, 0x80078071
imul rcx, rbp
shr rcx, 0x2f
imul ecx, ecx, 0xfff1
sub esi, ecx
mov ecx, edi
imul rcx, rbp
shr rcx, 0x2f
imul ecx, ecx, 0xfff1
sub edi, ecx
cmp rdx, 0x2b5f
mov r12, rax
jg 0x565122
mov r12, rax
jmp 0x565247
xor r15d, r15d
cmp r12, 8
jl 0x565318
movzx ebp, byte [r14 + r15]
add ebp, esi
mov rbx, r15
inc rbx
jno 0x565265
call fcn.005463cd
add edi, ebp
movzx ebx, byte [r14 + rbx]
add ebx, ebp
mov rsi, r15
add rsi, 2
jno 0x56527c
call fcn.005463cd
add edi, ebx
movzx esi, byte [r14 + rsi]
add esi, ebx
mov rbx, r15
add rbx, 3
jno 0x565293
call fcn.005463cd
add edi, esi
movzx ebx, byte [r14 + rbx]
add ebx, esi
mov rsi, r15
add rsi, 4
jno 0x5652aa
call fcn.005463cd
add edi, ebx
movzx esi, byte [r14 + rsi]
add esi, ebx
mov rbx, r15
add rbx, 5
jno 0x5652c1
call fcn.005463cd
add edi, esi
movzx ebp, byte [r14 + rbx]
add ebp, esi
mov rsi, r15
add rsi, 6
jno 0x5652d8
call fcn.005463cd
add edi, ebp
movzx ebx, byte [r14 + rsi]
add ebx, ebp
mov rsi, r15
add rsi, 7
jno 0x5652ef
call fcn.005463cd
add edi, ebx
add r12, 0xfffffffffffffff8
movzx esi, byte [r14 + rsi]
add esi, ebx
add r15, 8
jno 0x565307
call fcn.005463cd
add edi, esi
lea rax, [r12 + 8]
cmp rax, 0xf
jg 0x565251
test r12, r12
jle 0x56533d
xor ebx, ebx
mov rbp, r15
add rbp, rbx
jno 0x56532c
call fcn.005463cd
movzx eax, byte [r14 + rbp]
add esi, eax
add edi, esi
inc rbx
cmp r12, rbx
jne 0x56531f
mov eax, esi
mov ecx, 0x80078071
imul rax, rcx
shr rax, 0x2f
imul eax, eax, 0xfff1
sub esi, eax
mov eax, edi
imul rax, rcx
shr rax, 0x2f
imul eax, eax, 0xfff1
sub edi, eax
shl edi, 0x10
mov eax, edi
not eax
mov ecx, esi
not ecx
mov edx, 0x516df973
and eax, edx
and edi, 0xae920000
or edi, eax
and ecx, edx
and esi, 0x68c
or esi, ecx
xor esi, edi
mov eax, esi
add rsp, 0x38
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret