Function at 0x140046d61
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 r14d, dword [rsp + 0xb0]
mov qword [rsp + 0x20], rdx
mov rbx, rcx
mov r15d, r8d
mov qword [rsp + 0x28], r9
test rcx, rcx
je 0x1400472a7
cmp r8d, 0x20
ja 0x1400472a7
mov eax, 0x10101
shl rax, 0x10
bt rax, r8
setb r13b
test r13b, r13b
je 0x1400472a7
xor eax, eax
mov dword [rcx + 0xf4], r8d
mov rdx, r9
mov dword [rcx + 0x3a8], eax
mov eax, r8d
shr eax, 2
add eax, 6
mov dword [rcx + 0xf0], eax
call fcn.140046d26
test eax, eax
jne 0x1400472ac
mov rsi, qword [rsp + 0x20]
mov rbp, rcx
mov rdi, rbx
mov ecx, r8d
rep movsb byte [rdi], byte [rsi]
mov rdx, rbx
mov rcx, rbx
mov rdi, rbx
call fcn.140046cd1
mov rsi, qword [rsp + 0x20]
mov ecx, r15d
mov r8d, r15d
rep movsb byte [rdi], byte [rsi]
mov rcx, rbx
call fcn.140046cd1
cmp r15d, 0x18
lea r8, [0x1400a33c0]
lea r10, [0x1400a23c0]
je 0x140046e40
cmp r15d, 0x20
jne 0x140046e4f
lea r11, [rbx + 0xc0]
mov rcx, rbx
jmp 0x140046f5c
lea r11, [rbx + 0xa8]
mov rcx, rbx
jmp 0x140046ed3
lea r11, [rbx + 0x90]
mov rcx, rbx
mov edx, dword [rcx + 0xc]
mov esi, dword [rcx]
add r8, 4
xor esi, dword [r8 - 4]
movzx eax, dl
mov eax, dword [r10 + rax*4]
and eax, 0xff00
xor eax, esi
mov esi, edx
shr esi, 0x18
movzx esi, byte [r10 + rsi*4 + 0x400]
xor eax, esi
mov esi, edx
shr esi, 0x10
movzx esi, sil
mov esi, dword [r10 + rsi*4 + 0x800]
and esi, 0xff000000
xor eax, esi
movzx esi, dh
mov esi, dword [r10 + rsi*4 + 0xc00]
and esi, 0xff0000
xor eax, esi
mov dword [rcx + 0x10], eax
xor eax, dword [rcx + 4]
mov dword [rcx + 0x14], eax
xor eax, dword [rcx + 8]
mov dword [rcx + 0x18], eax
xor eax, edx
mov dword [rcx + 0x1c], eax
cmp rcx, r11
je 0x140047037
add rcx, 0x10
jmp 0x140046e59
mov edx, dword [rcx + 0x14]
mov esi, dword [rcx]
add r8, 4
xor esi, dword [r8 - 4]
movzx eax, dl
mov eax, dword [r10 + rax*4]
and eax, 0xff00
xor eax, esi
mov esi, edx
shr esi, 0x18
movzx esi, byte [r10 + rsi*4 + 0x400]
xor eax, esi
mov esi, edx
shr esi, 0x10
movzx esi, sil
mov esi, dword [r10 + rsi*4 + 0x800]
and esi, 0xff000000
xor eax, esi
movzx esi, dh
mov esi, dword [r10 + rsi*4 + 0xc00]
and esi, 0xff0000
xor eax, esi
mov dword [rcx + 0x18], eax
xor eax, dword [rcx + 4]
mov dword [rcx + 0x1c], eax
xor eax, dword [rcx + 8]
mov dword [rcx + 0x20], eax
xor eax, dword [rcx + 0xc]
mov dword [rcx + 0x24], eax
cmp rcx, r11
je 0x140047037
xor eax, dword [rcx + 0x10]
add rcx, 0x18
mov dword [rcx + 0x10], eax
xor eax, edx
mov dword [rcx + 0x14], eax
jmp 0x140046ed3
mov edx, dword [rcx + 0x1c]
mov esi, dword [rcx]
add r8, 4
xor esi, dword [r8 - 4]
movzx eax, dl
mov eax, dword [r10 + rax*4]
and eax, 0xff00
xor eax, esi
mov esi, edx
shr esi, 0x18
movzx esi, byte [r10 + rsi*4 + 0x400]
xor eax, esi
mov esi, edx
shr esi, 0x10
movzx esi, sil
mov esi, dword [r10 + rsi*4 + 0x800]
and esi, 0xff000000
xor eax, esi
movzx esi, dh
mov esi, dword [r10 + rsi*4 + 0xc00]
and esi, 0xff0000
xor eax, esi
mov dword [rcx + 0x20], eax
xor eax, dword [rcx + 4]
mov dword [rcx + 0x24], eax
xor eax, dword [rcx + 8]
mov dword [rcx + 0x28], eax
xor eax, dword [rcx + 0xc]
mov dword [rcx + 0x2c], eax
cmp rcx, r11
je 0x140047037
mov esi, eax
movzx edi, ah
movzx r15d, al
add rcx, 0x20
shr esi, 0x10
mov edi, dword [r10 + rdi*4]
movzx esi, sil
mov esi, dword [r10 + rsi*4 + 0xc00]
and edi, 0xff00
and esi, 0xff0000
or esi, edi
mov edi, eax
xor esi, dword [rcx - 0x10]
movzx eax, byte [r10 + r15*4 + 0x400]
shr edi, 0x18
mov edi, dword [r10 + rdi*4 + 0x800]
and edi, 0xff000000
or eax, edi
xor eax, esi
mov dword [rcx + 0x10], eax
xor eax, dword [rcx - 0xc]
mov dword [rcx + 0x14], eax
xor eax, dword [rcx - 8]
mov dword [rcx + 0x18], eax
xor eax, edx
mov dword [rcx + 0x1c], eax
jmp 0x140046f5c
lea r11, [rsp + 0x3c]
mov dword [rsp + 0x3c], edx
mov edx, 4
mov rcx, r11
call fcn.1400450eb
dec r14d
je 0x14004706f
mov rdx, qword [rsp + 0x28]
mov rcx, rbx
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
jmp fcn.140046d26
mov eax, dword [rbx + 0xf0]
xor ecx, ecx
xor edx, edx
shl eax, 2
cmp edx, eax
jae 0x1400470ea
mov ecx, edx
lea r8, [rbx + rcx*4]
mov ecx, eax
lea rcx, [rbx + rcx*4]
mov esi, dword [r8]
mov edi, dword [rcx]
mov dword [r8], edi
mov dword [rcx], esi
lea ecx, [rdx + 1]
lea r8, [rbx + rcx*4]
lea ecx, [rax + 1]
lea rcx, [rbx + rcx*4]
mov esi, dword [r8]
mov edi, dword [rcx]
mov dword [r8], edi
mov dword [rcx], esi
lea ecx, [rdx + 2]
lea r8, [rbx + rcx*4]
lea ecx, [rax + 2]
lea rcx, [rbx + rcx*4]
mov esi, dword [r8]
mov edi, dword [rcx]
mov dword [r8], edi
mov dword [rcx], esi
lea ecx, [rdx + 3]
add edx, 4
lea r8, [rbx + rcx*4]
lea ecx, [rax + 3]
sub eax, 4
lea rcx, [rbx + rcx*4]
mov r12d, dword [r8]
mov esi, dword [rcx]
mov dword [r8], esi
mov dword [rcx], r12d
mov ecx, r13d
jmp 0x14004707c
test cl, cl
je 0x1400470f3
mov dword [rsp + 0x3c], r12d
mov edx, 4
mov rcx, r11
mov esi, 1
call fcn.1400450eb
lea rax, [0x1400a13c0]
cmp esi, dword [rbx + 0xf0]
jae 0x140047052
mov r8d, dword [rbp + 0x10]
add rbp, 0x10
inc esi
mov edx, r8d
movzx r11d, r8b
mov ecx, r8d
movzx r11d, byte [r10 + r11*4 + 0x400]
shr edx, 0x18
movzx edi, ch
movzx edx, byte [r10 + rdx*4 + 0x400]
mov edx, dword [rax + rdx*4]
xor edx, dword [rax + r11*4 + 0xc00]
mov r11d, r8d
movzx r8d, byte [r10 + rdi*4 + 0x400]
shr r11d, 0x10
movzx r11d, r11b
movzx r11d, byte [r10 + r11*4 + 0x400]
xor edx, dword [rax + r11*4 + 0x400]
xor edx, dword [rax + r8*4 + 0x800]
mov r8d, dword [rbp + 4]
mov dword [rbp], edx
mov edx, r8d
movzx r11d, r8b
mov ecx, r8d
movzx r11d, byte [r10 + r11*4 + 0x400]
shr edx, 0x18
movzx edi, ch
movzx edx, byte [r10 + rdx*4 + 0x400]
mov edx, dword [rax + rdx*4]
xor edx, dword [rax + r11*4 + 0xc00]
mov r11d, r8d
movzx r8d, byte [r10 + rdi*4 + 0x400]
shr r11d, 0x10
movzx r11d, r11b
movzx r11d, byte [r10 + r11*4 + 0x400]
xor edx, dword [rax + r11*4 + 0x400]
xor edx, dword [rax + r8*4 + 0x800]
mov r8d, dword [rbp + 8]
mov dword [rbp + 4], edx
mov edx, r8d
movzx r11d, r8b
mov ecx, r8d
movzx r11d, byte [r10 + r11*4 + 0x400]
shr edx, 0x18
movzx edi, ch
movzx edx, byte [r10 + rdx*4 + 0x400]
mov edx, dword [rax + rdx*4]
xor edx, dword [rax + r11*4 + 0xc00]
mov r11d, r8d
movzx r8d, byte [r10 + rdi*4 + 0x400]
shr r11d, 0x10
movzx r11d, r11b
movzx r11d, byte [r10 + r11*4 + 0x400]
xor edx, dword [rax + r11*4 + 0x400]
xor edx, dword [rax + r8*4 + 0x800]
mov r8d, dword [rbp + 0xc]
mov dword [rbp + 8], edx
mov edx, r8d
movzx r11d, r8b
mov ecx, r8d
shr edx, 0x18
movzx edi, ch
movzx edx, byte [r10 + rdx*4 + 0x400]
movzx r11d, byte [r10 + r11*4 + 0x400]
mov edx, dword [rax + rdx*4]
xor edx, dword [rax + r11*4 + 0xc00]
mov r11d, r8d
movzx r8d, byte [r10 + rdi*4 + 0x400]
shr r11d, 0x10
movzx r11d, r11b
movzx r11d, byte [r10 + r11*4 + 0x400]
xor edx, dword [rax + r11*4 + 0x400]
xor edx, dword [rax + r8*4 + 0x800]
mov dword [rbp + 0xc], edx
jmp 0x14004710c
mov eax, 0xffffff53
add rsp, 0x48
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
pop r15
ret
mov eax, dword [rsp + 0x28]
cmp r8d, 0xf0
ja 0x1400475e9
test rcx, rcx
je 0x1400475e9
mov dword [rsp + 0x28], eax
jmp 0x140046d61
mov eax, 0xffffff53
ret
jmp 0x1400475ce