Function at 0x401850
Capabilities:
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, 0x38
lea r8, [rcx + 4]
mov r15, rcx
lea r11, [rcx + 0x14]
mov qword [rsp + 0x20], r8
lea r10, [rdx + 0x9c]
mov qword [rsp + 0x18], r11
sub r10, rcx
lea rax, [r8 - 4]
lea rcx, [r10 + r8]
movzx r9d, byte [rcx]
add rcx, 1
xor byte [rax], r9b
add rax, 1
cmp r8, rax
jne 0x401887
add r8, 4
cmp r11, r8
jne 0x40187f
lea rax, [rdx + 0x90]
sub rdx, r15
sub rax, r15
mov qword [rsp + 0x28], rdx
mov qword [rsp + 0x10], rax
lea rax, [r15 + 0x10]
mov qword [rsp + 8], rax
movzx edx, byte [r15 + 9]
movzx eax, byte [r15 + 0xd]
mov r8, qword [rsp + 0x18]
mov byte [r15 + 0xd], dl
movzx edx, byte [r15 + 5]
mov byte [r15 + 9], dl
movzx edx, byte [r15 + 1]
mov byte [r15 + 1], al
movzx eax, byte [r15 + 2]
mov byte [r15 + 5], dl
movzx edx, byte [r15 + 0xa]
mov byte [r15 + 0xa], al
movzx eax, byte [r15 + 6]
mov byte [r15 + 2], dl
movzx edx, byte [r15 + 0xe]
mov byte [r15 + 0xe], al
movzx eax, byte [r15 + 3]
mov byte [r15 + 6], dl
movzx edx, byte [r15 + 7]
mov byte [r15 + 3], dl
movzx edx, byte [r15 + 0xb]
mov byte [r15 + 7], dl
movzx edx, byte [r15 + 0xf]
mov byte [r15 + 0xf], al
mov byte [r15 + 0xb], dl
mov rdx, qword [rsp + 8]
lea rax, [rdx - 0x10]
movzx ecx, byte [rax]
lea rsi, [0x00406020]
add rax, 4
movzx ecx, byte [rsi + rcx]
mov byte [rax - 4], cl
cmp rdx, rax
jne 0x40193e
add rdx, 1
cmp r8, rdx
jne 0x40193a
mov rax, qword [rsp + 0x10]
mov rcx, qword [rsp + 0x20]
mov r10, qword [rsp + 0x18]
lea r9, [rax - 4]
lea rax, [rcx - 4]
lea rdx, [r9 + rcx]
movzx r8d, byte [rdx]
add rdx, 1
xor byte [rax], r8b
add rax, 1
cmp rcx, rax
jne 0x40197c
add rcx, 4
cmp r10, rcx
jne 0x401974
mov rbx, qword [rsp + 0x10]
cmp qword [rsp + 0x28], rbx
je 0x401b8d
mov rax, r15
mov qword [rsp + 0x80], r15
movzx r15d, byte [rax]
movzx r8d, byte [rax + 1]
movzx edx, byte [rax + 2]
lea edi, [r15 + r15]
mov r9d, r15d
shr r9b, 7
lea ecx, [r9 + r9]
add ecx, r9d
lea ecx, [rcx + rcx*8]
xor edi, ecx
lea ebp, [rdi + rdi]
mov ecx, edi
mov byte [rsp + 6], dil
shr cl, 7
lea r12d, [rcx + rcx]
add r12d, ecx
lea r12d, [r12 + r12*8]
xor r12d, ebp
lea r11d, [r12 + r12]
mov r9d, r12d
lea ebp, [rdx + rdx]
shr r9b, 7
lea ecx, [r9 + r9]
add ecx, r9d
lea ecx, [rcx + rcx*8]
xor r11d, ecx
mov ecx, r8d
shr cl, 7
mov byte [rsp + 7], r11b
lea r14d, [rcx + rcx]
add r14d, ecx
lea r14d, [r14 + r14*8]
lea ecx, [r8 + r8]
xor r14d, ecx
lea ebx, [r14 + r14]
mov ecx, r14d
shr cl, 7
lea esi, [rcx + rcx]
add esi, ecx
lea esi, [rsi + rsi*8]
xor esi, ebx
movzx ebx, byte [rax + 3]
lea r10d, [rsi + rsi]
mov ecx, esi
shr cl, 7
lea r11d, [rcx + rcx]
add r11d, ecx
mov ecx, edx
lea r11d, [r11 + r11*8]
shr cl, 7
lea r13d, [rcx + rcx]
xor r11d, r10d
add r13d, ecx
lea r13d, [r13 + r13*8]
xor r13d, ebp
mov ecx, r13d
shr cl, 7
lea ebp, [rcx + rcx]
add ebp, ecx
lea ecx, [rbp + rbp*8]
lea ebp, [r13 + r13]
xor ebp, ecx
mov ecx, ebp
shr cl, 7
lea r10d, [rcx + rcx]
add r10d, ecx
lea ecx, [r10 + r10*8]
lea r10d, [rbp + rbp]
xor r10d, ecx
movzx ecx, byte [rax + 3]
shr cl, 7
lea edi, [rcx + rcx]
add edi, ecx
lea ecx, [rdi + rdi*8]
lea edi, [rbx + rbx]
xor edi, ecx
mov ecx, edi
shr cl, 7
lea ebx, [rcx + rcx]
add ebx, ecx
lea ecx, [rbx + rbx*8]
lea ebx, [rdi + rdi]
xor ebx, ecx
mov ecx, ebx
shr cl, 7
lea r9d, [rcx + rcx]
add r9d, ecx
lea ecx, [r9 + r9*8]
lea r9d, [rbx + rbx]
xor r9d, ecx
mov ecx, r8d
xor r8d, r15d
xor ecx, edx
xor cl, byte [rax + 3]
xor cl, byte [rsp + 6]
xor ecx, r14d
xor ecx, r12d
xor ecx, ebp
xor cl, byte [rsp + 7]
xor ecx, r11d
xor ecx, r10d
xor ecx, r9d
mov byte [rax], cl
mov ecx, r15d
xor ecx, edx
xor cl, byte [rax + 3]
xor ecx, r14d
movzx r14d, byte [rsp + 7]
xor ecx, r13d
xor ecx, esi
xor ecx, ebx
xor ecx, r14d
xor ecx, r11d
xor ecx, r10d
xor ecx, r9d
mov byte [rax + 1], cl
movzx ecx, byte [rax + 3]
xor ecx, r8d
xor r13d, ecx
mov ecx, r14d
xor r13d, edi
xor r13d, r12d
xor ebp, r13d
xor ebp, ecx
xor ebp, r11d
xor ebp, r10d
xor r8d, edx
movzx edx, byte [rsp + 6]
add rax, 4
xor ebp, r9d
mov byte [rax - 2], bpl
xor edx, r8d
xor edi, edx
xor esi, edi
xor ebx, esi
xor ebx, ecx
xor r11d, ebx
xor r10d, r11d
xor r9d, r10d
mov byte [rax - 1], r9b
cmp qword [rsp + 8], rax
jne 0x4019b4
mov r15, qword [rsp + 0x80]
sub qword [rsp + 0x10], 0x10
jmp 0x4018c4
add rsp, 0x38
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret