Function at 0x2016c22a0
Capabilities:
Encode data using xor
Encrypt data using aes
Reference aes constants

Disassembly:
push r15
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0xc8
test r8, r8
mov qword [rsp + 0x110], rcx
mov rax, rdx
mov qword [rsp + 0x120], r8
je 0x2016c2bab
lea r15, [rdx + 0x10]
lea rdx, [rsp + 0xb0]
mov qword [rsp + 0x90], rdx
mov rdx, 0xfffffffffffffff0
lea rdi, [rcx + 0xd0]
sub rdx, rax
lea rsi, [rcx + 0xf0]
mov qword [rsp + 0x98], rdi
mov qword [rsp + 0xa0], rsi
mov qword [rsp + 0xa8], rdx
mov rdx, qword [rsp + 0x90]
lea rax, [r15 - 0x10]
mov r9d, 0x10
mov qword [rsp + 0x40], 0
mov rcx, qword [sub.msvcrt.dll_memcpy]
mov r8, rax
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
mov qword [rsp + 0x88], rax
call fcn.2016c1500
mov rax, qword [rsp + 0x110]
movzx r13d, byte [r15 - 0x10]
movzx edi, byte [r15 - 0xf]
mov rsi, qword [rsp + 0x110]
xor r13b, byte [rax + 0xe0]
movzx ecx, byte [r15 - 0xe]
movzx ebp, byte [r15 - 0xc]
movzx r10d, byte [r15 - 0xb]
mov byte [r15 - 0x10], r13b
xor dil, byte [rax + 0xe1]
movzx r11d, byte [r15 - 8]
mov byte [r15 - 0xf], dil
xor cl, byte [rax + 0xe2]
movzx eax, byte [r15 - 0xd]
mov byte [r15 - 0xe], cl
xor al, byte [rsi + 0xe3]
movzx r9d, al
movzx eax, byte [r15 - 0xa]
mov byte [r15 - 0xd], r9b
xor bpl, byte [rsi + 0xe4]
mov byte [r15 - 0xc], bpl
xor r10b, byte [rsi + 0xe5]
mov byte [r15 - 0xb], r10b
xor al, byte [rsi + 0xe6]
mov byte [r15 - 0xa], al
mov byte [rsp + 0x6c], al
movzx eax, byte [r15 - 9]
xor al, byte [rsi + 0xe7]
mov byte [r15 - 9], al
xor r11b, byte [rsi + 0xe8]
mov byte [rsp + 0x74], al
movzx eax, byte [r15 - 7]
mov byte [r15 - 8], r11b
xor al, byte [rsi + 0xe9]
mov rdx, qword [rsp + 0x110]
movzx esi, byte [r15 - 6]
mov rbx, qword [rsp + 0x110]
mov byte [r15 - 7], al
mov r14, qword [rsp + 0x110]
xor sil, byte [rdx + 0xea]
mov byte [rsp + 0x64], al
movzx edx, byte [r15 - 5]
movzx r8d, byte [r15 - 3]
mov rax, qword [rsp + 0x110]
mov byte [r15 - 6], sil
xor dl, byte [rbx + 0xeb]
movzx ebx, dl
movzx edx, byte [r15 - 4]
mov byte [r15 - 5], bl
xor dl, byte [r14 + 0xec]
mov byte [r15 - 4], dl
xor r8b, byte [r14 + 0xed]
movzx r12d, r8b
movzx r8d, byte [r15 - 2]
mov byte [r15 - 3], r12b
xor r8b, byte [r14 + 0xee]
movzx r14d, byte [r15 - 1]
mov byte [r15 - 2], r8b
xor r14b, byte [rax + 0xef]
mov rax, qword [rsp + 0x98]
mov qword [rsp + 0x80], rax
nop word cs:[rax + rax]
lea rax, [0x2016f6020]
movzx r11d, r11b
movzx edx, dl
movzx r11d, byte [rax + r11]
movzx r13d, r13b
movzx ebp, bpl
movzx ecx, cl
movzx ebp, byte [rax + rbp]
movzx esi, sil
movzx r8d, r8b
movzx edi, dil
movzx r13d, byte [rax + r13]
movzx r10d, r10b
movzx r14d, r14b
mov byte [rsp + 0x50], r11b
mov r11, rax
movzx eax, byte [rax + rdx]
movzx ecx, byte [r11 + rcx]
movzx edi, byte [r11 + rdi]
movzx edx, byte [r11 + r12]
mov byte [rsp + 0x68], al
movzx eax, byte [rsp + 0x64]
mov byte [rsp + 0x6a], cl
movzx ecx, byte [rsp + 0x6c]
movzx r10d, byte [r11 + r10]
movzx r14d, byte [r11 + r14]
movzx eax, byte [r11 + rax]
movzx ecx, byte [r11 + rcx]
mov byte [rsp + 0x64], al
movzx eax, byte [r11 + rsi]
mov byte [rsp + 0x6c], cl
movzx esi, byte [r11 + r8]
movzx ecx, byte [rsp + 0x74]
movzx r8d, byte [r11 + rbx]
mov byte [rsp + 0x74], al
movzx r12d, byte [r11 + rcx]
movzx ecx, sil
mov rbx, r8
shl r8, 8
movzx r11d, byte [r11 + r9]
movzx r9d, r13b
or r8, rcx
movzx ecx, dil
shl r8, 8
or r8, rcx
movzx ecx, bpl
shl r8, 8
mov byte [rsp + 0x70], r11b
or r8, rcx
movzx ecx, r12b
shl r8, 8
or r8, rcx
movzx ecx, al
mov rax, r9
movzx r9d, byte [rsp + 0x6c]
shl r8, 8
or r8, rcx
movzx ecx, dl
shl r8, 8
or r8, rcx
movzx ecx, r11b
movzx r11d, byte [rsp + 0x50]
shl rcx, 8
shl r8, 8
or rcx, r9
movzx r9d, byte [rsp + 0x64]
or rax, r8
shl rcx, 8
or rcx, r9
movzx r9d, byte [rsp + 0x68]
shl rcx, 8
or rcx, r9
movzx r9d, r14b
shl rcx, 8
or rcx, r9
movzx r9d, byte [rsp + 0x6a]
mov qword [rsp + 0x50], rax
shl rcx, 8
movzx r8d, byte [rsp + 0x6a]
or rcx, r9
movzx r9d, r10b
shl rcx, 8
or rcx, r9
movzx r9d, r11b
shl rcx, 8
mov rax, rcx
mov rcx, qword [rsp + 0x80]
or rax, r9
mov qword [rsp + 0x58], rax
movdqa xmm5, xmmword [rsp + 0x50]
movzx eax, byte [rsp + 0x74]
movups xmmword [r15 - 0x10], xmm5
xor r13b, byte [rcx]
mov byte [r15 - 0x10], r13b
xor dl, byte [rcx + 1]
mov byte [r15 - 0xf], dl
xor al, byte [rcx + 2]
mov byte [r15 - 0xe], al
xor r12b, byte [rcx + 3]
mov byte [r15 - 0xd], r12b
xor bpl, byte [rcx + 4]
mov byte [r15 - 0xc], bpl
xor dil, byte [rcx + 5]
mov byte [r15 - 0xb], dil
xor sil, byte [rcx + 6]
mov byte [r15 - 0xa], sil
xor bl, byte [rcx + 7]
mov byte [r15 - 9], bl
movzx r9d, byte [rcx + 8]
xor r9d, r11d
mov r11, rcx
mov byte [r15 - 8], r9b
xor r10b, byte [rcx + 9]
mov byte [r15 - 7], r10b
xor r8b, byte [rcx + 0xa]
mov byte [r15 - 6], r8b
xor r14b, byte [rcx + 0xb]
movzx ecx, byte [rsp + 0x68]
mov byte [rsp + 0x6a], r14b
mov byte [r15 - 5], r14b
xor cl, byte [r11 + 0xc]
mov byte [r15 - 4], cl
mov r14d, ecx
mov rcx, r11
movzx r11d, byte [rsp + 0x64]
xor r11b, byte [rcx + 0xd]
mov byte [r15 - 3], r11b
mov byte [rsp + 0x68], r11b
movzx r11d, byte [rsp + 0x6c]
xor r11b, byte [rcx + 0xe]
mov byte [r15 - 2], r11b
mov byte [rsp + 0x50], r11b
movzx r11d, byte [rsp + 0x70]
xor r11b, byte [rcx + 0xf]
cmp qword [rsp + 0x110], rcx
mov byte [r15 - 1], r11b
je 0x2016c2a4a
mov r11, qword [rsp + 0x88]
mov qword [rsp + 0x78], r15
movzx r14d, byte [r11]
movzx r13d, byte [r11 + 1]
movzx edx, byte [r11 + 2]
movzx ebx, byte [r11 + 3]
lea eax, [r14 + r14]
mov r10d, r14d
shr r10b, 7
movzx r10d, r10b
neg r10d
and r10d, 0x1b
xor r10d, eax
lea ebp, [r10 + r10]
mov eax, r10d
movzx r10d, r10b
shr al, 7
and ebp, 0x1fe
movzx eax, al
neg eax
and eax, 0x1b
xor ebp, eax
lea ecx, [rbp + rbp]
mov eax, ebp
movzx ebp, bpl
shr al, 7
movzx eax, al
neg eax
and eax, 0x1b
mov dword [rsp + 0x50], eax
mov eax, ecx
mov ecx, r13d
shr cl, 7
and ax, 0xfe
movzx ecx, cl
mov word [rsp + 0x68], ax
lea eax, [r13 + r13]
neg ecx
and ecx, 0x1b
xor ecx, eax
lea r12d, [rcx + rcx]
mov edi, ecx
movzx ecx, cl
shr dil, 7
and r12d, 0x1fe
movzx eax, dil
neg eax
and eax, 0x1b
xor r12d, eax
lea r8d, [r12 + r12]
mov esi, r12d
movzx r12d, r12b
shr sil, 7
movzx eax, sil
mov esi, r8d
mov r8d, edx
shr r8b, 7
neg eax
and si, 0xfe
movzx r8d, r8b
mov edi, eax
mov word [rsp + 0x6a], si
lea eax, [rdx + rdx]
neg r8d
and edi, 0x1b
and r8d, 0x1b
mov dword [rsp + 0x64], edi
xor r8d, eax
lea esi, [r8 + r8]
mov r15d, r8d
movzx r8d, r8b
shr r15b, 7
and esi, 0x1fe
movzx eax, r15b
mov r15d, ebx
neg eax
shr r15b, 7
and eax, 0x1b
xor esi, eax
lea eax, [rsi + rsi]
mov r9d, esi
movzx esi, sil
shr r9b, 7
mov edi, eax
movzx r9d, r9b
and di, 0xfe
neg r9d
mov word [rsp + 0x74], di
and r9d, 0x1b
mov dword [rsp + 0x6c], r9d
movzx r9d, r15b
movzx r15d, bl
lea eax, [r15 + r15]
neg r9d
and r9d, 0x1b
xor r9d, eax
lea edi, [r9 + r9]
mov ebx, r9d
movzx r9d, r9b
shr bl, 7
and edi, 0x1fe
movzx eax, bl
neg eax
and eax, 0x1b
xor edi, eax
lea eax, [rdi + rdi]
mov ebx, edi
movzx edi, dil
shr bl, 7
movzx ebx, bl
neg ebx
and ebx, 0x1b
mov dword [rsp + 0x70], ebx
mov ebx, eax
and bx, 0xfe
mov word [rsp + 0x76], bx
mov ebx, r13d
shl ebx, 8
mov eax, ebx
mov ebx, r14d
shl ebx, 8
or eax, r13d
or ebx, r14d
shl eax, 8
shl ebx, 8
or eax, edx
or ebx, r14d
shl eax, 8
mov r14d, r10d
shl ebx, 8
or eax, edx
or ebx, r13d
shl r14d, 8
movd xmm0, eax
movd xmm3, ebx
mov ebx, r14d
shl edx, 8
or ebx, r8d
pxor xmm0, xmm3
or edx, r15d
shl ebx, 8
or ebx, ecx
shl ebx, 8
or ebx, r10d
mov r10d, r9d
shl r10d, 8
or r10d, r9d
shl r10d, 8
or r10d, r8d
mov r8d, edi
shl r8d, 8
shl r10d, 8
or r8d, esi
or r10d, ecx
mov ecx, r12d
shl r8d, 8
shl ecx, 8
xor ebx, r10d
or r8d, edi
or ecx, ebp
movd xmm4, ebx
shl r8d, 8
shl ecx, 8
pxor xmm0, xmm4
or r8d, esi
movzx esi, word [rsp + 0x6a]
or ecx, r12d
xor si, word [rsp + 0x64]
shl ecx, 8
or ecx, ebp
xor ecx, r8d
movd xmm5, ecx
mov eax, esi
pxor xmm0, xmm5
mov ah, al
movd xmm3, eax
movzx eax, word [rsp + 0x68]
xor ax, word [rsp + 0x50]
pshuflw xmm1, xmm3, 0
mov ah, al
movd xmm4, eax
movzx eax, word [rsp + 0x74]
xor ax, word [rsp + 0x6c]
pshuflw xmm2, xmm4, 0
pxor xmm1, xmm2
pxor xmm0, xmm1
mov ah, al
movd xmm5, eax
movzx eax, word [rsp + 0x76]
xor ax, word [rsp + 0x70]
shl edx, 8
pshuflw xmm1, xmm5, 0
add r11, 4
or edx, r15d
shl edx, 8
or edx, r15d
mov ah, al
movd xmm4, edx
movd xmm3, eax
mov rax, qword [rsp + 0x78]
pshuflw xmm2, xmm3, 0
pxor xmm1, xmm2
pxor xmm0, xmm1
pxor xmm0, xmm4
movd dword [r11 - 4], xmm0
cmp r11, rax
jne 0x2016c2710
mov r15, rax
movzx r12d, byte [rax - 3]
movzx eax, byte [rax - 7]
movzx r10d, byte [r15 - 0xb]
movzx edi, byte [r15 - 0xf]
movzx ecx, byte [r15 - 0xe]
mov byte [rsp + 0x64], al
movzx eax, byte [r15 - 0xa]
movzx esi, byte [r15 - 6]
movzx r8d, byte [r15 - 2]
movzx r9d, byte [r15 - 0xd]
mov byte [rsp + 0x6c], al
movzx eax, byte [r15 - 9]
movzx ebx, byte [r15 - 5]
movzx r14d, byte [r15 - 1]
movzx r13d, byte [r15 - 0x10]
movzx ebp, byte [r15 - 0xc]
mov byte [rsp + 0x74], al
movzx r11d, byte [r15 - 8]
movzx edx, byte [r15 - 4]
sub qword [rsp + 0x80], 0x10
jmp 0x2016c24c0
mov byte [rsp + 0x64], dl
mov edx, r14d
movzx ecx, byte [rsp + 0x6a]
add r15, 0x10
mov r14, qword [rsp + 0x110]
mov byte [rsp + 0x6a], r11b
mov r11d, r9d
mov r9d, r13d
mov r13d, eax
movzx eax, byte [rsp + 0x68]
xor r9b, byte [r14 + 0xf0]
mov byte [r15 - 0x20], r9b
movzx r9d, byte [rsp + 0x64]
xor r9b, byte [r14 + 0xf1]
mov r14, qword [rsp + 0x110]
mov byte [r15 - 0x1f], r9b
xor r13b, byte [r14 + 0xf2]
mov byte [r15 - 0x1e], r13b
xor r12b, byte [r14 + 0xf3]
mov byte [r15 - 0x1d], r12b
xor bpl, byte [r14 + 0xf4]
mov byte [r15 - 0x1c], bpl
xor dil, byte [r14 + 0xf5]
mov byte [r15 - 0x1b], dil
xor sil, byte [r14 + 0xf6]
mov byte [r15 - 0x1a], sil
xor bl, byte [r14 + 0xf7]
mov byte [r15 - 0x19], bl
movzx r9d, byte [r14 + 0xf8]
xor r9d, r11d
mov byte [r15 - 0x18], r9b
xor r10b, byte [r14 + 0xf9]
mov r9d, 0x10
mov byte [r15 - 0x17], r10b
xor r8b, byte [r14 + 0xfa]
mov byte [r15 - 0x16], r8b
xor cl, byte [r14 + 0xfb]
mov byte [r15 - 0x15], cl
xor dl, byte [r14 + 0xfc]
mov byte [r15 - 0x14], dl
xor al, byte [r14 + 0xfd]
movzx r10d, byte [rsp + 0x50]
movzx r11d, byte [rsp + 0x6a]
mov r8, qword [rsp + 0x90]
mov byte [r15 - 0x13], al
xor r10b, byte [r14 + 0xfe]
mov rdx, qword [rsp + 0xa0]
mov rcx, qword [sub.msvcrt.dll_memcpy]
mov byte [r15 - 0x12], r10b
xor r11b, byte [r14 + 0xff]
mov byte [r15 - 0x11], r11b
mov qword [rsp + 0x40], 0
mov qword [rsp + 0x38], 0
mov qword [rsp + 0x30], 0
mov qword [rsp + 0x28], 0
mov qword [rsp + 0x20], 0
call fcn.2016c1500
mov rax, qword [rsp + 0xa8]
add rax, r15
cmp rax, qword [rsp + 0x120]
jb 0x2016c2313
xor eax, eax
add rsp, 0xc8
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret