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

Disassembly:
push r15
push r14
push r13
push r12
push rsi
push rdi
push rbp
push rbx
sub rsp, 0x68
mov rbp, rdx
mov qword [rsp + 0x48], rcx
mov eax, dword [rbp + 8]
mov ecx, eax
sar ecx, 0x1f
shr ecx, 0x1c
add ecx, eax
and ecx, 0xfffffff0
sub eax, ecx
mov ecx, 0x10
sub ecx, eax
movsxd rsi, ecx
mov r14d, 0x2ff214f5
xor ebx, ebx
mov r15d, 0x1fe571ec
movzx r13d, sil
mov r12, 0xffffffffffffffff
mov eax, 0x2ff214f5
jmp 0x40e187
cmp eax, 0x337c163d
mov ecx, 0
cmove rcx, r12
cmove eax, r14d
sub rbx, rcx
cmp rbx, rsi
mov edi, 0x3de55199
cmovb edi, r15d
jmp 0x40e1a2
mov eax, edi
nop word cs:[rax + rax]
cmp eax, 0x337c163d
jae 0x40e1d2
cmp eax, 0x2ff214f5
jae 0x40e1e2
cmp eax, 0x1fe571ec
jne 0x40e1a2
mov rcx, rbp
mov edx, r13d
call fcn.00410a32
mov eax, 0x337c163d
jmp 0x40e1a2
cmp eax, 0x3de55199
jb 0x40e172
jne 0x40e1a2
jmp 0x40e1e6
jne 0x40e1a2
jmp 0x40e195
mov r12, qword [rsp + 0x48]
lea rdx, [r12 + 0xb0]
mov r14, qword [rbp]
movsxd rbp, dword [rbp + 8]
mov eax, 0x5ec1b126
xor ebx, ebx
mov esi, 0x662dd734
mov r15d, 0x723454a6
mov r13d, 0x39b04c59
mov qword [rsp + 0x60], rdx
jmp 0x40e22b
add rbx, 0x10
mov eax, 0x5ec1b126
cmp rbx, rbp
mov ecx, 0xbbcc8af8
cmovb ecx, esi
jmp 0x40e242
mov eax, ecx
nop dword [rax + rax]
cmp eax, 0x5ec1b126
jge 0x40e262
cmp eax, 0xc1e8a6dc
jge 0x40e272
cmp eax, 0xbbcc8af8
jne 0x40e242
jmp 0x40e7b2
cmp eax, 0x662dd734
jge 0x40e282
cmp eax, 0x5ec1b126
jne 0x40e242
jmp 0x40e238
jne 0x40e242
jmp 0x40e222
jne 0x40e242
mov qword [rsp + 0x50], rbx
mov qword [rsp + 0x58], rbp
mov rcx, r14
call fcn.0040e832
xor ecx, ecx
mov rdx, r14
mov r8, r12
call fcn.0040e8f2
mov edi, 0xb7601528
mov r8d, 0x3864f089
mov r9d, 0x47860d80
mov eax, 0xdffae87c
mov r10b, 1
lea rsi, [0x0044ff52]
jmp 0x40e2e0
sete cl
mov edx, 0xdffae87c
cmove eax, edx
add r10b, cl
cmp r10b, 0xa
mov edx, 0xf8fbd4ea
mov ecx, 0xe2dae6d1
cmove edx, ecx
mov dword [rsp + 0x44], edx
jmp 0x40e312
cmp eax, 0xe2dae6d1
mov ecx, 0xb4862514
cmove eax, ecx
nop word cs:[rax + rax]
cmp eax, 0xe2dae6d1
jge 0x40e332
cmp eax, 0xdffae87c
jge 0x40e362
cmp eax, 0xb4862514
jne 0x40e312
jmp 0x40e782
cmp eax, 0xf8fbd4ea
jl 0x40e2f7
cmp eax, 0x250ac1ab
jge 0x40e2d2
cmp eax, 0xf8fbd4ea
jne 0x40e312
mov eax, 0x350693c7
xor esi, esi
jmp 0x40e48d
jne 0x40e312
mov edx, 0xb7601528
xor eax, eax
jmp 0x40e382
sete bl
cmove edx, edi
add al, bl
nop word cs:[rax + rax]
cmp edx, 0x39423008
jge 0x40e3b2
cmp edx, 0xf645eeb1
jge 0x40e3e2
cmp edx, 0xb7601528
jge 0x40e42b
cmp edx, 0xa14e5e6d
cmove edx, r15d
jmp 0x40e382
cmp edx, 0x47860d80
jge 0x40e402
cmp edx, 0x39b04c59
jge 0x40e441
cmp edx, 0x39423008
jne 0x40e382
neg cl
mov bl, 1
sub bl, cl
mov edx, 0x47860d80
mov cl, bl
jmp 0x40e382
cmp edx, 0x3864f089
jge 0x40e457
cmp edx, 0xf645eeb1
jne 0x40e382
jmp 0x40e715
cmp edx, 0x723454a6
jge 0x40e36d
cmp edx, 0x47860d80
jne 0x40e382
cmp cl, 4
mov edx, 0xa14e5e6d
cmovb edx, r8d
jmp 0x40e382
jne 0x40e382
cmp al, 4
mov edx, 0xf645eeb1
cmovb edx, r13d
jmp 0x40e382
cmp edx, 0x39b04c59
jne 0x40e44e
mov ecx, 0
cmove edx, r9d
jmp 0x40e382
jne 0x40e382
movzx edx, al
movzx ebp, cl
lea rbp, [r14 + rbp*4]
movzx ebx, byte [rdx + rbp]
movzx ebx, byte [rbx + rsi]
mov byte [rdx + rbp], bl
mov edx, 0x39423008
jmp 0x40e382
mov edx, 0x350693c7
cmove eax, edx
sub sil, cl
movzx esi, sil
cmp sil, 4
mov edx, 0xb219e475
mov ecx, 0x1b0eb8dc
cmovb edx, ecx
jmp 0x40e4b2
mov eax, edx
nop word cs:[rax + rax]
cmp eax, 0x350693c7
jge 0x40e4d2
cmp eax, 0x1b0eb8dc
jge 0x40e4f2
cmp eax, 0xb219e475
jne 0x40e4b2
jmp 0x40e6d9
cmp eax, 0x77b02019
jge 0x40e6c2
cmp eax, 0x350693c7
jne 0x40e4b2
jmp 0x40e4a4
jne 0x40e4b2
movzx ebp, byte [r14 + rsi*4]
movzx r15d, byte [r14 + rsi*4 + 1]
mov ecx, ebp
not ecx
mov eax, ecx
mov r8d, ecx
and eax, 0x28a84753
mov ecx, ebp
and ecx, 0xac
mov edi, r15d
not edi
mov dword [rsp + 0x40], edx
mov edx, edi
and edx, 0x28a84753
mov ebx, r15d
and ebx, 0xac
or ecx, eax
or ebx, edx
xor ebx, ecx
movzx r12d, byte [r14 + rsi*4 + 2]
mov dword [rsp + 0x2c], r12d
mov eax, ebx
not eax
and eax, 0xc0bcdd3f
and ebx, 0xc0
mov ecx, r12d
not ecx
mov dword [rsp + 0x3c], ecx
and ecx, 0xc0bcdd3f
and r12d, 0xc0
or ebx, eax
or r12d, ecx
xor r12d, ebx
movzx ecx, byte [r14 + rsi*4 + 3]
mov dword [rsp + 0x30], ecx
mov eax, r12d
not eax
and eax, ecx
xor ecx, 0xff
mov dword [rsp + 0x38], ecx
and r12d, ecx
or r12d, eax
mov eax, r15d
mov ebx, r8d
mov dword [rsp + 0x34], ebx
and eax, ebx
mov ecx, edi
and ecx, ebp
or ecx, eax
mov byte [rsp + 0x2b], r10b
call fcn.0040ea82
movzx eax, al
mov ecx, eax
not ecx
and ecx, r12d
mov r13d, r12d
not r13d
and eax, r13d
or eax, ecx
mov ecx, eax
and ecx, ebx
not eax
and eax, ebp
or eax, ecx
mov byte [r14 + rsi*4], al
mov eax, r15d
not al
mov ecx, dword [rsp + 0x2c]
and al, cl
mov ebx, ecx
not bl
mov ecx, ebx
and cl, r15b
or cl, al
movzx ecx, cl
call fcn.0040ea82
movzx eax, al
mov ecx, r13d
and ecx, eax
not eax
and eax, r12d
or eax, ecx
and edi, eax
not eax
and eax, r15d
or eax, edi
mov byte [r14 + rsi*4 + 1], al
mov ecx, dword [rsp + 0x30]
and bl, cl
mov eax, ecx
mov r15d, ecx
not al
mov edi, dword [rsp + 0x2c]
and al, dil
or al, bl
movzx ecx, al
call fcn.0040ea82
movzx eax, al
mov ecx, r13d
and ecx, eax
not eax
and eax, r12d
or eax, ecx
mov ecx, dword [rsp + 0x3c]
and ecx, eax
not eax
and eax, edi
or eax, ecx
mov byte [r14 + rsi*4 + 2], al
mov ebx, dword [rsp + 0x38]
mov eax, ebx
and eax, 0x46
mov edi, r15d
mov ecx, edi
and ecx, 0xb9
mov edx, dword [rsp + 0x34]
and edx, 0x46
and ebp, 0xb9
or ecx, eax
or ebp, edx
xor ebp, ecx
mov ecx, ebp
call fcn.0040ea82
mov edx, dword [rsp + 0x40]
movzx r10d, byte [rsp + 0x2b]
movzx eax, al
and r13d, eax
not eax
and eax, r12d
mov r15d, 0x723454a6
or r13d, eax
mov eax, ebx
and eax, r13d
not r13d
and r13d, edi
or r13d, eax
mov byte [r14 + rsi*4 + 3], r13b
mov r13d, 0x39b04c59
mov eax, 0x77b02019
jmp 0x40e4b2
cmp eax, 0x77b02019
mov cl, 0xff
je 0x40e482
mov ecx, 0
jmp 0x40e482
movzx ecx, r10b
mov rdx, r14
mov r12, qword [rsp + 0x48]
mov r8, r12
mov ebx, r10d
call fcn.0040e8f2
mov r10d, ebx
mov edi, 0xb7601528
mov r8d, 0x3864f089
mov r9d, 0x47860d80
mov eax, 0x250ac1ab
lea rsi, [0x0044ff52]
jmp 0x40e312
mov al, byte [r14 + 1]
mov cl, byte [r14 + 5]
mov byte [r14 + 1], cl
mov cl, byte [r14 + 9]
mov byte [r14 + 5], cl
mov cl, byte [r14 + 0xd]
mov byte [r14 + 9], cl
mov byte [r14 + 0xd], al
mov al, byte [r14 + 2]
mov cl, byte [r14 + 0xa]
mov byte [r14 + 2], cl
mov byte [r14 + 0xa], al
mov al, byte [r14 + 6]
mov cl, byte [r14 + 0xe]
mov byte [r14 + 6], cl
mov byte [r14 + 0xe], al
mov al, byte [r14 + 3]
mov cl, byte [r14 + 0xf]
mov byte [r14 + 3], cl
mov cl, byte [r14 + 0xb]
mov byte [r14 + 0xf], cl
mov cl, byte [r14 + 7]
mov byte [r14 + 0xb], cl
mov byte [r14 + 7], al
mov eax, dword [rsp + 0x44]
jmp 0x40e312
mov ecx, 0xa
mov rdx, r14
mov r8, r12
call fcn.0040e8f2
mov eax, 0xc1e8a6dc
mov rdx, r14
lea r14, [r14 + 0x10]
mov rbp, qword [rsp + 0x58]
mov rbx, qword [rsp + 0x50]
mov esi, 0x662dd734
jmp 0x40e22b
mov rax, qword [0x0045042a]
movabs rcx, 0x1561cac9a301c9a
and rcx, rax
not rax
movabs rbp, 0xfea9e35365cfe365
and rbp, rax
or rcx, rbp
movabs rax, 0x4080a3518e20001a
xor rax, rcx
movabs rbp, 0xbe29400221112981
xor rbp, rcx
movabs rcx, 0xbe39540a31df6bc5
and rcx, rbp
movabs rbp, 0x41c6abf5ce20943a
and rbp, rax
or rbp, rcx
mov r8d, 0x10
mov rcx, qword [rsp + 0x60]
call rbp
mov al, 1
add rsp, 0x68
pop rbx
pop rbp
pop rdi
pop rsi
pop r12
pop r13
pop r14
pop r15
ret