Function at 0x1400066a0
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 0x140006828
mov ecx, dword [r9 + 4]
xor ebx, ebx
cmp ecx, 8
jne 0x14000673c
test rdx, rdx
je 0x1400066fd
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 0x1400066e0
cmp dword [r9 + 0x18], 0
je 0x1400069f9
mov rax, rdi
neg rax
lea rcx, [rsi + rax*4]
test rdi, rdi
je 0x1400069f9
nop dword [rax + rax]
movzx eax, byte [rcx]
cmp eax, dword [r9 + 0x1c]
jne 0x14000672d
mov byte [rcx + 3], 0
add rcx, 4
sub rdi, 1
jne 0x140006720
jmp 0x1400069f9
cmp ecx, 0x10
jne 0x14000678f
test rdi, rdi
je 0x1400069f9
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 0x140006779
movzx ecx, byte [r8 + rbx*2 + 1]
shl eax, 8
add ecx, eax
cmp ecx, dword [r9 + 0x1c]
jne 0x140006779
xor al, al
jmp 0x14000677b
mov al, 0xff
mov byte [rsi + 2], al
inc rbx
add rsi, 4
cmp rbx, rdi
jne 0x140006750
jmp 0x1400069f9
mov r11d, 1
mov r10, rbx
shl r11d, cl
dec r11d
test rdi, rdi
je 0x1400069f9
inc rsi
nop word [rax + rax]
mov r9d, dword [r14 + 4]
mov r8d, ebx
test r9, r9
je 0x1400067f0
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 0x1400067c0
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 0x140006814
cmp r8d, dword [r14 + 0x1c]
jne 0x140006814
xor al, al
jmp 0x140006816
mov al, 0xff
mov byte [rsi + 2], al
add rsi, 4
sub rdi, 1
jne 0x1400067b0
jmp 0x1400069f9
cmp eax, 2
jne 0x140006933
cmp dword [r9 + 4], 8
jne 0x1400068b1
test rdi, rdi
je 0x140006863
mov rbx, rdi
mov r8d, 3
mov rdx, r15
mov rcx, rsi
call fcn.140001220
mov byte [rsi + 3], 0xff
add r15, 3
add rsi, 4
sub rbx, 1
jne 0x140006840
cmp dword [r14 + 0x18], 0
je 0x1400069f9
mov rax, rdi
neg rax
lea rcx, [rsi + rax*4]
test rdi, rdi
je 0x1400069f9
movzx eax, byte [rcx]
cmp eax, dword [r14 + 0x1c]
jne 0x1400068a2
movzx eax, byte [rcx + 1]
cmp eax, dword [r14 + 0x20]
jne 0x1400068a2
movzx eax, byte [rcx + 2]
cmp eax, dword [r14 + 0x24]
jne 0x1400068a2
mov byte [rcx + 3], 0
add rcx, 4
sub rdi, 1
jne 0x140006881
jmp 0x1400069f9
test rdi, rdi
je 0x1400069f9
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 0x14000691b
mov ecx, eax
movzx eax, byte [r15 - 3]
shl ecx, 8
add ecx, eax
cmp ecx, dword [r9 + 0x1c]
jne 0x14000691b
movzx eax, byte [r15 - 1]
mov ecx, edx
shl ecx, 8
add ecx, eax
cmp ecx, dword [r9 + 0x20]
jne 0x14000691b
movzx eax, byte [r15 + 1]
mov ecx, r8d
shl ecx, 8
add ecx, eax
cmp ecx, dword [r9 + 0x24]
jne 0x14000691b
xor al, al
jmp 0x14000691d
mov al, 0xff
mov byte [rsi + 1], al
add r15, 6
add rsi, 4
sub rdi, 1
jne 0x1400068c2
jmp 0x1400069f9
cmp eax, 3
jne 0x140006a0d
xor ebx, ebx
cmp dword [r9 + 4], 8
jne 0x14000697c
test rdi, rdi
je 0x1400069f9
nop
movzx ecx, byte [r15 + rbx]
mov r8d, 4
mov rax, qword [r14 + 8]
lea rdx, [rax + rcx*4]
mov rcx, rsi
call fcn.140001220
inc rbx
add rsi, 4
cmp rbx, rdi
jne 0x140006950
jmp 0x1400069f9
mov qword [rsp + 0x40], rbp
mov rbp, rbx
test rdi, rdi
je 0x1400069f4
nop dword [rax]
mov r9d, dword [r14 + 4]
mov r8d, ebx
test r9, r9
je 0x1400069d0
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 0x1400069a0
lea edx, [r8*4]
mov rcx, rsi
add rdx, qword [r14 + 8]
mov r8d, 4
call fcn.140001220
add rsi, 4
sub rdi, 1
jne 0x140006990
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 0x140006a74
xor ebx, ebx
cmp dword [r9 + 4], 8
jne 0x140006a47
test rdi, rdi
je 0x1400069f9
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 0x140006a23
jmp 0x1400069f9
test rdi, rdi
je 0x1400069f9
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 0x140006a50
jmp 0x1400069f9
cmp eax, 6
jne 0x1400069f9
cmp dword [r9 + 4], 8
jne 0x140006a95
lea r8, [rdx*4]
mov rdx, r15
call fcn.140001220
jmp 0x1400069f9
test rdi, rdi
je 0x1400069f9
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 0x140006ab0
jmp 0x1400069f9