Function at 0x14018bda0
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
push rbx
push r12
push r13
sub rsp, 0x10
mov r13, rcx
xor r12d, r12d
mov rcx, qword [rcx]
mov rbx, rdx
cmp dword [r13 + 0x14], r12d
jle 0x14018c086
mov qword [rsp + 0x38], rbp
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x48], rdi
mov qword [rsp + 8], r14
mov qword [rsp], r15
nop dword [rax + rax]
movsxd rax, dword [r13 + 0x1c]
mov rsi, rcx
mov r15d, dword [rsi]
lea rcx, [rcx + rax*4]
dec r15d
mov qword [rsp + 0x30], rcx
test r15d, r15d
jle 0x14018c061
mov rdx, qword [rbx]
add rsi, 4
mov r8d, dword [r13 + 0xc]
xor r9d, r9d
add r8d, r12d
mov eax, dword [rdx + 0xc]
mov r10d, dword [rsi]
imul eax, r8d
sub r8d, dword [rbx + 0x18]
movsxd rcx, eax
mov eax, r8d
add rcx, qword [rdx]
cdq
mov qword [rbx + 0x20], rcx
mov rcx, qword [rbx + 8]
idiv dword [rcx + 0x18]
imul edx, dword [rcx + 0xc]
movsxd rax, edx
add rax, qword [rcx]
sub r15d, 1
mov qword [rbx + 0x28], rax
js 0x14018bfe9
nop dword [rax + rax]
mov ebp, dword [rsi + 4]
lea rsi, [rsi + 8]
mov r14d, dword [rsi]
mov ecx, r10d
mov r11d, r14d
sar ecx, 8
sar r11d, 8
cmp r11d, ecx
jne 0x14018be7d
mov eax, r14d
sub eax, r10d
imul eax, ebp
add r9d, eax
jmp 0x14018bfdc
movzx eax, r10b
mov edi, 0x100
sub edi, eax
imul edi, ebp
add edi, r9d
sar edi, 8
test edi, edi
jle 0x14018befe
mov r8, qword [rbx + 8]
mov rax, qword [rbx]
mov r9d, dword [rbx + 0x14]
mov edx, dword [rax + 0x10]
mov rax, qword [rbx + 0x20]
imul edx, ecx
movsxd r10, edx
add r10, rax
mov eax, ecx
sub eax, r9d
cdq
idiv dword [r8 + 0x14]
mov rax, qword [rbx + 0x28]
imul edx, dword [r8 + 0x10]
movsxd r8, edx
mov edx, 0x100
movzx r9d, byte [r8 + rax]
mov eax, dword [rbx + 0x10]
cmp edi, 0xff
jge 0x14018bee1
imul eax, edi
sar eax, 8
inc eax
imul r9d, eax
movzx eax, byte [r10]
shr r9d, 8
sub edx, r9d
imul edx, eax
sar edx, 8
add dl, r9b
mov byte [r10], dl
test ebp, ebp
jle 0x14018bfd4
inc ecx
sub r11d, ecx
test r11d, r11d
jle 0x14018bfd4
mov rax, qword [rbx]
movsxd rdx, dword [rax + 0x10]
mov eax, edx
imul eax, ecx
sub ecx, dword [rbx + 0x14]
movsxd r9, eax
mov eax, dword [rbx + 0x10]
add r9, qword [rbx + 0x20]
imul eax, ebp
sar eax, 8
cmp eax, 0xfe
jge 0x14018bf8e
lea r10d, [rax + 1]
mov rdi, rdx
mov r8, qword [rbx + 8]
mov eax, ecx
cdq
inc ecx
dec r11d
idiv dword [r8 + 0x14]
mov eax, dword [r8 + 0x10]
imul eax, edx
movsxd rdx, eax
mov rax, qword [rbx + 0x28]
movzx r8d, byte [rdx + rax]
mov edx, 0x100
movzx eax, byte [r9]
imul r8d, r10d
shr r8d, 8
sub edx, r8d
imul edx, eax
sar edx, 8
add dl, r8b
mov byte [r9], dl
add r9, rdi
test r11d, r11d
jg 0x14018bf41
jmp 0x14018bfd4
mov r10, rdx
mov r8, qword [rbx + 8]
mov eax, ecx
cdq
inc ecx
dec r11d
idiv dword [r8 + 0x14]
mov eax, dword [r8 + 0x10]
imul eax, edx
movsxd rdx, eax
mov rax, qword [rbx + 0x28]
movzx r8d, byte [rdx + rax]
mov edx, 0x100
movzx eax, byte [r9]
sub edx, r8d
imul edx, eax
sar edx, 8
add dl, r8b
mov byte [r9], dl
add r9, r10
test r11d, r11d
jg 0x14018bf91
movzx r9d, r14b
imul r9d, ebp
sub r15d, 1
mov r10d, r14d
jns 0x14018be50
sar r9d, 8
test r9d, r9d
jle 0x14018c05c
mov rcx, qword [rbx]
mov rdx, qword [rbx + 0x20]
mov r11d, dword [rbx + 0x14]
sar r10d, 8
mov eax, dword [rcx + 0x10]
mov rcx, qword [rbx + 8]
imul eax, r10d
sub r10d, r11d
movsxd r8, eax
mov eax, r10d
add r8, rdx
cdq
idiv dword [rcx + 0x14]
mov rax, qword [rbx + 0x28]
imul edx, dword [rcx + 0x10]
movsxd rcx, edx
movzx edx, byte [rcx + rax]
mov ecx, 0x100
mov eax, dword [rbx + 0x10]
cmp r9d, 0xff
jge 0x14018c043
imul eax, r9d
sar eax, 8
inc eax
imul edx, eax
movzx eax, byte [r8]
shr edx, 8
sub ecx, edx
imul ecx, eax
sar ecx, 8
add cl, dl
mov byte [r8], cl
mov rcx, qword [rsp + 0x30]
inc r12d
cmp r12d, dword [r13 + 0x14]
jl 0x14018bde0
mov r15, qword [rsp]
mov r14, qword [rsp + 8]
mov rdi, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x40]
mov rbp, qword [rsp + 0x38]
add rsp, 0x10
pop r13
pop r12
pop rbx
ret