Function at 0x405b20
Capabilities:
Encrypt data using rc4 prga

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
mov r9d, dword [rcx + 0x388]
movzx ebx, byte [rcx + 0x92]
mov rdx, rcx
movzx eax, byte [rdx + 0x91]
shl r9d, 4
and r9d, 0x10
cmp dword [rcx + 0x3cc], 1
mov r10d, eax
sbb ecx, ecx
sar r10b, 7
not ecx
and r10d, 0x44
and ecx, 0x25
test al, 0xc
setne r8b
and eax, 3
or r9d, eax
shl r8d, 2
or r9d, ecx
or r9d, r10d
or r9d, r8d
cmp bl, r9b
je 0x405cbe
mov eax, r9d
lea r8, [rdx + 0xf88]
mov byte [rdx + 0x92], r9b
and eax, 0x30
mov r10, qword [sym.lj_BC_ISLT]
cmp al, 0x10
je 0x405cd0
mov r11, qword [0x00471690]
mov rdi, qword [rdx + 0x16d8]
lea rcx, [sym.lj_vm_IITERN]
mov rsi, qword [rdx + 0x16f0]
mov rax, qword [rdx + 0x1708]
movzx ebp, word [r11 + 0xb4]
movzx r12d, word [r11 + 0xba]
add rbp, r10
add r12, r10
mov r13d, ebx
mov r14d, r9d
mov qword [rdx + 0x16d0], rdi
xor r13d, r9d
and r14d, 4
mov qword [rdx + 0x16e8], rsi
test r13b, 0x64
mov qword [rdx + 0x1688], rcx
mov qword [rdx + 0x1700], rax
je 0x405d20
test r14b, r14b
je 0x405dec
test r9b, 0x40
lea rcx, [sym.lj_vm_profhook]
je 0x405dd1
lea rsi, [r8 + 0x2c8]
mov rax, r8
nop dword [rax + rax]
mov qword [rax], rcx
add rax, 8
cmp rsi, rax
jne 0x405c40
mov eax, r9d
and eax, 1
and r13d, 1
je 0x405d90
test al, al
jne 0x405dab
mov eax, 0x59
nop dword [rax]
movzx ecx, word [r11 + rax*2]
add rcx, r10
mov qword [r8 + rax*8], rcx
add rax, 1
cmp rax, 0x9a
jne 0x405c70
mov qword [rdx + 0x1250], rbp
mov qword [rdx + 0x1268], r12
and r9d, 0x10
je 0x405cbe
and ebx, 0x10
jne 0x405cbe
mov ecx, dword [rdx + 0x95c]
lea rax, [rdx + 0xf08]
lea ecx, [rcx + rcx - 1]
mov word [rax], cx
add rax, 2
cmp r8, rax
jne 0x405cb2
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov r11, qword [0x00471690]
movzx edi, word [r11 + 0x9e]
movzx esi, word [r11 + 0xa4]
movzx ecx, word [r11 + 0x8c]
movzx eax, word [r11 + 0xaa]
movzx ebp, word [r11 + 0xb2]
movzx r12d, word [r11 + 0xb8]
add rdi, r10
add rsi, r10
add rcx, r10
add rax, r10
add rbp, r10
add r12, r10
jmp 0x405be1
test r14b, r14b
jne 0x405c4c
test r9b, 2
mov qword [rdx + 0x1200], rdi
mov qword [rdx + 0x1218], rsi
mov qword [rdx + 0x11b8], rcx
mov qword [rdx + 0x1230], rax
jne 0x405e37
mov rax, qword [rdx + 0x16a0]
mov qword [rdx + 0x11d0], rax
mov rax, qword [rdx + 0x16a8]
mov qword [rdx + 0x11d8], rax
mov rax, qword [rdx + 0x16b0]
mov qword [rdx + 0x11e0], rax
mov rax, qword [rdx + 0x16b8]
mov qword [rdx + 0x11e8], rax
jmp 0x405c4c
test al, al
jne 0x405c96
mov qword [rdx + 0x1250], rbp
mov qword [rdx + 0x1268], r12
jmp 0x405c96
mov rcx, qword [sym.lj_vm_callhook]
lea rax, [rdx + 0x1250]
lea r10, [r8 + 0x4d0]
mov qword [rax], rcx
add rax, 8
cmp rax, r10
jne 0x405dc0
jmp 0x405c96
lea rcx, [sym.lj_vm_inshook]
lea rax, [sym.lj_vm_record]
test r9b, 0x20
cmovne rcx, rax
jmp 0x405c2e
mov rax, qword [rdx + 0x1458]
lea rdi, [r8 + 8]
lea rsi, [rdx + 0x1458]
and rdi, 0xfffffffffffffff8
mov qword [rdx + 0xf88], rax
mov rax, qword [rdx + 0x1718]
mov qword [r8 + 0x2c0], rax
mov rax, r8
sub rax, rdi
sub rsi, rax
add eax, 0x2c8
shr eax, 3
test r9b, 2
mov ecx, eax
rep movsq qword [rdi], qword [rsi]
je 0x405c4c
mov rax, qword [sym.lj_vm_rethook]
mov qword [rdx + 0x11d0], rax
mov qword [rdx + 0x11d8], rax
mov qword [rdx + 0x11e0], rax
mov qword [rdx + 0x11e8], rax
jmp 0x405c4c