Function at 0x140006560
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rdi
push r14
push r15
sub rsp, 0x20
mov eax, dword [r9]
mov r14, r9
mov r15, r8
mov rdi, rdx
mov rsi, rcx
test eax, eax
jne 0x1400066e8
mov ecx, dword [r9 + 4]
xor ebx, ebx
cmp ecx, 8
jne 0x1400065fc
test rdx, rdx
je 0x1400065bd
nop word [rax + rax]
movzx eax, byte [r8 + rbx]
inc rbx
mov byte [rsi + 2], al
mov byte [rsi + 1], al
mov byte [rsi], al
mov byte [rsi + 3], 0xff
add rsi, 4
cmp rbx, rdi
jne 0x1400065a0
cmp dword [r9 + 0x18], 0
je 0x1400068b9
mov rax, rdi
neg rax
lea rcx, [rsi + rax*4]
test rdi, rdi
je 0x1400068b9
nop dword [rax + rax]
movzx eax, byte [rcx]
cmp eax, dword [r9 + 0x1c]
jne 0x1400065ed
mov byte [rcx + 3], 0
add rcx, 4
sub rdi, 1
jne 0x1400065e0
jmp 0x1400068b9
cmp ecx, 0x10
jne 0x14000664f
test rdi, rdi
je 0x1400068b9
inc rsi
nop dword [rax]
movzx eax, byte [r8 + rbx*2]
mov byte [rsi + 1], al
mov byte [rsi], al
mov byte [rsi - 1], al
cmp dword [r9 + 0x18], 0
je 0x140006639
movzx ecx, byte [r8 + rbx*2 + 1]
shl eax, 8
add ecx, eax
cmp ecx, dword [r9 + 0x1c]
jne 0x140006639
xor al, al
jmp 0x14000663b
mov al, 0xff
mov byte [rsi + 2], al
inc rbx
add rsi, 4
cmp rbx, rdi
jne 0x140006610
jmp 0x1400068b9
mov r11d, 1
mov r10, rbx
shl r11d, cl
dec r11d
test rdi, rdi
je 0x1400068b9
inc rsi
nop word [rax + rax]
mov r9d, dword [r14 + 4]
mov r8d, ebx
test r9, r9
je 0x1400066b0
nop dword [rax]
movzx eax, r10b
add r8d, r8d
and al, 7
mov ecx, 7
sub cl, al
mov rax, r10
shr rax, 3
inc r10
movzx edx, byte [rax + r15]
shr dl, cl
and dl, 1
movzx eax, dl
or r8d, eax
sub r9, 1
jne 0x140006680
imul eax, r8d, 0xff
xor edx, edx
div r11d
mov byte [rsi + 1], al
mov byte [rsi], al
mov byte [rsi - 1], al
cmp dword [r14 + 0x18], ebx
je 0x1400066d4
cmp r8d, dword [r14 + 0x1c]
jne 0x1400066d4
xor al, al
jmp 0x1400066d6
mov al, 0xff
mov byte [rsi + 2], al
add rsi, 4
sub rdi, 1
jne 0x140006670
jmp 0x1400068b9
cmp eax, 2
jne 0x1400067f3
cmp dword [r9 + 4], 8
jne 0x140006771
test rdi, rdi
je 0x140006723
mov rbx, rdi
mov r8d, 3
mov rdx, r15
mov rcx, rsi
call fcn.1400011f0
mov byte [rsi + 3], 0xff
add r15, 3
add rsi, 4
sub rbx, 1
jne 0x140006700
cmp dword [r14 + 0x18], 0
je 0x1400068b9
mov rax, rdi
neg rax
lea rcx, [rsi + rax*4]
test rdi, rdi
je 0x1400068b9
movzx eax, byte [rcx]
cmp eax, dword [r14 + 0x1c]
jne 0x140006762
movzx eax, byte [rcx + 1]
cmp eax, dword [r14 + 0x20]
jne 0x140006762
movzx eax, byte [rcx + 2]
cmp eax, dword [r14 + 0x24]
jne 0x140006762
mov byte [rcx + 3], 0
add rcx, 4
sub rdi, 1
jne 0x140006741
jmp 0x1400068b9
test rdi, rdi
je 0x1400068b9
add rsi, 2
add r15, 4
movzx eax, byte [r15 - 4]
movzx edx, byte [r15 - 2]
movzx r8d, byte [r15]
mov byte [rsi - 2], al
mov byte [rsi - 1], dl
mov byte [rsi], r8b
cmp dword [r9 + 0x18], 0
je 0x1400067db
mov ecx, eax
movzx eax, byte [r15 - 3]
shl ecx, 8
add ecx, eax
cmp ecx, dword [r9 + 0x1c]
jne 0x1400067db
movzx eax, byte [r15 - 1]
mov ecx, edx
shl ecx, 8
add ecx, eax
cmp ecx, dword [r9 + 0x20]
jne 0x1400067db
movzx eax, byte [r15 + 1]
mov ecx, r8d
shl ecx, 8
add ecx, eax
cmp ecx, dword [r9 + 0x24]
jne 0x1400067db
xor al, al
jmp 0x1400067dd
mov al, 0xff
mov byte [rsi + 1], al
add r15, 6
add rsi, 4
sub rdi, 1
jne 0x140006782
jmp 0x1400068b9
cmp eax, 3
jne 0x1400068cd
xor ebx, ebx
cmp dword [r9 + 4], 8
jne 0x14000683c
test rdi, rdi
je 0x1400068b9
nop
movzx ecx, byte [r15 + rbx]
mov r8d, 4
mov rax, qword [r14 + 8]
lea rdx, [rax + rcx*4]
mov rcx, rsi
call fcn.1400011f0
inc rbx
add rsi, 4
cmp rbx, rdi
jne 0x140006810
jmp 0x1400068b9
mov qword [rsp + 0x40], rbp
mov rbp, rbx
test rdi, rdi
je 0x1400068b4
nop dword [rax]
mov r9d, dword [r14 + 4]
mov r8d, ebx
test r9, r9
je 0x140006890
nop dword [rax]
movzx eax, bpl
add r8d, r8d
and al, 7
mov ecx, 7
sub cl, al
mov rax, rbp
shr rax, 3
inc rbp
movzx edx, byte [rax + r15]
shr dl, cl
and dl, 1
movzx eax, dl
or r8d, eax
sub r9, 1
jne 0x140006860
lea edx, [r8*4]
mov rcx, rsi
add rdx, qword [r14 + 8]
mov r8d, 4
call fcn.1400011f0
add rsi, 4
sub rdi, 1
jne 0x140006850
mov rbp, qword [rsp + 0x40]
mov rbx, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
add rsp, 0x20
pop r15
pop r14
pop rdi
ret
cmp eax, 4
jne 0x140006934
xor ebx, ebx
cmp dword [r9 + 4], 8
jne 0x140006907
test rdi, rdi
je 0x1400068b9
inc rsi
movzx eax, byte [r8 + rbx*2]
mov byte [rsi + 1], al
mov byte [rsi], al
mov byte [rsi - 1], al
lea rsi, [rsi + 4]
movzx eax, byte [r8 + rbx*2 + 1]
inc rbx
mov byte [rsi - 2], al
cmp rbx, rdi
jne 0x1400068e3
jmp 0x1400068b9
test rdi, rdi
je 0x1400068b9
inc rsi
nop
movzx eax, byte [r8 + rbx*4]
mov byte [rsi + 1], al
mov byte [rsi], al
mov byte [rsi - 1], al
lea rsi, [rsi + 4]
movzx eax, byte [r8 + rbx*4 + 2]
inc rbx
mov byte [rsi - 2], al
cmp rbx, rdi
jne 0x140006910
jmp 0x1400068b9
cmp eax, 6
jne 0x1400068b9
cmp dword [r9 + 4], 8
jne 0x140006955
lea r8, [rdx*4]
mov rdx, r15
call fcn.1400011f0
jmp 0x1400068b9
test rdi, rdi
je 0x1400068b9
add rsi, 2
add r15, 4
nop word [rax + rax]
movzx eax, byte [r15 - 4]
lea r15, [r15 + 8]
mov byte [rsi - 2], al
lea rsi, [rsi + 4]
movzx eax, byte [r15 - 0xa]
mov byte [rsi - 5], al
movzx eax, byte [r15 - 8]
mov byte [rsi - 4], al
movzx eax, byte [r15 - 6]
mov byte [rsi - 3], al
sub rdi, 1
jne 0x140006970
jmp 0x1400068b9