Function at 0x1800166b8
Capabilities:
Encode data using xor
Encrypt data using rc4 ksa

Disassembly:
mov r11, rsp
mov qword [r11 + 0x20], r9
mov qword [r11 + 0x18], r8
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xe8
movzx eax, byte [r9 + 0x187e]
mov r12d, 0xffff
movzx edi, word [0x18002f8dc]
mov r15, r9
mov r10d, dword [0x18002f948]
add di, r12w
mov r9d, dword [0x18002f8a4]
movzx esi, dl
xor edx, edx
div qword [0x18002f8e0]
movzx r14d, word [0x18002f944]
xor edx, edx
mov rbp, rax
mov qword [rsp + 0xd0], rax
mov eax, 1
mov word [rsp + 0x20], r9w
sub rcx, rax
sub r10d, eax
mov dword [0x18002f948], r10d
mov eax, esi
and rax, rcx
add r14w, di
mov qword [rsp + 0xa0], rax
mov rax, qword [r8 + rsi*8]
mov qword [rsp + 0x88], rax
mov eax, esi
mov word [0x18002f8dc], di
mov word [rsp + 0x130], r14w
lea ebx, [rax + rax]
mov rax, qword [rsp + 0x150]
movsxd rax, dword [rax + rbx*4]
xor rax, qword [r8 + rsi*8]
movzx r8d, word [0x18002f93c]
mov qword [rsp + 0xa8], rax
movsxd rax, dword [0x18002f8c0]
or rax, 0x191e
mov qword [rsp + 0x38], rax
mov eax, esi
xor rax, 0x11d1
mov qword [rsp + 0x78], rax
movsxd rax, r10d
mov r10d, 0x1af7
mov dword [rsp + 0x24], r10d
movzx eax, byte [rax + r15]
mov qword [rsp + 0x80], rax
lea rax, [rcx + 1]
mov rcx, qword [0x18002f920]
div r8
mov rdx, qword [rsp + 0x158]
add r8w, r12w
mov qword [rsp + 0xb0], rax
mov eax, r9d
mov word [0x18002f93c], r8w
movzx r8d, word [rdx + rcx*2]
cdq
idiv r8d
mov rax, qword [0x18002f8a8]
mov r8d, 1
movsxd r12, edx
add r9d, r8d
mov dword [0x18002f8a4], r9d
mov ecx, dword [rax + rsi*4]
mov eax, 0x10e1cc09
imul ecx
sar edx, 9
mov eax, edx
shr eax, 0x1f
add edx, eax
imul eax, edx, 0x1e54
sub ecx, eax
movsxd rax, ecx
mov qword [rsp + 0x48], rax
movsxd rax, dword [0x18002f8c4]
mov qword [0x18002f8b0], rax
movzx eax, di
add eax, 7
movzx edi, byte [rax + 0x4c7]
mov qword [rsp + 0x28], rdi
cmp rdi, qword [rbp + rbx*8]
jb 0x180016eb9
mov r9, qword [rsp + 0xa0]
lea rdx, [r15 + rdi*2]
movzx eax, r14w
add rdx, rdi
mov qword [rsp + 0x58], rax
lea rax, [rdi + r15]
mov qword [rsp + 0x60], rax
lea rax, [rdi + rdi*2]
lea rax, [rax*8 + 0x28]
movsxd r13, edi
mov qword [rsp + 0x68], rax
lea rax, [r15 + rdi*2]
mov qword [rsp + 0x30], rax
lea r15, [rbp + 0x90]
lea rax, [r12 + r12*2]
mov qword [rsp + 0x70], r13
lea rax, [rax*8]
mov qword [rsp + 0x98], rdx
add rax, rbp
lea r15, [r15 + rdi*8]
mov qword [rsp + 0x40], rax
mov rax, qword [r11 + 0x18]
sub rax, rbp
mov qword [rsp + 0x50], rax
mov rax, r9
sub rax, rbp
mov qword [rsp + 0xc0], rax
mov rax, qword [rsp + 0xa8]
sub rax, qword [rsp + 0x148]
mov qword [rsp + 0xc8], rax
add sil, r8b
movsxd rbx, r10d
movzx eax, r10w
movzx r14d, sil
sub ax, word [0x18002f940]
mov word [0x18002f940], ax
mov rax, qword [rsp + 0x38]
movzx ecx, word [rax + r14*2]
movzx eax, byte [rdx]
and rcx, rax
lea eax, [r10 + r10]
movsxd rdx, eax
mov eax, dword [0x18002f914]
mov qword [rsp + 0xb8], rdx
lea eax, [rax*4 + 2]
movsxd r8, eax
mov rax, qword [rsp + 0x158]
mov r8, qword [r9 + r8*8]
mov dl, byte [rax + rdx*2]
xor r8, rbx
call fcn.18001e580
mov rdx, qword [rsp + 0x78]
mov r10d, 1
mov dword [0x18002f8c4], eax
mov rax, qword [rsp + 0x88]
movzx ecx, word [rax + rbx*2]
movzx eax, word [0x18002f8dc]
mov rbx, qword [rsp + 0x50]
and rcx, rax
mov rax, qword [rsp + 0x60]
sub rcx, qword [rbx + r15 - 0x90]
mov qword [rbx + r15 - 0x90], rcx
add word [0x18002f8dc], r10w
movzx eax, byte [rax]
movzx ecx, word [rsp + 0x20]
mov r11d, ecx
movzx ecx, byte [rcx + rdx]
xor edx, edx
div ecx
cdq
idiv dword [0x18002f8a0]
mov eax, dword [0x18002f8c0]
sub eax, r10d
mov dword [0x18002f8a0], edx
mov rdx, qword [rsp + 0xb0]
mov dword [0x18002f8c0], eax
mov r9d, edx
cmp edx, eax
jl 0x180016a3f
mov r13, qword [rsp + 0x38]
mov edi, 1
movsxd r8, edx
add r8, qword [rsp + 0x148]
movzx r10d, sil
movzx ecx, word [r13 + r10*4]
xor edx, edx
mov rax, r12
add r9d, edi
div rcx
sub dl, byte [r8]
mov byte [r8], dl
add r8, rdi
mov eax, dword [0x18002f8c0]
sub eax, edi
mov dword [0x18002f8c0], eax
cmp r9d, eax
jge 0x180016a02
mov rdi, qword [rsp + 0x28]
mov r10d, 1
mov r13, qword [rsp + 0x70]
mov r9, qword [rsp + 0x38]
xor edx, edx
mov rax, qword [rsp + 0x58]
mov r8, qword [rsp + 0x140]
add qword [rsp + 0x40], 0x18
movzx ecx, word [r9]
div qword [rbp + rcx*8]
mov eax, 0x1248
and qword [r8 + r14*8], rdx
xor edx, edx
movzx ecx, word [r12*4 + 0x15f4]
div ecx
mov word [r12*4 + 0x15f4], dx
add r12, r10
add qword [rbp], r10
xor edx, edx
mov rax, qword [rbp]
mov r10, qword [rsp + 0x48]
mov qword [rsp + 0x90], r12
lea rcx, [rax + rax*2]
movsxd rax, dword [r10 + rcx*4]
or rax, r13
or rax, r11
or qword [r8 + r14*8], rax
mov eax, 0x103e
mov r11, qword [0x18002f8f8]
mov r8d, dword [0x18002f914]
movzx eax, byte [rax]
movzx ecx, word [r9 + r11*4]
div ecx
mov rax, qword [rsp + 0x80]
and r8d, edx
mov dword [0x18002f914], r8d
mov r9d, dword [rax + r14*8]
mov rax, qword [rsp + 0x30]
movzx eax, byte [rax]
cmp r9d, eax
jge 0x180016c7f
movzx edx, word [rsp + 0x20]
movzx ebx, word [rsp + 0x130]
mov r10d, edx
mov r12, qword [rsp + 0x30]
mov r13, qword [rsp + 0x140]
mov dword [rsp + 0x138], edx
mov rcx, qword [rsp + 0x48]
movsxd rax, r8d
mov ecx, dword [rcx + rax*4]
xor ecx, dword [0x18002f8d8]
xor ecx, edi
movzx eax, dx
mov dword [0x18002f8d8], ecx
xor edx, edx
mov rcx, qword [rsp + 0x78]
movzx ecx, byte [rax + rcx]
mov eax, r10d
div ecx
mov rcx, qword [rsp + 0x38]
add ax, word [rcx + 0x2932]
mov rcx, qword [rsp + 0x50]
movzx edx, ax
mov rax, r14
add rax, rax
movzx ecx, word [rcx + r15 - 0x88]
and qword [0x18002f930], r11
imul edx, ecx
mov rcx, qword [rsp + 0x40]
add word [0x18002f93c], dx
movsxd r10, dword [r13 + rax*8]
cmp r10, qword [rcx]
ja 0x180016c4a
mov r12, qword [rsp + 0x48]
mov r13, rcx
mov rdi, qword [rsp + 0x80]
movzx eax, bx
mov rbx, qword [rsp + 0x148]
lea r8d, [rax*2 + 1]
movzx eax, word [0x18002f940]
add r14, r14
cdq
add sil, 0xff
idiv dword [r12 + r8*4]
inc r10d
mov dword [r12 + r8*4], eax
mov qword [rdi + r14*8], 0xaf9
mov rdx, qword [rbp]
movsxd rax, dword [0x18002f8a0]
mov rcx, qword [0x18002f8c8]
movzx r14d, sil
xor qword [rcx + rdx*8 + 0x30], rax
xor edx, edx
dec dword [0x18002f8a0]
mov al, byte [r15]
add byte [r14 + rbx], al
mov rax, qword [0x18002f8f0]
movzx ecx, sil
sub ecx, dword [rax + 0xe8c]
movsxd rax, ecx
div qword [0x18002f928]
movsxd rax, r10d
mov qword [0x18002f928], rdx
cmp rax, qword [r13]
jbe 0x180016bab
mov r8d, dword [0x18002f914]
mov r11, qword [0x18002f8f8]
mov rdi, qword [rsp + 0x28]
movzx ebx, word [rsp + 0x130]
mov r12, qword [rsp + 0x30]
mov r13, qword [rsp + 0x140]
movzx eax, byte [r12]
inc r9d
mov r10d, dword [rsp + 0x138]
movzx edx, word [rsp + 0x20]
cmp r9d, eax
jl 0x180016b15
mov r12, qword [rsp + 0x90]
mov r13, qword [rsp + 0x70]
mov rbx, qword [rsp + 0x50]
mov r10, qword [rsp + 0x48]
mov rax, qword [rsp + 0x58]
mov rdx, qword [rsp + 0x68]
mov r9, qword [rsp + 0x150]
movzx r14d, word [rsp + 0x130]
movsxd rcx, dword [r9 + rax*4]
mov rax, qword [0x18002f8c8]
and rcx, r12
sub rcx, r13
mov qword [rdx + rax], rcx
mov rax, qword [0x18002f8c8]
movzx edx, word [rsp + 0x20]
mov qword [rax + r12*8], rdx
movsxd r8, dword [0x18002f8d8]
mov rax, qword [0x18002f8c8]
mov rdx, qword [rsp + 0xb8]
mov dword [rsp + 0x28], r8d
cmp r8, qword [rax + rdx*8]
jne 0x180016e5b
mov r13d, dword [rsp + 0x24]
lea r10, [r10 + r8*4]
mov rbp, qword [rsp + 0x140]
mov rcx, qword [rsp + 0x88]
mov eax, 0xffff
add r14w, ax
movzx eax, sil
movzx r12d, r14w
inc sil
mov qword [rsp + 0x58], r12
mov word [rsp + 0x130], r14w
movzx eax, word [rcx + rax*2]
cdq
mov byte [rsp + 0x138], sil
idiv dword [r9 + r12*4]
mov eax, edi
mov dword [r9 + r12*4], edx
cdq
mov rcx, qword [0x18002f8f8]
mov r12, qword [rsp + 0x158]
idiv dword [r9 + rcx*4]
mov dword [r9 + rcx*4], eax
mov ecx, 1
mov rax, qword [0x18002f8f8]
mov r11d, dword [rbx + r15 - 0x50]
add rax, rcx
mov qword [0x18002f8f8], rax
movzx eax, word [r12 + rax*8]
cmp r11d, eax
je 0x180016e20
mov r14, qword [rsp + 0x30]
mov r8, qword [rsp + 0xc0]
movzx r9d, sil
movzx ebx, sil
mov rsi, qword [rsp + 0xc8]
shl r9, 5
xor qword [r8 + r15 - 0x90], 0x134d
movzx eax, word [rsi + r14]
add eax, dword [r10]
cdqe
mov qword [r9 + rbp], rax
mov eax, edi
movzx ecx, word [0x18002f93c]
cdq
idiv ecx
mov ecx, 1
mov word [0x18002f93c], ax
add r11d, ecx
mov eax, dword [rbp + rbx*8]
or eax, r13d
sub r13d, ecx
add dword [0x18002f948], eax
mov rax, qword [0x18002f8f8]
add rax, rcx
mov qword [0x18002f8f8], rax
movzx eax, word [r12 + rax*8]
cmp r11d, eax
jne 0x180016d98
mov sil, byte [rsp + 0x138]
mov r8d, dword [rsp + 0x28]
movzx r14d, word [rsp + 0x130]
mov rbx, qword [rsp + 0x50]
mov r9, qword [rsp + 0x150]
mov dword [rsp + 0x24], r13d
add r8d, ecx
lea eax, [r13*2]
movsxd rcx, eax
add r10, 4
mov rax, qword [0x18002f8c8]
movsxd rdx, r8d
mov dword [rsp + 0x28], r8d
cmp rdx, qword [rax + rcx*8]
je 0x180016cf5
mov rbp, qword [rsp + 0xd0]
mov r12, qword [rsp + 0x90]
mov rdx, qword [rsp + 0x98]
mov r8d, 1
add qword [rsp + 0x60], r8
add edi, r8d
add qword [rsp + 0x68], 0x18
add rdx, 3
add qword [rsp + 0x30], 2
add r15, 8
mov r10d, dword [rsp + 0x24]
mov r9, qword [rsp + 0xa0]
movsxd r13, edi
movzx eax, sil
add rax, rax
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x98], rdx
mov qword [rsp + 0x70], r13
cmp r13, qword [rbp + rax*8]
jae 0x180016900
mov rcx, qword [rsp + 0xa8]
movsxd rax, r10d
movzx eax, word [rcx + rax*2]
movzx ecx, r14w
movzx edx, byte [rcx + 0xb6f]
and eax, edx
add rsp, 0xe8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret