Function at 0x401320
Capabilities:
Encrypt data using aes
Reference aes constants

Disassembly:
sub rsp, 0x38
mov qword [rsp + 0x50], rsi
mov qword [rsp + 0x58], rdi
mov edi, dword [section..data]
mov qword [rsp + 0x28], r13
movzx r13d, byte [0x0047e004]
xor r8b, r8b
inc r13b
mov rsi, rdx
shl r13b, 2
test edi, edi
jle 0x401389
movzx edx, r8b
inc r8b
movzx eax, byte [rcx + rdx*4]
mov byte [rsi + rdx*4], al
movzx eax, byte [rcx + rdx*4 + 1]
mov byte [rsi + rdx*4 + 1], al
movzx eax, byte [rcx + rdx*4 + 2]
mov byte [rsi + rdx*4 + 2], al
movzx eax, byte [rcx + rdx*4 + 3]
mov byte [rsi + rdx*4 + 3], al
mov edi, dword [section..data]
movzx eax, r8b
cmp eax, edi
jl 0x401352
cmp dil, r13b
mov qword [rsp + 0x30], r12
movzx r12d, dil
jae 0x4015ed
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x48], rbp
mov qword [rsp + 0x20], r14
movzx r14d, dil
mov qword [rsp + 0x18], r15
lea r15, str.cw
lea rbp, [rsi + r14*4 - 3]
jmp 0x4013d6
mov edi, dword [section..data]
movzx r9d, byte [rbp - 1]
movzx r8d, byte [rbp]
movzx r10d, byte [rbp + 1]
movzx r11d, byte [rbp + 2]
movzx eax, r12b
mov byte [rsp], r9b
cdq
mov byte [rsp + 1], r8b
mov byte [rsp + 2], r10b
mov byte [rsp + 3], r11b
idiv edi
test edx, edx
mov ebx, eax
jne 0x401514
lea rax, [rsp + 1]
lea r8, [rsp]
movzx ecx, byte [rax]
mov byte [rsp], cl
movzx ecx, byte [rax + 1]
mov byte [rsp + 1], cl
movzx ecx, byte [rax + 2]
mov byte [rsp + 3], r9b
mov byte [rsp + 2], cl
lea r9d, [rdx + 4]
nop
nop
nop
movzx ecx, byte [r8]
inc r8
mov eax, ecx
shr eax, 4
mov edx, eax
mov al, cl
and eax, 0xf
shl rdx, 4
add rdx, rax
dec r9
movzx eax, byte [rdx + r15]
mov byte [r8 - 1], al
jne 0x401440
cmp bl, 1
jne 0x401479
movzx r8d, bl
mov byte [0x0047e210], bl
jmp 0x4014e7
cmp bl, 1
jbe 0x4014e0
add bl, 0xff
mov r8b, 2
movzx eax, bl
mov byte [0x0047e210], r8b
dec eax
test eax, eax
jle 0x4014e7
nop
nop
nop
movzx ecx, r8b
mov dl, 2
mov r9d, 8
xor r8b, r8b
nop
test dl, 1
je 0x4014b8
xor r8b, cl
movzx eax, cl
add cl, cl
and al, 0x80
je 0x4014c4
xor cl, 0x1b
shr dl, 1
dec r9
jne 0x4014b0
add bl, 0xff
mov byte [0x0047e210], r8b
movzx eax, bl
dec eax
test eax, eax
jg 0x4014a0
jmp 0x4014e7
mov r8b, byte [0x0047e210]
mov r9b, byte [rsp]
mov r10b, byte [rsp + 2]
mov r11b, byte [rsp + 3]
xor r10b, byte [0x0047e212]
xor r9b, r8b
mov r8b, byte [rsp + 1]
xor r8b, byte [0x0047e211]
xor r11b, byte [0x0047e213]
jmp 0x40156b
cmp edi, 6
jle 0x40156b
cmp edx, 4
jne 0x40156b
lea r8, [rsp]
mov r9d, edx
nop
nop
nop
movzx ecx, byte [r8]
inc r8
mov eax, ecx
shr eax, 4
mov edx, eax
mov al, cl
and eax, 0xf
shl rdx, 4
add rdx, rax
dec r9
movzx eax, byte [rdx + r15]
mov byte [r8 - 1], al
jne 0x401530
mov r11b, byte [rsp + 3]
mov r10b, byte [rsp + 2]
mov r8b, byte [rsp + 1]
mov r9b, byte [rsp]
movsxd rax, edi
mov rcx, r14
inc r12b
sub rcx, rax
add rbp, 4
movzx eax, byte [rsi + rcx*4]
mov rcx, r14
xor al, r9b
mov byte [rbp - 1], al
movsxd rax, dword [section..data]
sub rcx, rax
movzx eax, byte [rsi + rcx*4 + 1]
mov rcx, r14
xor al, r8b
mov byte [rbp], al
movsxd rax, dword [section..data]
sub rcx, rax
movzx eax, byte [rsi + rcx*4 + 2]
mov rcx, r14
inc r14
xor al, r10b
mov byte [rbp + 1], al
movsxd rax, dword [section..data]
sub rcx, rax
movzx eax, byte [rsi + rcx*4 + 3]
xor al, r11b
cmp r12b, r13b
mov byte [rbp + 2], al
jb 0x4013d0
mov r15, qword [rsp + 0x18]
mov r14, qword [rsp + 0x20]
mov rbp, qword [rsp + 0x48]
mov rbx, qword [rsp + 0x40]
mov r13, qword [rsp + 0x28]
mov r12, qword [rsp + 0x30]
mov rdi, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x50]
add rsp, 0x38
ret