Function at 0x18002a130
Capabilities:
Allocate or change rwx memory

Disassembly:
mov qword [rsp + 0x20], rbx
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
mov r12, rcx
lea rdi, [rdx + 0x1f]
and rdi, 0xffffffffffffffe0
mov qword [rsp + 0x78], rdi
jne 0x18002a162
xor eax, eax
jmp 0x18002a465
lea rbx, [rcx + 8]
mov qword [rsp + 0x80], rbx
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
nop
mov rsi, qword [r12 + 0x70]
mov r15, qword [r12 + 0x30]
test rsi, rsi
je 0x18002a292
nop dword [rax + rax]
mov rax, qword [rsi + 0x30]
sub rax, qword [rsi + 0x38]
cmp rax, rdi
jb 0x18002a26c
mov rcx, qword [rsi + 0x50]
cmp rcx, rdi
jae 0x18002a1b3
test rcx, rcx
jne 0x18002a26c
mov r14, qword [rsi + 0x58]
mov r11, qword [rsi + 0x40]
xor ecx, ecx
xor r9d, r9d
lea rax, [rdi - 1]
add rax, qword [rsi + 0x48]
xor edx, edx
div qword [rsi + 0x48]
mov rbp, rax
xor edi, edi
test r11, r11
je 0x18002a258
nop dword [rax]
mov r10, qword [r14]
lea r14, [r14 + 8]
cmp r10, 0xffffffffffffffff
jne 0x18002a1fb
cmp rcx, r9
cmovbe rcx, r9
mov r9, rcx
xor ecx, ecx
jmp 0x18002a24f
mov r8d, 0x40
lea rax, [rdi + 0x40]
cmp rax, r11
jbe 0x18002a210
mov r8, r11
sub r8, rdi
xor eax, eax
lea edx, [rax + 1]
test r8, r8
je 0x18002a24f
nop word [rax + rax]
inc rax
test r10, rdx
jne 0x18002a23b
inc rcx
cmp rcx, rbp
jne 0x18002a247
sub rax, rcx
add rdi, rax
jmp 0x18002a3d2
cmp rcx, r9
cmovbe rcx, r9
mov r9, rcx
xor ecx, ecx
add rdx, rdx
cmp rax, r8
jb 0x18002a220
add rdi, 0x40
cmp rdi, r11
jb 0x18002a1e0
imul r9, qword [rsi + 0x48]
mov qword [rsi + 0x50], r9
mov rsi, qword [rsi + 0x28]
mov rdi, qword [rsp + 0x78]
jmp 0x18002a289
mov rcx, qword [rsi + 0x28]
cmp rax, r15
jae 0x18002a286
cmp rsi, qword [r12 + 0x70]
jne 0x18002a286
test rcx, rcx
je 0x18002a286
mov qword [r12 + 0x70], rcx
mov rsi, rcx
test rsi, rsi
jne 0x18002a190
mov rsi, qword [r12 + 0x30]
mov r15, qword [r12 + 0x38]
cmp rsi, rdi
jae 0x18002a2aa
mov rsi, rdi
mov rdi, qword [r12]
jmp 0x18002a2b7
mov rdi, qword [r12]
test rsi, rsi
je 0x18002a457
call fcn.180029800
test rdi, rdi
jne 0x18002a2c5
mov rdi, qword [rax + 0x10]
mov rax, qword [rax]
lea rbp, [rax - 1]
add rbp, rsi
dec rax
not rax
and rbp, rax
mov dword [rsp + 0x20], 0x40
mov r9d, 0x3000
mov r8, rbp
xor edx, edx
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualAllocEx]
mov r12, rax
test rax, rax
je 0x18002a457
xor edx, edx
mov rax, rbp
div r15
mov r13, rax
lea rdi, [rax + 7]
shr rdi, 3
add rdi, 7
and rdi, 0xfffffffffffffff8
mov ecx, 0x68
call fcn.18004cea8
mov rsi, rax
mov eax, 2
mul rdi
mov rcx, 0xffffffffffffffff
cmovo rax, rcx
mov rcx, rax
call fcn.18004cea8
mov r14, rax
test rsi, rsi
je 0x18002a412
test rax, rax
je 0x18002a412
xor eax, eax
mov qword [rsi], rax
mov qword [rsi + 8], rax
mov qword [rsi + 0x10], r12
mov dword [rsi + 0x18], 1
mov qword [rsi + 0x20], rax
mov qword [rsi + 0x28], rax
mov qword [rsi + 0x30], rbp
mov qword [rsi + 0x38], rax
mov qword [rsi + 0x40], r13
mov qword [rsi + 0x48], r15
mov qword [rsi + 0x50], rbp
lea r8, [rdi + rdi]
xor edx, edx
mov rcx, r14
call fcn.1800634b0
mov qword [rsi + 0x58], r14
lea rax, [r14 + rdi]
mov qword [rsi + 0x60], rax
mov rdx, rsi
mov r12, qword [rsp + 0x70]
mov rcx, r12
call fcn.180029b70
xor edi, edi
mov rax, qword [rsp + 0x78]
dec rax
add rax, qword [rsi + 0x48]
xor edx, edx
div qword [rsi + 0x48]
mov rbp, rax
mov rax, qword [rsi + 0x30]
add qword [r12 + 0x48], rax
mov r8, rbp
mov rdx, rdi
mov rcx, qword [rsi + 0x58]
call fcn.180029aa0
lea r8, [rbp - 1]
mov rdx, rdi
mov rcx, qword [rsi + 0x60]
call fcn.180029aa0
imul rbp, qword [rsi + 0x48]
add qword [rsi + 0x38], rbp
mov qword [rsi + 0x50], 0
add qword [r12 + 0x50], rbp
imul rdi, qword [rsi + 0x48]
add rdi, qword [rsi + 0x10]
jmp 0x18002a459
mov rdi, qword [rsp + 0x70]
mov rdi, qword [rdi]
call fcn.180029800
test rdi, rdi
jne 0x18002a428
mov rdi, qword [rax + 0x10]
mov r9d, 0x8000
xor r8d, r8d
mov rdx, r12
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualFreeEx]
test rsi, rsi
je 0x18002a44a
mov rcx, rsi
call fcn.18004ca78
test r14, r14
je 0x18002a457
mov rcx, r14
call fcn.18004ca78
xor edi, edi
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov rax, rdi
mov rbx, qword [rsp + 0x88]
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret