Function at 0x18006f490
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push r12
sub rsp, 0x50
mov r12, rcx
mov rcx, r9
mov rbp, r9
movzx esi, r8w
movzx edi, dx
call fcn.18004d740
test edi, edi
mov rbx, rax
mov eax, edi
js 0x18006f734
cmp eax, 1
jle 0x18006f647
cmp eax, 3
jne 0x18006f734
lea rax, [rsp + 0x30]
lea r9, [rsp + 0x38]
lea r8, [rsp + 0x40]
mov edx, 0x140
mov rcx, r12
mov qword [rsp + 0x20], rax
call fcn.1800a1ad0
mov r11, qword [rsp + 0x30]
mov rdi, qword [rsp + 0x38]
mov r10, qword [rsp + 0x40]
movzx ecx, sil
mov esi, 1
shl esi, cl
mov rdx, r11
mov r8, rdi
test esi, esi
mov r9, r10
mov ecx, esi
jle 0x18006f560
nop
nop
movzx eax, word [r9]
sub ecx, 1
add r9, 2
cmp ax, 0x100
jae 0x18006f5ab
movzx eax, word [r8]
add r8, 2
cmp ax, 0x100
jae 0x18006f5ab
movzx eax, word [rdx]
add rdx, 2
cmp ax, 0x100
jae 0x18006f5ab
test ecx, ecx
jg 0x18006f530
lea eax, [rsi - 1]
test eax, eax
movsxd r8, eax
js 0x18006f734
sub r10, rdi
lea rcx, [rdi + r8*2]
lea rdx, [rbx + r8*4 + 1]
sub r11, rdi
nop
movzx eax, byte [rcx + r10]
sub rdx, 4
sub rcx, 2
sub r8, 1
mov byte [rdx + 5], al
movzx eax, byte [rcx + 2]
mov byte [rdx + 4], al
movzx eax, byte [rcx + r11 + 2]
mov byte [rdx + 3], al
jns 0x18006f580
jmp 0x18006f734
lea eax, [rsi - 1]
test eax, eax
movsxd r8, eax
js 0x18006f734
sub r10, rdi
lea r9, [rdi + r8*2]
lea rbx, [rbx + r8*4 + 1]
sub r11, rdi
nop
nop
movzx ecx, word [r10 + r9]
mov eax, 0x80008001
sub rbx, 4
sub r9, 2
imul ecx, ecx, 0xff
imul ecx
add edx, ecx
sar edx, 0xf
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0x80008001
mov byte [rbx + 5], dl
movzx ecx, word [r9 + 2]
imul ecx, ecx, 0xff
imul ecx
add edx, ecx
sar edx, 0xf
mov eax, edx
shr eax, 0x1f
add edx, eax
mov eax, 0x80008001
mov byte [rbx + 4], dl
movzx ecx, word [r11 + r9 + 2]
imul ecx, ecx, 0xff
imul ecx
add edx, ecx
sar edx, 0xf
mov eax, edx
shr eax, 0x1f
add edx, eax
sub r8, 1
mov byte [rbx + 3], dl
jns 0x18006f5d0
jmp 0x18006f734
cmp si, 1
jne 0x18006f68a
test di, di
jne 0x18006f66e
mov byte [rbx], 0xff
mov byte [rbx + 1], 0xff
mov byte [rbx + 2], 0xff
mov byte [rbx + 4], dil
mov byte [rbx + 5], dil
mov byte [rbx + 6], dil
jmp 0x18006f734
mov byte [rbx], 0
mov byte [rbx + 1], 0
mov byte [rbx + 2], 0
mov byte [rbx + 4], 0xff
mov byte [rbx + 5], 0xff
mov byte [rbx + 6], 0xff
jmp 0x18006f734
cmp si, 4
je 0x18006f69a
cmp si, 8
jne 0x18006f734
mov rcx, rbp
call fcn.18004d700
xor r8d, r8d
cmp di, 1
mov r11d, eax
jne 0x18006f6ef
test eax, eax
jle 0x18006f734
lea ecx, [rax - 1]
mov eax, 0xff
cdq
idiv ecx
lea rcx, [rbx + 2]
mov r9d, eax
nop
nop
movzx eax, r8b
add r8d, 1
add rcx, 4
imul r9b
cmp r8d, r11d
mov byte [rcx - 6], al
mov byte [rcx - 5], al
mov byte [rcx - 4], al
jl 0x18006f6d0
jmp 0x18006f734
test eax, eax
jle 0x18006f734
lea ecx, [rax - 1]
mov eax, 0xff
cdq
idiv ecx
lea rdx, [rbx + 2]
mov r9d, eax
nop
nop
nop
movzx eax, r8b
mov ecx, 0xff
add r8d, 1
add rdx, 4
imul r9b
sub cl, al
cmp r8d, r11d
mov byte [rdx - 6], cl
mov byte [rdx - 5], cl
mov byte [rdx - 4], cl
jl 0x18006f710
mov rbx, qword [rsp + 0x60]
mov rbp, qword [rsp + 0x68]
mov rsi, qword [rsp + 0x70]
mov rdi, qword [rsp + 0x78]
add rsp, 0x50
pop r12
ret