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

Disassembly:
sub rsp, 0x18
mov qword [rsp + 0x10], rbp
lea rbp, [rsp + 0x10]
mov qword [rsp + 0x20], rax
mov qword [rsp + 0x38], rdi
mov qword [rsp + 0x50], r9
mov rdx, rbx
shr rbx, 2
xor r8d, r8d
jmp 0x51f436
bswap edx
mov dword [rdi + r11*4], edx
lea r8, [r11 + 1]
mov rdx, r12
cmp r8, rbx
jge 0x51f481
mov r11, r8
shl r8, 2
cmp rdx, r8
jb 0x51f737
mov r12, rdx
sub rdx, r8
mov r13, r8
sub r8, rcx
sar r8, 0x3f
and r13, r8
nop
cmp rdx, 3
jbe 0x51f72a
mov edx, dword [rax + r13]
cmp rsi, r11
ja 0x51f429
jmp 0x51f71f
mov dword [rdi + r8*4], r13d
inc r8
cmp rsi, r8
jle 0x51f5e0
lea rax, [r8 - 1]
cmp rsi, rax
jbe 0x51f717
mov edx, dword [rdi + r8*4 - 4]
nop dword [rax]
test rbx, rbx
je 0x51f712
mov rax, r8
mov ecx, edx
cmp rbx, 0xffffffffffffffff
je 0x51f4bb
cqo
idiv rbx
jmp 0x51f4c0
neg rax
xor edx, edx
test rdx, rdx
jne 0x51f542
lea rdx, [rax - 1]
rol ecx, 8
mov r11d, ecx
shr ecx, 0x18
lea r12, str.cw
movzx r13d, byte [rcx + r12]
shl r13d, 0x18
mov r15d, r11d
shr r11d, 0x10
movzx r11d, r11b
movzx r11d, byte [r11 + r12]
shl r11d, 0x10
or r13d, r11d
mov r11d, r15d
shr r15d, 8
movzx r15d, r15b
movzx r15d, byte [r15 + r12]
shl r15d, 8
or r15d, r13d
movzx r11d, r11b
movzx r11d, byte [r11 + r12]
or r11d, r15d
nop dword [rax]
cmp rdx, 0x10
jae 0x51f705
lea rdx, [0x007e5aa0]
movzx r13d, byte [rax + rdx - 1]
shl r13d, 0x18
xor r13d, r11d
nop
jmp 0x51f5b5
cmp rbx, 6
jle 0x51f5a2
cmp rdx, 4
jne 0x51f5a2
mov r11d, ecx
shr ecx, 0x18
lea r12, str.cw
movzx edx, byte [rcx + r12]
shl edx, 0x18
mov r13d, r11d
shr r11d, 0x10
movzx r11d, r11b
movzx r11d, byte [r11 + r12]
shl r11d, 0x10
or edx, r11d
mov r11d, r13d
shr r13d, 8
movzx r13d, r13b
movzx r13d, byte [r13 + r12]
shl r13d, 8
or edx, r13d
movzx r11d, r11b
movzx r11d, byte [r11 + r12]
or edx, r11d
nop
jmp 0x51f5ab
lea r12, str.cw
mov edx, ecx
mov r13d, edx
lea rdx, [0x007e5aa0]
mov rax, r8
sub rax, rbx
nop dword [rax + rax]
cmp rsi, rax
jbe 0x51f6f8
xor r13d, dword [rdi + rax*4]
cmp rsi, r8
ja 0x51f47a
jmp 0x51f6ed
test r9, r9
je 0x51f5e9
xor eax, eax
jmp 0x51f5fa
mov rbp, qword [rsp + 0x10]
add rsp, 0x18
ret
add rax, 4
mov rsi, rcx
cmp rsi, rax
jle 0x51f609
mov rcx, rsi
sub rsi, rax
xor edx, edx
jmp 0x51f620
mov rbp, qword [rsp + 0x10]
add rsp, 0x18
ret
mov dword [r9 + r8*4], ebx
inc rdx
nop word [rax + rax]
cmp rdx, 4
jge 0x51f5f3
lea rbx, [rdx - 4]
add rbx, rsi
cmp rcx, rbx
jbe 0x51f6e5
mov ebx, dword [rdi + rbx*4]
test rax, rax
jle 0x51f6b1
lea r8, [rax + 4]
cmp rcx, r8
jle 0x51f6b1
mov r8d, ebx
shr ebx, 0x18
lea r11, str.cw
movzx r12d, byte [r11 + rbx]
lea r13, [0x007f2220]
mov ebx, dword [r13 + r12*4]
mov r12d, r8d
shr r8d, 0x10
movzx r8d, r8b
movzx r8d, byte [r11 + r8]
lea r15, [0x007f2620]
xor ebx, dword [r15 + r8*4]
mov r8d, r12d
shr r12d, 8
movzx r12d, r12b
movzx r12d, byte [r11 + r12]
lea r15, [0x007f2a20]
xor ebx, dword [r15 + r12*4]
movzx r8d, r8b
movzx r8d, byte [r8 + r11]
lea r12, [0x007f2e20]
xor ebx, dword [r12 + r8*4]
jmp 0x51f6cd
lea r11, str.cw
lea r12, [0x007f2e20]
lea r13, [0x007f2220]
lea r15, [0x007f2a20]
lea r8, [rdx + rax]
cmp r10, r8
ja 0x51f613
mov rax, r8
mov rcx, r10
call fcn.00465060
mov rax, rbx
call fcn.00465060
mov rax, r8
mov rcx, rsi
call fcn.00465060
mov rcx, rsi
nop dword [rax + rax]
call fcn.00465060
mov rax, rdx
mov ecx, 0x10
call fcn.00465060
call fcn.00434a60
mov rcx, rsi
call fcn.00465060
mov rax, r11
mov rcx, rsi
call fcn.00465060
mov eax, 3
mov rcx, rdx
call fcn.00465060
mov rax, r8
mov rcx, rdx
nop dword [rax]
call fcn.00465120
nop
int3