Function at 0x40a7e1
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, 0x58
mov r13, rcx
mov qword [rsp + 0xa8], rdx
mov r8, rdx
mov rdx, rcx
mov ecx, 0xa
call fcn.0040a790
mov dword [rsp + 0x3c], 9
mov qword [rsp + 0x40], r13
lea rax, [r13 + 4]
mov qword [rsp + 0x48], rax
mov rbx, r13
jmp 0x40a83a
mov rbx, qword [rsp + 0xa0]
sub dword [rsp + 0x3c], 1
je 0x40aa4f
movzx eax, byte [rbx + 0xd]
movzx edx, byte [rbx + 9]
mov byte [rbx + 0xd], dl
movzx edx, byte [rbx + 5]
mov byte [rbx + 9], dl
movzx edx, byte [rbx + 1]
mov byte [rbx + 5], dl
mov byte [rbx + 1], al
movzx eax, byte [rbx + 2]
movzx edx, byte [rbx + 0xa]
mov byte [rbx + 2], dl
mov byte [rbx + 0xa], al
movzx eax, byte [rbx + 6]
movzx edx, byte [rbx + 0xe]
mov byte [rbx + 6], dl
mov byte [rbx + 0xe], al
movzx eax, byte [rbx + 3]
movzx edx, byte [rbx + 7]
mov byte [rbx + 3], dl
movzx edx, byte [rbx + 0xb]
mov byte [rbx + 7], dl
movzx edx, byte [rbx + 0xf]
mov byte [rbx + 0xb], dl
mov byte [rbx + 0xf], al
mov rdx, rbx
mov rax, rdx
lea rcx, [rdx + 0x10]
movzx r8d, byte [rax]
lea rsi, [0x005b58a0]
movzx r8d, byte [rsi + r8]
mov byte [rax], r8b
add rax, 4
cmp rax, rcx
jne 0x40a898
add rdx, 1
cmp rdx, qword [rsp + 0x48]
jne 0x40a891
mov r8, qword [rsp + 0xa8]
mov rdx, qword [rsp + 0x40]
mov ecx, dword [rsp + 0x3c]
call fcn.0040a790
lea rax, [rbx + 0x10]
mov qword [rsp + 0x30], rax
mov r13, rbx
mov qword [rsp + 0xa0], rbx
movzx ebp, byte [r13]
movzx edi, byte [r13 + 1]
movzx esi, byte [r13 + 2]
movzx r12d, byte [r13 + 3]
movzx ecx, bpl
call fcn.0040a7ce
mov byte [rsp + 0x2d], al
movzx ecx, al
call fcn.0040a7ce
mov byte [rsp + 0x2e], al
movzx ecx, al
call fcn.0040a7ce
mov byte [rsp + 0x2f], al
movzx ecx, dil
call fcn.0040a7ce
mov byte [rsp + 0x38], al
movzx ecx, al
call fcn.0040a7ce
mov byte [rsp + 0x39], al
movzx ecx, al
call fcn.0040a7ce
mov byte [rsp + 0x3a], al
movzx ecx, sil
call fcn.0040a7ce
mov byte [rsp + 0x2c], al
movzx ecx, al
call fcn.0040a7ce
mov r15d, eax
movzx ecx, al
call fcn.0040a7ce
mov ebx, eax
movzx ecx, r12b
call fcn.0040a7ce
mov byte [rsp + 0x3b], al
movzx ecx, al
call fcn.0040a7ce
mov r14d, eax
movzx ecx, al
call fcn.0040a7ce
movzx ecx, byte [rsp + 0x2d]
mov edx, ecx
movzx r10d, byte [rsp + 0x2e]
xor edx, r10d
movzx r9d, byte [rsp + 0x2f]
xor edx, r9d
movzx r11d, byte [rsp + 0x38]
xor edx, r11d
movzx r8d, byte [rsp + 0x3a]
xor edx, r8d
xor edx, r15d
xor edx, ebx
xor edx, eax
xor edx, edi
xor edx, esi
xor edx, r12d
mov byte [r13], dl
mov edx, r11d
xor edx, r9d
movzx r11d, byte [rsp + 0x39]
xor edx, r11d
xor edx, r8d
xor dl, byte [rsp + 0x2c]
xor edx, ebx
xor edx, r14d
xor edx, eax
xor edx, ebp
xor edx, esi
xor edx, r12d
mov byte [r13 + 1], dl
mov edx, r10d
xor edx, r9d
xor edx, r8d
xor dl, byte [rsp + 0x2c]
xor r15d, edx
xor r15d, ebx
movzx r10d, byte [rsp + 0x3b]
xor r15d, r10d
xor r15d, eax
xor r15d, ebp
xor r15d, edi
xor r12d, r15d
mov byte [r13 + 2], r12b
xor ecx, r9d
mov edx, ecx
xor edx, r11d
xor edx, r8d
xor edx, ebx
xor edx, r10d
xor r14d, edx
xor r14d, eax
xor ebp, r14d
xor edi, ebp
xor esi, edi
mov byte [r13 + 3], sil
add r13, 4
cmp r13, qword [rsp + 0x30]
jne 0x40a8e9
jmp 0x40a827
mov r13, rbx
movzx eax, byte [rbx + 0xd]
movzx edx, byte [rbx + 9]
mov byte [rbx + 0xd], dl
movzx edx, byte [rbx + 5]
mov byte [rbx + 9], dl
movzx edx, byte [rbx + 1]
mov byte [rbx + 5], dl
mov byte [rbx + 1], al
movzx eax, byte [rbx + 2]
movzx edx, byte [rbx + 0xa]
mov byte [rbx + 2], dl
mov byte [rbx + 0xa], al
movzx eax, byte [rbx + 6]
movzx edx, byte [rbx + 0xe]
mov byte [rbx + 6], dl
mov byte [rbx + 0xe], al
movzx eax, byte [rbx + 3]
movzx edx, byte [rbx + 7]
mov byte [rbx + 3], dl
movzx edx, byte [rbx + 0xb]
mov byte [rbx + 7], dl
movzx edx, byte [rbx + 0xf]
mov byte [rbx + 0xb], dl
mov byte [rbx + 0xf], al
mov rcx, qword [rsp + 0x40]
add rcx, 0x14
lea r8, [0x005b58a0]
mov rdx, qword [rsp + 0x30]
lea rax, [rdx - 0x10]
movzx r9d, byte [rax]
movzx r9d, byte [r8 + r9]
mov byte [rax], r9b
add rax, 4
cmp rax, rdx
jne 0x40aabf
add rdx, 1
cmp rdx, rcx
jne 0x40aabb
mov r8, qword [rsp + 0xa8]
mov rdx, r13
mov ecx, 0
call fcn.0040a790
nop
add rsp, 0x58
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret