Function at 0x402160
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, 0x48
mov rax, rdx
mov rdi, rcx
mov qword [rsp + 0x90], rcx
add rdi, 0x10
add rax, 0xa0
mov qword [rsp + 0x98], rdx
cmp rax, rdi
mov qword [rsp + 0x20], rdi
jae 0x4021ac
mov rax, rdx
add rax, 0xb0
cmp rcx, rax
jb 0x402606
mov rax, qword [rsp + 0x98]
movdqu xmm2, xmmword [rax + 0xa0]
mov rax, qword [rsp + 0x90]
movdqa xmm0, xmm2
movaps xmmword [rsp], xmm2
movdqu xmm3, xmmword [rax]
mov r15, rax
pxor xmm0, xmm3
movaps xmmword [rsp + 0x10], xmm3
movups xmmword [rax], xmm0
mov rax, qword [rsp + 0x98]
add rax, 0x90
mov qword [rsp + 0x30], rax
movzx eax, byte [r15]
lea rbx, [0x00407b40]
movzx ebp, byte [rbx + rax]
movzx eax, byte [r15 + 4]
movzx r11d, byte [rbx + rax]
movzx eax, byte [r15 + 8]
movzx eax, byte [rbx + rax]
mov byte [rsp + 0x10], al
movzx eax, byte [r15 + 0xc]
movzx edi, byte [rbx + rax]
movzx eax, byte [r15 + 0xd]
mov byte [rsp + 0x2c], dil
movzx edi, byte [rbx + rax]
movzx eax, byte [r15 + 1]
movzx r10d, byte [rbx + rax]
movzx eax, byte [r15 + 5]
movzx esi, byte [rbx + rax]
movzx eax, byte [r15 + 9]
mov byte [rsp + 0x2d], sil
movzx edx, byte [rbx + rax]
movzx eax, byte [r15 + 0xa]
mov byte [rsp + 0x2e], dl
mov rdx, rbx
movzx esi, byte [rbx + rax]
movzx eax, byte [r15 + 0xe]
movzx r9d, byte [rbx + rax]
movzx eax, byte [r15 + 2]
movzx ecx, byte [rbx + rax]
movzx eax, byte [r15 + 6]
mov byte [rsp + 0x2f], cl
movzx r12d, byte [rbx + rax]
movzx eax, byte [r15 + 7]
mov r13, r12
movzx ebx, byte [rbx + rax]
movzx eax, byte [r15 + 0xb]
movzx r14d, byte [rdx + rax]
movzx eax, byte [r15 + 0xf]
movzx r8d, byte [rdx + rax]
movzx eax, byte [r15 + 3]
movzx ecx, byte [rdx + rax]
movzx edx, r14b
movzx eax, r9b
shl rdx, 8
or rdx, rax
movzx eax, r10b
shl rdx, 8
or rdx, rax
movzx eax, r11b
shl rdx, 8
or rdx, rax
movzx eax, bl
shl rdx, 8
or rdx, rax
movzx eax, sil
shl rdx, 8
or rdx, rax
movzx eax, dil
shl rdx, 8
or rdx, rax
movzx eax, bpl
mov qword [rsp + 0x38], rax
movzx eax, cl
shl rdx, 8
or rdx, qword [rsp + 0x38]
shl rax, 8
or rax, r12
movzx r12d, byte [rsp + 0x2e]
shl rax, 8
mov qword [rsp], rdx
or rax, r12
movzx r12d, byte [rsp + 0x2c]
shl rax, 8
or rax, r12
movzx r12d, r8b
shl rax, 8
or rax, r12
movzx r12d, byte [rsp + 0x2f]
shl rax, 8
or rax, r12
movzx r12d, byte [rsp + 0x2d]
shl rax, 8
or rax, r12
movzx r12d, byte [rsp + 0x10]
shl rax, 8
mov rdx, rax
or rdx, r12
mov qword [rsp + 8], rdx
mov rdx, qword [rsp + 0x30]
movdqa xmm1, xmmword [rsp]
movups xmmword [r15], xmm1
xor bpl, byte [rdx]
mov byte [r15], bpl
xor dil, byte [rdx + 1]
mov byte [r15 + 1], dil
xor sil, byte [rdx + 2]
mov byte [r15 + 2], sil
xor bl, byte [rdx + 3]
mov byte [r15 + 3], bl
xor r11b, byte [rdx + 4]
mov byte [r15 + 4], r11b
xor r10b, byte [rdx + 5]
mov byte [r15 + 5], r10b
xor r9b, byte [rdx + 6]
mov byte [r15 + 6], r9b
xor r14b, byte [rdx + 7]
movzx eax, byte [rsp + 0x10]
movzx edi, byte [rsp + 0x2f]
mov byte [r15 + 7], r14b
xor al, byte [rdx + 8]
mov byte [r15 + 8], al
movzx eax, byte [rsp + 0x2d]
xor al, byte [rdx + 9]
mov byte [r15 + 9], al
xor dil, byte [rdx + 0xa]
movzx eax, byte [rsp + 0x2c]
mov byte [r15 + 0xa], dil
xor r8b, byte [rdx + 0xb]
mov byte [r15 + 0xb], r8b
xor al, byte [rdx + 0xc]
mov byte [r15 + 0xc], al
movzx eax, byte [rsp + 0x2e]
xor al, byte [rdx + 0xd]
mov byte [r15 + 0xd], al
movzx eax, byte [rdx + 0xe]
xor eax, r13d
mov byte [r15 + 0xe], al
xor cl, byte [rdx + 0xf]
cmp qword [rsp + 0x98], rdx
mov byte [r15 + 0xf], cl
je 0x4025f5
mov rax, r15
mov qword [rsp + 0x90], 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
mov ecx, edi
mov esi, edi
mov byte [rsp], dil
lea ebp, [rsi + rsi]
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 + 0x10], 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
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]
movzx edi, byte [rax + 3]
add edi, edi
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]
xor ecx, r14d
xor ecx, r12d
xor ecx, ebp
xor cl, byte [rsp + 0x10]
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 + 0x10]
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 r8d, edx
movzx edx, byte [rsp]
add rax, 4
xor ebp, r10d
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 rax, qword [rsp + 0x20]
jne 0x40241e
mov r15, qword [rsp + 0x90]
sub qword [rsp + 0x30], 0x10
jmp 0x4021f2
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
movzx eax, byte [rdx + 0xa0]
mov r15, rcx
xor byte [rcx], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xa1]
xor byte [rcx + 1], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xa2]
xor byte [rcx + 2], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xa3]
xor byte [rcx + 3], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xa4]
xor byte [rcx + 4], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xa5]
xor byte [rcx + 5], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xa6]
xor byte [rcx + 6], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xa7]
xor byte [rcx + 7], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xa8]
xor byte [rcx + 8], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xa9]
xor byte [rcx + 9], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xaa]
xor byte [rcx + 0xa], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xab]
xor byte [rcx + 0xb], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xac]
xor byte [rcx + 0xc], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xad]
xor byte [rcx + 0xd], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xae]
xor byte [rcx + 0xe], al
mov rax, qword [rsp + 0x98]
movzx eax, byte [rax + 0xaf]
xor byte [rcx + 0xf], al
jmp 0x4021df