Function at 0x140017eb0
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, 0xd8
mov rbx, rcx
mov qword [rsp + 0x20], 1
lea r9, [0x1400cf9c2]
lea r14, [rsp + 0x70]
mov rcx, r14
mov qword [rsp + 0x40], rdx
mov qword [rsp + 0x48], r8
call fcn.1400082a8
cmp qword [r14], 0
je 0x140018088
mov qword [rsp + 0x30], rbx
mov rsi, qword [rsp + 0xa8]
mov r11, qword [rsp + 0xb8]
mov rdx, qword [rsp + 0xc0]
mov r8, qword [rsp + 0xc8]
mov r9, qword [rsp + 0xd0]
mov r12, qword [rsp + 0xa0]
mov rcx, qword [rsp + 0x90]
mov r10, qword [rsp + 0x80]
mov rax, qword [rsp + 0x88]
mov qword [rsp + 0x38], rax
mov r15, qword [rsp + 0xb0]
mov rax, r9
not rax
mov qword [rsp + 0x68], rax
add rax, r11
mov qword [rsp + 0x60], rax
mov rax, r11
sub rax, r9
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x50], r11
mov qword [rsp + 0x28], r10
cmp r10, r15
mov rax, r15
cmovb rax, r10
cmp rsi, 0xffffffffffffffff
cmove rax, r10
cmove r15, r9
lea rbx, [rax - 1]
mov r14, r12
sub r14, r9
cmp r14, rdx
jae 0x1400181c6
movzx r10d, byte [r11 + r14]
bt rcx, r10
jae 0x14001800a
mov r11, rsi
mov r10, qword [rsp + 0x60]
lea rbp, [r10 + r12]
mov r10, qword [rsp + 0x68]
add r10, r12
mov rdi, rax
mov rsi, rax
sub rsi, 1
jb 0x140018015
cmp rbx, r9
jae 0x1400181e8
lea r13, [r10 + rdi]
cmp r13, rdx
jae 0x1400181e8
mov r13b, byte [r8 + rdi - 1]
cmp r13b, byte [rbp + rdi]
mov rdi, rsi
je 0x140017fc7
add r12, rsi
sub r12, qword [rsp + 0x28]
mov rsi, r11
cmp r11, 0xffffffffffffffff
mov r11, qword [rsp + 0x50]
je 0x140017f93
jmp 0x14001807b
mov r12, r14
cmp rsi, 0xffffffffffffffff
je 0x140017f93
jmp 0x140018078
mov r10, qword [rsp + 0x58]
add r10, r12
mov rsi, qword [rsp + 0x28]
cmp rsi, r15
jae 0x14001818a
cmp rsi, r9
jae 0x1400181e8
lea rdi, [r14 + rsi]
cmp rdi, rdx
jae 0x1400181e8
mov dil, byte [r8 + rsi]
lea rbp, [rsi + 1]
cmp dil, byte [r10 + rsi]
mov rsi, rbp
je 0x140018022
sub r12, qword [rsp + 0x38]
mov rsi, r11
cmp r11, 0xffffffffffffffff
mov r11, qword [rsp + 0x50]
je 0x140017f93
mov r15, qword [rsp + 0x38]
mov r10, qword [rsp + 0x28]
jmp 0x140017f79
mov r12, r14
mov r15, r9
mov r10, qword [rsp + 0x28]
jmp 0x140017f79
mov bpl, byte [rsp + 0x8a]
mov r15, qword [rsp + 0xb8]
mov r12, qword [rsp + 0xc0]
mov sil, byte [rsp + 0x89]
mov r14, qword [rsp + 0x80]
test bpl, bpl
jne 0x1400181cf
mov eax, esi
xor al, 1
mov byte [rsp + 0x89], al
mov rcx, r15
mov rdx, r12
mov r8, r14
call fcn.140022fed
test rdx, rdx
je 0x140018180
movzx ecx, byte [rax + rdx - 1]
test cl, cl
jns 0x14001812f
movzx r8d, byte [rax + rdx - 2]
cmp r8b, 0xc0
jge 0x140018110
movzx r9d, byte [rax + rdx - 3]
cmp r9b, 0xc0
jge 0x140018116
movzx eax, byte [rax + rdx - 4]
and eax, 7
shl eax, 6
and r9d, 0x3f
or r9d, eax
jmp 0x14001811a
and r8d, 0x1f
jmp 0x140018125
and r9d, 0xf
shl r9d, 6
and r8d, 0x3f
or r8d, r9d
shl r8d, 6
and ecx, 0x3f
or ecx, r8d
test sil, sil
jne 0x140018185
cmp ecx, 0x110000
je 0x1400181cf
mov rax, 0xffffffffffffffff
cmp ecx, 0x80
jb 0x14001816d
mov rax, 0xfffffffffffffffe
cmp ecx, 0x800
jb 0x14001816d
xor eax, eax
cmp ecx, 0x10000
setb al
or rax, 0xfffffffffffffffc
add r14, rax
mov qword [rsp + 0x80], r14
mov sil, 1
jmp 0x1400180b0
test sil, sil
je 0x1400181cf
mov qword [rsp + 0x30], rbx
mov rdx, qword [rsp + 0x48]
mov rcx, qword [rsp + 0x40]
inc r14
mov r8, r14
call fcn.14006d541
mov rdi, rax
mov rbx, rdx
mov rcx, rax
call fcn.140008842
test al, 1
jne 0x1400181c6
shr eax, 0x10
mov rcx, qword [rsp + 0x30]
mov qword [rcx + 8], rbx
mov rbx, rcx
mov word [rcx + 0x10], ax
jmp 0x1400181d1
xor edi, edi
mov rbx, qword [rsp + 0x30]
jmp 0x1400181d1
xor edi, edi
mov qword [rbx], rdi
add rsp, 0xd8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
ud2