Function at 0x140161c80
Capabilities:
Encrypt data using rc4 prga

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rbp
mov qword [rsp + 0x18], rsi
mov qword [rsp + 0x20], rdi
push r12
push r14
push r15
sub rsp, 0x20
mov rax, qword [rdx + 0x10]
xor r10d, r10d
mov rsi, qword [rdx]
or ebp, 0xffffffff
mov rbx, rcx
mov r15, rdx
mov r8d, r10d
movsxd r14, dword [rax + 0x14]
mov r9, qword [rax]
mov dword [rcx + 0x149c], r10d
mov dword [rcx + 0x14a0], 0x23d
mov ecx, r10d
test r14d, r14d
jle 0x140161d0e
cmp word [rsi + rcx*4], r10w
je 0x140161cfd
inc dword [rbx + 0x149c]
mov ebp, r8d
movsxd rax, dword [rbx + 0x149c]
mov dword [rbx + rax*4 + 0xba8], r8d
mov byte [rcx + rbx + 0x14a4], r10b
jmp 0x140161d03
mov word [rsi + rcx*4 + 2], r10w
inc r8d
inc rcx
cmp rcx, r14
jl 0x140161cd4
cmp dword [rbx + 0x149c], 2
mov r12d, 1
jge 0x140161d72
nop dword [rax]
cmp ebp, 2
jge 0x140161d2b
inc ebp
mov ecx, ebp
jmp 0x140161d2e
mov ecx, r10d
inc dword [rbx + 0x149c]
movsxd rax, dword [rbx + 0x149c]
mov dword [rbx + rax*4 + 0xba8], ecx
movsxd rax, ecx
mov word [rsi + rax*4], r12w
mov byte [rax + rbx + 0x14a4], r10b
dec dword [rbx + 0x1700]
test r9, r9
je 0x140161d69
movzx eax, word [r9 + rax*4 + 2]
sub dword [rbx + 0x1704], eax
cmp dword [rbx + 0x149c], 2
jl 0x140161d20
mov dword [rdx + 8], ebp
mov eax, dword [rbx + 0x149c]
cdq
sub eax, edx
sar eax, 1
mov edi, eax
cmp eax, r12d
jl 0x140161da5
nop word [rax + rax]
mov r8d, edi
mov rdx, rsi
mov rcx, rbx
call fcn.140162770
dec edi
cmp edi, r12d
jge 0x140161d90
movsxd rax, dword [rbx + 0x149c]
mov r8d, r12d
movsxd rdi, dword [rbx + 0xbac]
mov rdx, rsi
mov ecx, dword [rbx + rax*4 + 0xba8]
mov dword [rbx + 0xbac], ecx
mov rcx, rbx
dec dword [rbx + 0x149c]
call fcn.140162770
movsxd rcx, dword [rbx + 0xbac]
lea r8, [rsi + rdi*4]
dec dword [rbx + 0x14a0]
mov rdx, rcx
movsxd rax, dword [rbx + 0x14a0]
movsxd r9, r14d
mov dword [rbx + rax*4 + 0xba8], edi
dec dword [rbx + 0x14a0]
movsxd rax, dword [rbx + 0x14a0]
mov dword [rbx + rax*4 + 0xba8], ecx
mov rcx, rdi
movzx eax, word [rsi + rdx*4]
add ax, word [r8]
mov word [rsi + r9*4], ax
movzx eax, byte [rdi + rbx + 0x14a4]
movzx ecx, byte [rdx + rbx + 0x14a4]
cmp al, cl
movzx eax, al
jae 0x140161e37
movzx eax, cl
inc al
mov rcx, rbx
mov byte [r9 + rbx + 0x14a4], al
mov word [rsi + rdx*4 + 2], r14w
mov rdx, rsi
mov word [r8 + 2], r14w
mov r8d, r12d
mov dword [rbx + 0xbac], r14d
inc r14d
call fcn.140162770
cmp dword [rbx + 0x149c], 2
jge 0x140161da5
dec dword [rbx + 0x14a0]
mov rdx, r15
movsxd r8, dword [rbx + 0x14a0]
mov eax, dword [rbx + 0xbac]
mov dword [rbx + r8*4 + 0xba8], eax
call fcn.140162420
lea r8, [rbx + 0xb88]
mov edx, ebp
mov rcx, rsi
mov rbx, qword [rsp + 0x40]
mov rbp, qword [rsp + 0x48]
mov rsi, qword [rsp + 0x50]
mov rdi, qword [rsp + 0x58]
add rsp, 0x20
pop r15
pop r14
pop r12
jmp 0x140162630
push rbx
sub rsp, 0x30
mov rax, qword [0x1402d9850]
xor rax, rsp
mov qword [rsp + 0x20], rax
xor ebx, ebx
lea rax, [rsp + 2]
movzx r9d, bx
sub r8, rax
mov r11, rcx
mov r10d, 1
nop dword [rax]
lea rax, [r8 + r10*2]
add r9w, word [rsp + rax]
add r9w, r9w
mov word [rsp + r10*2], r9w
inc r10
cmp r10, 0xf
jle 0x140162660
movsxd r10, edx
mov r9, rbx
test edx, edx
js 0x1401626d2
movzx edx, word [r11 + r9*4 + 2]
test edx, edx
je 0x1401626ca
lea rcx, [rsp]
movzx r8d, word [rcx + rdx*2]
lea rcx, [rcx + rdx*2]
lea eax, [r8 + 1]
mov word [rcx], ax
mov eax, ebx
nop word [rax + rax]
mov ecx, r8d
dec edx
and ecx, 1
shr r8d, 1
or eax, ecx
add eax, eax
test edx, edx
jg 0x1401626b0
shr eax, 1
mov word [r11 + r9*4], ax
inc r9
cmp r9, r10
jle 0x140162685
mov rcx, qword [rsp + 0x20]
xor rcx, rsp
call fcn.14012a1e0
add rsp, 0x30
pop rbx
ret