Function at 0x518150
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, 0x68
mov rax, qword [rsp + 0xd0]
mov qword [rsp + 0xc0], r8
mov r14, rcx
mov rbx, r9
mov rcx, qword [rsp + 0xc0]
xor r8d, r8d
and ecx, 0xf
je 0x518198
mov r8d, 0x10
sub r8, rcx
mov rcx, r8
mov r8d, 1
test r14, r14
je 0x518534
test rdx, rdx
je 0x518541
test rax, rax
je 0x518574
add rcx, qword [rsp + 0xc0]
mov r9, qword [rax]
mov qword [rsp + 0x30], rcx
add rcx, 0x20
mov qword [rax], rcx
test rbx, rbx
je 0x518527
mov dword [rsp + 0x2c], 9
cmp rcx, r9
ja 0x51833b
cmp qword [r14], 0
je 0x51855b
movdqu xmm0, xmmword [str.OAES]
lea rdi, [rbx + 0x20]
mov rcx, rdi
mov qword [rsp + 0x38], rdi
movups xmmword [rbx], xmm0
movzx eax, word [r14 + 8]
mov byte [rbx + 8], r8b
mov r8, qword [rsp + 0xc0]
mov word [rbx + 6], ax
movdqu xmm1, xmmword [r14 + 0xa]
movups xmmword [rbx + 0x10], xmm1
call sym.memcpy
cmp qword [rsp + 0x30], 0
je 0x518527
mov rax, 0xffffffffffffffe0
mov dword [rsp + 0x2c], 0
movzx r11d, word [r14 + 8]
mov r15, r14
sub rax, rbx
lea rsi, [rsp + 0x50]
mov qword [rsp + 0x40], rax
nop dword [rax]
mov rdx, qword [rsp + 0x38]
add rdx, qword [rsp + 0xc0]
mov eax, 0x10
mov rbx, rsi
sub rdx, rdi
cmp rdx, 0x10
cmova rdx, rax
mov rax, rdi
mov r9d, edx
cmp edx, 8
jae 0x518350
xor ecx, ecx
test r9b, 4
je 0x5182a0
mov ecx, dword [rax]
mov dword [rbx], ecx
mov ecx, 4
test r9b, 2
je 0x5182b2
movzx ebp, word [rax + rcx]
mov word [rbx + rcx], bp
add rcx, 2
and r9d, 1
je 0x5182bf
movzx eax, byte [rax + rcx]
mov byte [rbx + rcx], al
mov ecx, 0x11
mov ebx, 0x10
mov eax, 1
sub rcx, rdx
lea r9, [rsi + rdx]
cmp rbx, rdx
je 0x5182ee
nop word [rax + rax]
mov byte [r9 + rax - 1], al
add rax, 1
cmp rcx, rax
jne 0x5182e0
and r11d, 2
jne 0x518500
mov eax, dword [rsp + 0x2c]
test eax, eax
je 0x518378
mov rax, qword [rsp + 0x50]
mov rdx, qword [rsp + 0x58]
mov qword [rdi], rax
mov qword [rdi + 8], rdx
movzx r11d, word [r15 + 8]
test r11b, 2
je 0x518324
mov qword [r15 + 0xa], rax
mov qword [r15 + 0x12], rdx
mov rax, qword [rsp + 0x40]
add rdi, 0x10
add rax, rdi
cmp qword [rsp + 0x30], rax
ja 0x518260
mov eax, dword [rsp + 0x2c]
add rsp, 0x68
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov ebp, edx
xor eax, eax
and ebp, 0xfffffff8
mov ecx, eax
add eax, 8
mov r8, qword [rdi + rcx]
mov qword [rsi + rcx], r8
cmp eax, ebp
jb 0x518357
lea rbx, [rsi + rax]
add rax, rdi
jmp 0x51828f
mov rcx, qword [r15]
test rcx, rcx
je 0x51854e
mov rdx, qword [rcx + 0x18]
xor ebx, ebx
nop word [rax + rax]
movzx eax, byte [rdx + rbx]
xor byte [rsi + rbx], al
add rbx, 1
cmp rbx, 0x10
jne 0x518390
mov rax, qword [rcx + 0x20]
sub rax, 1
cmp rax, 1
jbe 0x518568
sub rbx, rsi
mov r12d, 1
lea rax, [rsp + 0x58]
mov qword [rsp + 0x48], rdi
lea rcx, [rsp + 0x5c]
lea r14, [rsi + 0x10]
mov qword [rsp + 0xb0], r15
mov rdi, r12
mov r15, rsi
lea rbp, [0x0091a780]
mov rsi, rbx
mov r12, rcx
lea r13, [rsp + 0x54]
mov rbx, rax
nop word [rax + rax]
mov rcx, r15
nop dword [rax + rax]
movzx eax, byte [rcx]
add rcx, 1
mov rdx, rax
and eax, 0xf0
and edx, 0xf
add rax, rbp
movzx eax, byte [rax + rdx]
mov byte [rcx - 1], al
cmp r14, rcx
jne 0x518400
mov rcx, r15
call sym.oaes_shift_rows
call sym.oaes_mix_cols
mov rcx, r13
call sym.oaes_mix_cols
mov rcx, rbx
call sym.oaes_mix_cols
mov rcx, r12
call sym.oaes_mix_cols
mov rax, qword [rsp + 0xb0]
mov r9, qword [rax]
mov rax, r15
nop dword [rax]
mov rdx, qword [r9 + 0x18]
add rdx, rsi
movzx edx, byte [rdx + rax]
xor byte [rax], dl
add rax, 1
cmp r14, rax
jne 0x518458
mov rax, qword [r9 + 0x20]
add rdi, 1
add rsi, 0x10
sub rax, 1
cmp rdi, rax
jb 0x5183f8
mov rsi, r15
mov rdi, qword [rsp + 0x48]
mov r15, qword [rsp + 0xb0]
mov rcx, rsi
lea r9, [rsp + 0x60]
nop
movzx eax, byte [rcx]
add rcx, 1
mov rdx, rax
and eax, 0xf0
and edx, 0xf
add rax, rbp
movzx eax, byte [rax + rdx]
mov byte [rcx - 1], al
cmp r9, rcx
jne 0x5184a0
mov rcx, rsi
call sym.oaes_shift_rows
mov rdx, qword [r15]
mov rax, qword [rdx + 0x20]
lea rcx, [rax - 1]
xor eax, eax
shl rcx, 4
add rcx, qword [rdx + 0x18]
nop
movzx edx, byte [rcx + rax]
xor byte [rsi + rax], dl
add rax, 1
cmp rax, 0x10
jne 0x5184e0
jmp 0x518300
mov rax, rsi
lea rdx, [r15 + 0xa]
lea r9, [rsp + 0x60]
nop dword [rax]
movzx ecx, byte [rdx]
xor byte [rax], cl
add rax, 1
add rdx, 1
cmp r9, rax
jne 0x518510
jmp 0x5182f8
mov dword [rsp + 0x2c], 0
jmp 0x51833b
mov dword [rsp + 0x2c], 2
jmp 0x51833b
mov dword [rsp + 0x2c], 3
jmp 0x51833b
mov dword [rsp + 0x2c], 1
jmp 0x518300
mov dword [rsp + 0x2c], 7
jmp 0x51833b
lea rbp, [0x0091a780]
jmp 0x518497
mov dword [rsp + 0x2c], 6
jmp 0x51833b