Function at 0x14005167e
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, 0x18
test r8d, r8d
mov esi, 0xffffffff
cmovs r8d, esi
inc r8d
je 0x140051c4f
mov r12, rcx
movzx r9d, word [rdx + 2]
xor eax, eax
test r9d, r9d
sete al
mov ebp, 0x8a
mov ecx, 7
cmove ecx, ebp
mov edi, 4
sub edi, eax
xor r15d, r15d
xor r11d, r11d
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], r8
mov r14d, r9d
movzx r9d, word [rdx + r11*4 + 6]
inc r11
lea r10d, [r15 + 1]
cmp r10d, ecx
jge 0x1400516f9
cmp r14d, r9d
jne 0x1400516f9
mov r14d, esi
jmp 0x140051c40
mov r13d, r14d
cmp r10d, edi
jge 0x1400517af
mov ecx, dword [r12 + 0x1714]
movzx ebx, word [r12 + 0x1710]
movzx esi, word [r12 + r13*4 + 0xaa6]
mov ebp, 0x10
movzx eax, word [r12 + r13*4 + 0xaa4]
mov edi, eax
shl edi, cl
sub ebp, esi
or ebx, edi
mov word [r12 + 0x1710], bx
cmp ecx, ebp
jle 0x140051797
mov rcx, qword [r12 + 0x10]
mov ebp, dword [r12 + 0x28]
lea edi, [rbp + 1]
mov dword [r12 + 0x28], edi
mov byte [rcx + rbp], bl
mov cl, byte [r12 + 0x1711]
mov rbp, qword [r12 + 0x10]
mov ebx, dword [r12 + 0x28]
lea edi, [rbx + 1]
mov dword [r12 + 0x28], edi
mov byte [rbp + rbx], cl
mov ebp, dword [r12 + 0x1714]
mov cl, 0x10
sub cl, bpl
shr eax, cl
mov word [r12 + 0x1710], ax
lea ecx, [rsi + rbp]
add ecx, 0xfffffff0
mov ebx, eax
jmp 0x140051799
add ecx, esi
mov dword [r12 + 0x1714], ecx
dec r10d
jne 0x140051716
jmp 0x140051c1a
test r14d, r14d
mov dword [rsp + 4], r9d
je 0x1400517db
cmp r14d, esi
jne 0x14005187a
mov r9d, dword [r12 + 0x1714]
movzx ebp, word [r12 + 0x1710]
mov r15d, r10d
jmp 0x1400519af
cmp r15d, 9
jg 0x14005190f
movzx edi, word [r12 + 0xaea]
mov r9d, dword [r12 + 0x1714]
mov ebp, 0x10
movzx eax, word [r12 + 0xae8]
mov esi, eax
mov ecx, r9d
shl esi, cl
sub ebp, edi
or si, word [r12 + 0x1710]
cmp r9d, ebp
jle 0x140051aca
mov word [r12 + 0x1710], si
mov rcx, qword [r12 + 0x10]
mov ebp, dword [r12 + 0x28]
lea ebx, [rbp + 1]
mov dword [r12 + 0x28], ebx
mov byte [rcx + rbp], sil
mov cl, byte [r12 + 0x1711]
mov rbp, qword [r12 + 0x10]
mov ebx, dword [r12 + 0x28]
lea esi, [rbx + 1]
mov dword [r12 + 0x28], esi
mov byte [rbp + rbx], cl
mov ebp, dword [r12 + 0x1714]
mov cl, 0x10
sub cl, bpl
shr eax, cl
lea r9d, [rdi + rbp]
add r9d, 0xfffffff0
mov esi, eax
jmp 0x140051acd
movzx esi, word [r12 + r13*4 + 0xaa6]
mov r9d, dword [r12 + 0x1714]
mov ebx, 0x10
sub ebx, esi
movzx eax, word [r12 + r13*4 + 0xaa4]
mov ebp, eax
mov ecx, r9d
shl ebp, cl
or bp, word [r12 + 0x1710]
mov word [r12 + 0x1710], bp
cmp r9d, ebx
jle 0x1400519a4
mov rcx, qword [r12 + 0x10]
mov ebx, dword [r12 + 0x28]
lea edi, [rbx + 1]
mov dword [r12 + 0x28], edi
mov byte [rcx + rbx], bpl
mov cl, byte [r12 + 0x1711]
mov rbp, qword [r12 + 0x10]
mov ebx, dword [r12 + 0x28]
lea edi, [rbx + 1]
mov dword [r12 + 0x28], edi
mov byte [rbp + rbx], cl
mov ebp, dword [r12 + 0x1714]
mov cl, 0x10
sub cl, bpl
shr eax, cl
lea r9d, [rsi + rbp]
add r9d, 0xfffffff0
mov ebp, eax
jmp 0x1400519a7
movzx edi, word [r12 + 0xaee]
mov r9d, dword [r12 + 0x1714]
mov ebp, 0x10
movzx eax, word [r12 + 0xaec]
mov esi, eax
mov ecx, r9d
shl esi, cl
sub ebp, edi
or si, word [r12 + 0x1710]
cmp r9d, ebp
jle 0x140051b51
mov word [r12 + 0x1710], si
mov rcx, qword [r12 + 0x10]
mov ebp, dword [r12 + 0x28]
lea ebx, [rbp + 1]
mov dword [r12 + 0x28], ebx
mov byte [rcx + rbp], sil
mov cl, byte [r12 + 0x1711]
mov rbp, qword [r12 + 0x10]
mov ebx, dword [r12 + 0x28]
lea esi, [rbx + 1]
mov dword [r12 + 0x28], esi
mov byte [rbp + rbx], cl
mov ebp, dword [r12 + 0x1714]
mov cl, 0x10
sub cl, bpl
shr eax, cl
lea r9d, [rdi + rbp]
add r9d, 0xfffffff0
mov esi, eax
jmp 0x140051b54
add r9d, esi
mov dword [r12 + 0x1714], r9d
movzx esi, word [r12 + 0xae6]
movzx ebx, word [r12 + 0xae4]
mov eax, ebx
mov ecx, r9d
shl eax, cl
mov ecx, 0x10
sub ecx, esi
or ebp, eax
cmp r9d, ecx
jle 0x140051a2c
mov word [r12 + 0x1710], bp
mov rax, qword [r12 + 0x10]
mov ecx, dword [r12 + 0x28]
lea edi, [rcx + 1]
mov dword [r12 + 0x28], edi
mov byte [rax + rcx], bpl
mov al, byte [r12 + 0x1711]
mov rcx, qword [r12 + 0x10]
mov ebp, dword [r12 + 0x28]
lea edi, [rbp + 1]
mov dword [r12 + 0x28], edi
mov byte [rcx + rbp], al
mov eax, dword [r12 + 0x1714]
mov cl, 0x10
sub cl, al
shr ebx, cl
lea r9d, [rsi + rax]
add r9d, 0xfffffff0
mov ebp, ebx
jmp 0x140051a2f
add r9d, esi
mov dword [r12 + 0x1714], r9d
add r15d, 0xfffd
cmp r9d, 0xf
jl 0x140051aaf
movzx eax, r15w
mov ecx, r9d
shl r15d, cl
or ebp, r15d
mov word [r12 + 0x1710], bp
mov rcx, qword [r12 + 0x10]
mov ebx, dword [r12 + 0x28]
lea edi, [rbx + 1]
mov dword [r12 + 0x28], edi
mov byte [rcx + rbx], bpl
mov cl, byte [r12 + 0x1711]
mov rbp, qword [r12 + 0x10]
mov ebx, dword [r12 + 0x28]
lea edi, [rbx + 1]
mov dword [r12 + 0x28], edi
mov byte [rbp + rbx], cl
mov r9d, dword [r12 + 0x1714]
mov cl, 0x10
sub cl, r9b
shr eax, cl
mov word [r12 + 0x1710], ax
add r9d, 0xfffffff2
jmp 0x140051c03
mov ecx, r9d
shl r15d, cl
or ebp, r15d
mov word [r12 + 0x1710], bp
add r9d, 2
jmp 0x140051c03
add r9d, edi
mov dword [r12 + 0x1714], r9d
add r15d, 0xfffe
cmp r9d, 0xe
jl 0x140051bd5
movzx eax, r15w
mov ecx, r9d
shl r15d, cl
or esi, r15d
mov word [r12 + 0x1710], si
mov rcx, qword [r12 + 0x10]
mov ebp, dword [r12 + 0x28]
lea ebx, [rbp + 1]
mov dword [r12 + 0x28], ebx
mov byte [rcx + rbp], sil
mov cl, byte [r12 + 0x1711]
mov rbp, qword [r12 + 0x10]
mov ebx, dword [r12 + 0x28]
lea edi, [rbx + 1]
mov dword [r12 + 0x28], edi
mov byte [rbp + rbx], cl
mov r9d, dword [r12 + 0x1714]
mov cl, 0x10
sub cl, r9b
shr eax, cl
mov word [r12 + 0x1710], ax
add r9d, 0xfffffff3
jmp 0x140051c03
add r9d, edi
mov dword [r12 + 0x1714], r9d
add r15d, 0xfff6
cmp r9d, 0xa
jl 0x140051bed
movzx eax, r15w
mov ecx, r9d
shl r15d, cl
or esi, r15d
mov word [r12 + 0x1710], si
mov rcx, qword [r12 + 0x10]
mov ebp, dword [r12 + 0x28]
lea ebx, [rbp + 1]
mov dword [r12 + 0x28], ebx
mov byte [rcx + rbp], sil
mov cl, byte [r12 + 0x1711]
mov rbp, qword [r12 + 0x10]
mov ebx, dword [r12 + 0x28]
lea edi, [rbx + 1]
mov dword [r12 + 0x28], edi
mov byte [rbp + rbx], cl
mov r9d, dword [r12 + 0x1714]
mov cl, 0x10
sub cl, r9b
shr eax, cl
mov word [r12 + 0x1710], ax
add r9d, 0xfffffff7
jmp 0x140051c03
mov ecx, r9d
shl r15d, cl
or esi, r15d
mov word [r12 + 0x1710], si
add r9d, 3
jmp 0x140051c03
mov ecx, r9d
shl r15d, cl
or esi, r15d
mov word [r12 + 0x1710], si
add r9d, 7
mov dword [r12 + 0x1714], r9d
mov rdx, qword [rsp + 0x10]
mov r8, qword [rsp + 8]
mov r9d, dword [rsp + 4]
xor r10d, r10d
test r9d, r9d
je 0x140051c36
xor ecx, ecx
cmp r14d, r9d
sete cl
mov edi, 4
sub edi, ecx
xor ecx, 7
jmp 0x140051c40
mov ecx, 0x8a
mov edi, 3
mov esi, r14d
mov r15d, r10d
cmp r11, r8
jne 0x1400516d7
add rsp, 0x18
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret