Function at 0x180013c64
Capabilities:
Allocate or change rwx memory

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov qword [rax + 0x20], r12
push r13
sub rsp, 0x90
mov rbx, r9
mov edi, r8d
mov rsi, rdx
mov r13, rcx
and qword [rax - 0x58], 0
lea r8, [rax - 0x58]
mov rdx, qword [rcx + 8]
mov rcx, rsi
call fcn.1800161a0
mov r12, rax
test rax, rax
je 0x180013e8b
and dword [rsp + 0x30], 0
lea r9, [rsp + 0x30]
mov edx, 4
lea r8d, [rdx + 0x3c]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x180013e81
mov qword [rbx + 0x30], r13
mov eax, dword [r12]
add rax, rsi
mov qword [rbx + 0x10], rax
mov qword [rbx + 0x18], r12
mov eax, dword [r12]
mov qword [rbx + 0x20], rax
mov r9, rbx
mov r8d, edi
mov rdx, rsi
mov rcx, r13
call fcn.180013b40
mov edi, eax
mov dword [rsp + 0x38], eax
cmp eax, 1
jne 0x180013e94
mov rdx, qword [rbx + 0x10]
mov rcx, rsi
call fcn.1800139e4
mov rdi, rax
test rax, rax
je 0x180013d7c
lea r9, [rsp + 0x34]
mov edx, 0xe
lea r8d, [rdx + 0x32]
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
test eax, eax
je 0x180013d7c
and dword [rdi + 2], 0
mov rax, qword [rbx + 0x28]
mov qword [rdi + 6], rax
mov word [rdi], 0x25ff
mov qword [rbx + 0x28], rdi
mov qword [r13 + 0x18], rdi
mov r8d, dword [rsp + 0x34]
mov eax, 0x20
cmp r8d, 0x40
cmovne r8d, eax
mov dword [rsp + 0x34], r8d
lea r9, [rsp + 0x34]
lea edx, [rax - 0x12]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
mov rax, qword [rbx + 0x28]
sub rax, rsi
mov dword [r12], eax
lea r9, [rsp + 0x30]
mov r8d, dword [rsp + 0x30]
mov edx, 4
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_VirtualProtect]
or dword [rbx + 0x38], 0x102
bt dword [rbx + 0x38], 9
jae 0x180013dba
mov rdx, rbx
mov rcx, qword [rsp + 0x40]
call fcn.1800135b8
lea rcx, [0x180029980]
call qword [sym.imp.KERNEL32.dll_EnterCriticalSection]
mov r11, qword [0x180029970]
mov qword [rbx], r11
lea rax, [0x180029970]
mov qword [rbx + 8], rax
mov qword [r11 + 8], rbx
mov qword [0x180029970], rbx
lea rcx, [0x180029980]
call qword [sym.imp.KERNEL32.dll_LeaveCriticalSection]
mov r11, qword [rbx + 0x20]
lea rax, [rsi + r11]
mov qword [r13 + 0x20], rax
xor edi, edi
mov dword [rsp + 0x38], edi
xor ebx, ebx
mov qword [rsp + 0x48], rbx
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
and qword [rsp + 0x20], rbx
lea r9d, [rdi + 0x30]
lea r8, [rsp + 0x58]
xor edx, edx
call qword [sym.imp.ntdll.dll_ZwQueryInformationProcess]
test eax, eax
js 0x180013e74
mov rdx, qword [rsp + 0x60]
test rdx, rdx
je 0x180013e74
mov rax, qword [rdx + 0x18]
mov rcx, qword [rax + 0x30]
mov qword [rsp + 0x50], rcx
mov rax, qword [rdx + 0x18]
add rax, 0x30
cmp rcx, rax
je 0x180013e74
lea rbx, [rcx - 0x20]
mov qword [rsp + 0x48], rbx
cmp qword [rbx + 0x30], rsi
je 0x180013e74
xor ebx, ebx
mov qword [rsp + 0x48], rbx
mov rcx, qword [rcx]
mov qword [rsp + 0x50], rcx
jmp 0x180013e47
test rbx, rbx
je 0x180013e94
and dword [rbx + 0x80], edi
jmp 0x180013e94
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
jmp 0x180013e94
mov edi, 2
mov dword [rsp + 0x38], edi
jmp 0x180013e98
mov eax, edi
lea r11, [rsp + 0x90]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x18]
mov rdi, qword [r11 + 0x20]
mov r12, qword [r11 + 0x28]
mov rsp, r11
pop r13
ret