Function at 0x180016d30
Capabilities:
Encrypt data using rc4 ksa

Disassembly:
mov rax, rsp
mov dword [rax + 0x10], edx
push rbp
push rbx
push r15
lea rbp, [rax - 0x28]
sub rsp, 0x110
movdqa xmm0, xmmword [0x1800b1730]
lea r9d, [rdx - 5]
mov qword [rax + 8], rsi
xor r15d, r15d
mov qword [rax - 0x20], rdi
mov qword [rax - 0x28], r12
mov r12, rcx
mov qword [rax - 0x30], r13
mov qword [rax - 0x38], r14
mov eax, 0xf
mov qword [rbp - 0x58], rax
mov r14d, edx
movdqa xmmword [rbp - 0x40], xmm0
mov byte [rbp - 0x50], 0
mov qword [rbp - 0x60], r15
mov byte [rbp - 0x70], r15b
mov dword [rsp + 0x78], r9d
cmp edx, r9d
jbe 0x180017128
mov ebx, dword [rbp + 0x38]
mov r9d, dword [rbp + 0x38]
mov edi, dword [rbp + 0x38]
mov dword [rbp + 0x40], ebx
mov rsi, qword [rbp + 0x40]
mov r13, qword [rbp + 0x40]
mov qword [rsp + 0x70], rsi
mov dword [rsp + 0x40], r9d
nop word [rax + rax]
mov eax, r14d
sub eax, 0x58
je 0x1800171de
sub eax, 1
je 0x1800170a2
sub eax, 1
je 0x18001705a
sub eax, 4
je 0x180016e42
cmp eax, 1
jne 0x18001703e
mov rax, qword [r12]
mov ebx, 0x1fe
mov edx, 1
cmp dword [rax + 0x70], 1
mov rsi, qword [rax + 0x2a8]
mov eax, r15d
cmovne ebx, r15d
mov qword [rsp + 0x70], rsi
sete al
mov dword [rbp + 0x40], ebx
mov dword [rsi + 0x38], eax
mov rcx, qword [r12]
lea r8d, [rbx + 0x100]
mov rax, qword [rcx + 8]
mov r9d, dword [rcx + 0x90]
call qword [rax + 0x10]
mov qword [rsi + 0x30], rax
mov eax, dword [rsi + 0x28]
mov dword [rbp + 0x48], eax
jmp 0x18001703e
mov rax, qword [r12]
cmp dword [rax + 0x90], 0
jle 0x18001703b
xor r14d, r14d
lea rdx, [rsi + 0x3c]
mov ecx, r14d
mov qword [rsp + 0x68], rdx
mov qword [rbp - 0x80], rcx
nop word [rax + rax]
mov r8d, OleUIChangeSourceA
mov dword [rsp + 0x60], r8d
nop dword [rax + rax]
cmp r8d, 0xb
je 0x180016fe2
cmp r8d, 0xc2
je 0x180016fc8
cmp r8d, 0x179
je 0x180016fc3
cmp r8d, 0x230
je 0x180016eff
cmp r8d, 0x2e7
jne 0x180016ff9
test ebx, ebx
je 0x180016ff9
mov eax, 1
lea rdx, [r13 - 1]
nop dword [rax + rax]
movzx ecx, byte [r13]
mov byte [rdx], cl
lea rdx, [rdx - 1]
movzx ecx, byte [r13 + 0xff]
mov byte [rax + r13 + 0xff], cl
inc rax
cmp rax, 0xff
jle 0x180016ed0
mov rcx, qword [rbp - 0x80]
jmp 0x180016ff4
mov rax, qword [r12]
lea esi, [r9 - 1]
lea r9, [rsp + 0x48]
mov dword [rsp + 0x48], esi
lea r8, [rbp - 0x78]
mov qword [rbp - 0x78], rax
lea rdx, [rsp + 0x50]
mov dword [rsp + 0x50], r14d
lea rcx, [rsp + 0x58]
mov dword [rsp + 0x58], r15d
mov dword [rsp + 0x20], 0xaf
call fcn.18005c390
mov ebx, r14d
nop dword [rax]
cmp ebx, eax
jle 0x180016f8b
nop dword [rax]
nop dword [rax + rax]
mov rax, qword [r12]
lea r9, [rsp + 0x58]
inc edi
mov qword [rbp - 0x78], rax
lea r8, [rbp - 0x78]
mov dword [rsp + 0x50], edi
lea rdx, [rsp + 0x50]
mov dword [rsp + 0x58], esi
lea rcx, [rsp + 0x48]
mov dword [rsp + 0x48], r15d
mov dword [rsp + 0x20], 0xaf
call fcn.18005c390
cmp ebx, eax
jg 0x180016f50
movsx ecx, byte [rbp + 0x48]
inc ebx
movsx edx, dil
imul edx, ecx
mov byte [r14 + r13], dl
inc r14
cmp r14, 0xff
jle 0x180016f40
mov r8d, dword [rsp + 0x60]
xor r14d, r14d
mov rcx, qword [rbp - 0x80]
mov ebx, dword [rbp + 0x40]
mov rsi, qword [rsp + 0x70]
mov r9d, dword [rsp + 0x40]
jmp 0x180016ff4
mov edi, r14d
jmp 0x180016ff9
test ebx, ebx
je 0x180016fd8
mov rax, qword [rsi + 0x30]
add qword [rax + rcx], 0xff
mov rax, qword [rsi + 0x30]
mov r13, qword [rcx + rax]
jmp 0x180016ff9
mov r9d, dword [rdx]
mov eax, dword [rbp + 0x48]
cdq
mov dword [rsp + 0x40], r9d
idiv r9d
mov dword [rbp + 0x48], eax
mov rdx, qword [rsp + 0x68]
add r8d, 0xb7
mov dword [rsp + 0x60], r8d
cmp r8d, 0x39e
jb 0x180016e80
mov rax, qword [r12]
add rcx, 8
add rdx, 4
mov qword [rbp - 0x80], rcx
inc r15d
mov qword [rsp + 0x68], rdx
cmp r15d, dword [rax + 0x90]
jl 0x180016e70
mov r14d, dword [rbp + 0x38]
xor r15d, r15d
dec r14d
mov dword [rbp + 0x38], r14d
cmp r14d, dword [rsp + 0x78]
jbe 0x180017124
mov r9d, dword [rsp + 0x40]
jmp 0x180016dc0
mov r9, r12
mov byte [0x1800bd5e4], 0
lea r8, [rbp - 0x70]
mov edx, 0xe5
lea rcx, [rbp - 0x50]
call fcn.180024230
test al, al
je 0x18001711c
mov qword [rsp + 0x28], r15
lea rcx, [rbp - 0x50]
xor r9d, r9d
mov qword [rsp + 0x20], r15
xor edx, edx
mov r8d, 0xee
call fcn.18003a410
test al, al
je 0x18001711c
jmp 0x18001703e
xor r9d, r9d
mov dword [rsp + 0x20], 0x11a
xor r8d, r8d
lea rdx, [rbp - 0x70]
xor ecx, ecx
call fcn.18003b660
mov rsi, rax
test rax, rax
je 0x18001711c
mov rbx, qword [0x1800bd690]
cmp rbx, qword [0x1800bd698]
je 0x1800170e9
mov rcx, rsi
call qword [rbx]
test al, al
je 0x1800170f6
add rbx, 8
cmp rbx, qword [0x1800bd698]
jne 0x1800170d3
mov ebx, dword [rbp + 0x40]
mov rsi, qword [rsp + 0x70]
jmp 0x18001703e
mov qword [rsp + 0x30], r15
lea r8, [rbp + 0x40]
mov dword [rsp + 0x28], 0x128
xor r9d, r9d
xor edx, edx
mov qword [rsp + 0x20], r15
xor ecx, ecx
mov qword [rbp + 0x40], rsi
call fcn.18004c9b0
mov rax, qword [rbp - 0x58]
xor bl, bl
jmp 0x18001712c
mov rax, qword [rbp - 0x58]
movzx ebx, byte [rbp + 0x38]
mov r14, qword [rsp + 0xf0]
mov r13, qword [rsp + 0xf8]
mov r12, qword [rsp + 0x100]
mov rdi, qword [rsp + 0x108]
mov rsi, qword [rsp + 0x130]
cmp rax, 0x10
jb 0x180017188
mov rcx, qword [rbp - 0x70]
lea rdx, [rax + 1]
mov rax, rcx
cmp rdx, 0x1000
jb 0x180017183
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1800171f0
call fcn.180072898
mov rdx, qword [rbp - 0x38]
mov qword [rbp - 0x60], r15
mov qword [rbp - 0x58], 0xf
mov byte [rbp - 0x70], 0
cmp rdx, 0x10
jb 0x1800171cf
mov rcx, qword [rbp - 0x50]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x1800171ca
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x1800171f0
call fcn.180072898
movzx eax, bl
add rsp, 0x110
pop r15
pop rbx
pop rbp
ret
mov rax, qword [rbp - 0x58]
mov bl, 1
mov byte [0x1800bd5e4], 1
jmp 0x18001712c
call fcn.1800773d0
int3