Function at 0x14004b5d0
Capabilities:
Allocate or change rwx memory

Disassembly:
push rdi
sub rsp, 0x20
mov r10, rdx
mov rdi, rcx
test r8d, r8d
je 0x140039b18
mov rcx, qword [rcx + 0x9c8]
cmp rcx, rdx
jne 0x140039aec
cmp dword [rdi + 0x9c4], 0x20
je 0x140039b10
mov rdx, qword [rdi + 0x9e0]
lea r9, [rsp + 0x40]
mov r8d, 0x20
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x140039ada
mov rcx, rdi
call fcn.140039db0
mov dword [rdi + 0x9c4], 0x20
xor eax, eax
add rsp, 0x20
pop rdi
ret
mov rdx, qword [rdx + 8]
lea r9, [rsp + 0x40]
mov r8d, 0x20
mov rcx, r10
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x140039b10
mov rcx, rdi
call fcn.140039db0
xor eax, eax
add rsp, 0x20
pop rdi
ret
mov qword [rsp + 0x30], rbx
mov rbx, qword [rcx + 0x9c8]
cmp r10, rbx
jb 0x140039b80
mov rdx, qword [rcx + 0x9e0]
lea rax, [rdx + rbx]
cmp r10, rax
jae 0x140039b80
cmp dword [rcx + 0x9c4], 4
je 0x140039bb5
lea r9, [rsp + 0x40]
mov r8d, 4
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x140039b62
mov rcx, rdi
call fcn.140039db0
mov rax, rbx
mov dword [rdi + 0x9c4], 4
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
ret
mov rbx, qword [rbx]
cmp r10, rbx
jb 0x140039b80
mov rdx, qword [rbx + 8]
lea rax, [rdx + rbx]
cmp r10, rax
jae 0x140039b80
lea r9, [rsp + 0x40]
mov r8d, 4
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
jne 0x140039bb5
mov rcx, rdi
call fcn.140039db0
mov rax, rbx
mov rbx, qword [rsp + 0x30]
add rsp, 0x20
pop rdi
ret
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x20
mov rbx, qword [rdx + 0x40]
mov r15, rdx
mov edi, r8d
mov rdx, rbx
xor r8d, r8d
mov rbp, r9
mov r12, rcx
call 0x140039a90
mov r8d, dword [r15 + 0x3c]
lea esi, [r12 - 0x148]
mov ecx, edi
mov qword [rsp + 0x50], rax
and edi, 0x1f
shr rcx, 5
shl edi, 2
mov r13, rax
mov r14d, edi
lea rdi, [rbx - 6]
add r14, 0xfffffffffffffffa
add rdi, r8
add r14, qword [r12 + rcx*8 + 0x688]
cmp r8d, 5
jbe 0x14004b66d
lea eax, [r8 - 5]
cmp byte [rax + rbx], 0xe9
jne 0x14004b66d
movsxd rax, dword [r8 + rbx - 4]
add rax, 0xfffffffffffffffa
add rax, r8
add rax, rbx
cmp rax, r14
jne 0x14004b66d
mov eax, ebp
sub eax, ebx
sub eax, r8d
mov dword [r8 + rbx - 4], eax
cmp rbx, rdi
jae 0x14004b6d9
cmp dword [rbx + 3], esi
jne 0x14004b67c
cmp byte [rbx], 0xc7
je 0x14004b690
mov rcx, rbx
call fcn.14004ab50
mov eax, eax
add rbx, rax
cmp rbx, rdi
jb 0x14004b672
jmp 0x14004b6d9
cmp rbx, rdi
jae 0x14004b6d9
mov esi, 0xf0ff
mov r13d, 0x800f
movzx eax, word [rbx]
and ax, si
cmp ax, r13w
jne 0x14004b6c2
movsxd rax, dword [rbx + 2]
add rax, rbx
cmp rax, r14
jne 0x14004b6c2
mov eax, ebp
sub eax, ebx
sub eax, 6
mov dword [rbx + 2], eax
mov rcx, rbx
call fcn.14004ab50
mov eax, eax
add rbx, rax
cmp rbx, rdi
jb 0x14004b6a0
mov r13, qword [rsp + 0x50]
mov rcx, qword [r15 + 0x40]
mov edx, dword [r15 + 0x3c]
add rdx, rcx
call sym.luajit.exe_luaJIT_version_2_1_0_beta3
mov r8d, 1
mov rdx, r13
mov rcx, r12
mov rbx, qword [rsp + 0x58]
mov rbp, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
add rsp, 0x20
pop r15
pop r14
pop r13
pop r12
pop rdi
jmp 0x140039a90