Function at 0x180089db0
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, 0xb8
mov rsi, rdx
mov qword [rsp + 0x38], rcx
mov rcx, qword [rdx + 0x20]
mov rdx, qword [rdx + 0x28]
mov qword [rsp + 0x28], r8
call fcn.18008a1a0
mov rcx, qword [rsi]
mov qword [rsp + 0x30], rsi
mov rdx, qword [rsi + 8]
mov r8, rax
shr r8, 0x39
movd xmm0, r8d
punpcklbw xmm0, xmm0
pshuflw xmm0, xmm0, 0
pshufd xmm0, xmm0, 0
lea r8, [rcx - 0x50]
mov qword [rsp + 0x58], r8
xor r8d, r8d
mov qword [rsp + 0x48], r8
pcmpeqd xmm1, xmm1
mov qword [rsp + 0x40], rcx
and rax, rdx
movdqu xmm2, xmmword [rcx + rax]
movdqa xmm3, xmm0
pcmpeqb xmm3, xmm2
pmovmskb r8d, xmm3
test r8d, r8d
je 0x18008a000
mov rcx, qword [rsp + 0x28]
movzx r9d, byte [rcx]
mov qword [rsp + 0x50], r9
jmp 0x180089e75
test r10b, r10b
je 0x18008a19a
lea r8d, [r14 - 1]
and r8d, r14d
test r8w, r8w
mov rdx, rax
mov rax, r11
mov r9, qword [rsp + 0x50]
je 0x18008a000
mov r14d, r8d
tzcnt r15d, r14d
mov r11, rax
add r15, rax
mov rax, rdx
and r15, rdx
mov r8, r15
neg r8
lea r8, [r8 + r8*4]
shl r8, 4
mov rcx, qword [rsp + 0x58]
lea r12, [rcx + r8]
cmp r9d, 1
je 0x180089f40
cmp r9d, 2
jne 0x18008a19a
movzx r10d, byte [r12]
cmp r10b, 2
jne 0x180089e50
mov rcx, qword [rsp + 0x28]
mov r10, qword [rcx + 8]
mov rdi, qword [r10 + 0x10]
mov rsi, qword [r12 + 8]
cmp rdi, qword [rsi + 0x10]
jne 0x180089e59
mov rbp, qword [r10 + 8]
mov rsi, qword [rsi + 8]
mov r13, rdi
neg r13
mov r10, 0xffffffffffffffff
nop dword [rax]
lea rcx, [r10 + r13]
cmp rcx, 0xffffffffffffffff
je 0x180089f80
movzx ecx, byte [rbp + r10 + 1]
movzx ebx, byte [rsi + r10 + 1]
lea r9d, [rcx - 0x41]
cmp r9b, 0x1a
setb r9b
shl r9b, 5
lea edx, [rbx - 0x41]
cmp dl, 0x1a
setb dl
shl dl, 5
or r9b, cl
or dl, bl
inc r10
cmp r9b, dl
je 0x180089ef0
cmp r10, rdi
jb 0x180089e59
jmp 0x180089f80
movzx r10d, byte [r12]
cmp r10b, 1
jne 0x180089e50
mov rcx, qword [rsp + 0x28]
cmp byte [rcx + 1], 0
movzx r10d, byte [r12 + 1]
je 0x180089f6a
test r10b, r10b
jne 0x180089f80
jmp 0x180089e59
test r10b, r10b
jne 0x180089e59
nop word cs:[rax + rax]
mov rcx, qword [rsp + 0x28]
mov r13, qword [rcx + 0x20]
cmp r13, qword [r12 + 0x20]
jne 0x180089e59
mov rcx, qword [rsp + 0x28]
mov rbp, qword [rcx + 0x18]
mov rsi, qword [r12 + 0x18]
mov rdi, r13
neg rdi
mov r10, 0xffffffffffffffff
nop
lea rcx, [rdi + r10]
cmp rcx, 0xffffffffffffffff
je 0x18008a031
movzx ecx, byte [rbp + r10 + 1]
movzx edx, byte [rsi + r10 + 1]
lea r9d, [rcx - 0x41]
cmp r9b, 0x1a
setb r9b
shl r9b, 5
lea ebx, [rdx - 0x41]
cmp bl, 0x1a
setb bl
shl bl, 5
or r9b, cl
or bl, dl
inc r10
cmp r9b, bl
je 0x180089fb0
cmp r10, r13
jb 0x180089e59
jmp 0x18008a031
pcmpeqb xmm2, xmm1
pmovmskb r8d, xmm2
test r8d, r8d
jne 0x18008a10d
mov rcx, qword [rsp + 0x48]
add rax, rcx
add rax, 0x10
add rcx, 0x10
mov qword [rsp + 0x48], rcx
mov rcx, qword [rsp + 0x40]
jmp 0x180089e1d
shl r15, 4
lea rcx, [r15 + r15*4]
sar rcx, 4
movabs rdi, 0xcccccccccccccccd
imul rdi, rcx
lea r9, [rdi - 0x10]
and r9, rax
mov rsi, qword [rsp + 0x40]
movdqu xmm0, xmmword [rsi + r9]
pcmpeqd xmm1, xmm1
pcmpeqb xmm0, xmm1
psllw xmm0, 7
pmovmskb r10d, xmm0
movdqu xmm0, xmmword [rsi + rdi]
pcmpeqb xmm0, xmm1
pmovmskb edx, xmm0
test r10d, r10d
je 0x18008a08c
bsr r10w, r10w
xor r10d, 0xf
jmp 0x18008a091
mov r10w, 0x10
mov r11, qword [rsp + 0x30]
add r8, rsi
or edx, 0x10000
tzcnt ecx, edx
add r10d, ecx
mov dl, 0x80
cmp r10w, 0xf
ja 0x18008a0b5
inc qword [r11 + 0x10]
mov dl, 0xff
mov byte [rsi + rdi], dl
mov byte [r9 + rsi + 0x10], dl
dec qword [r11 + 0x18]
movups xmm0, xmmword [r8 - 0x50]
movdqu xmm1, xmmword [r8 - 0x40]
movdqu xmm2, xmmword [r8 - 0x30]
movdqu xmm3, xmmword [r8 - 0x20]
movaps xmmword [rsp + 0x60], xmm0
movdqu xmm0, xmmword [r8 - 0x10]
movdqa xmmword [rsp + 0xa0], xmm0
movdqa xmmword [rsp + 0x90], xmm3
movdqa xmmword [rsp + 0x80], xmm2
movdqa xmmword [rsp + 0x70], xmm1
movzx eax, byte [rsp + 0x60]
cmp al, 3
jne 0x18008a11b
mov rax, qword [rsp + 0x38]
mov qword [rax], 0
jmp 0x18008a185
movdqa xmm0, xmmword [rsp + 0x90]
movdqa xmm1, xmmword [rsp + 0xa0]
mov rcx, qword [rsp + 0x38]
movdqu xmmword [rcx + 0x10], xmm1
movdqu xmmword [rcx], xmm0
cmp al, 2
jb 0x18008a168
mov rsi, qword [rsp + 0x68]
lea rcx, [rsi + 0x18]
mov rax, qword [rsi]
mov rdx, qword [rsi + 8]
mov r8, qword [rsi + 0x10]
call qword [rax + 0x10]
mov rcx, qword [0x1801fb9b8]
xor edx, edx
mov r8, rsi
call qword [sym.imp.kernel32.dll_HeapFree]
lea rcx, [rsp + 0x88]
mov rax, qword [rsp + 0x70]
mov rdx, qword [rsp + 0x78]
mov r8, qword [rsp + 0x80]
call qword [rax + 0x10]
nop
add rsp, 0xb8
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret
ud2