Function at 0x140005400
Capabilities:
Allocate or change rwx memory
Allocate user process rwx memory
Attach user process memory
Find process by pid
Free user process memory

Disassembly:
mov qword [rsp + 0x20], r9
mov dword [rsp + 0x18], r8d
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rdi
sub rsp, 0xb0
mov rax, qword [0x14000e500]
xor rax, rsp
mov qword [rsp + 0xa8], rax
mov r9, qword [rsp + 0xc0]
lea r8, [0x140007090]
xor edx, edx
mov ecx, 0x4d
call qword [sym.imp.ntoskrnl.exe_DbgPrintEx]
mov qword [rsp + 0x50], 0
lea rax, [rsp + 0x78]
mov rdi, rax
xor eax, eax
mov ecx, 0x30
rep stosb byte [rdi], al
mov rax, qword [rsp + 0xc8]
mov qword [rsp + 0x60], rax
lea rdx, [rsp + 0x50]
mov rcx, qword [rsp + 0xc0]
call qword [sym.imp.ntoskrnl.exe_PsLookupProcessByProcessId]
mov dword [rsp + 0x30], eax
cmp dword [rsp + 0x30], 0
jge 0x140005499
movzx eax, byte [rsp + 0x30]
jmp 0x140005709
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ntoskrnl.exe_PsGetProcessExitStatus]
cmp eax, 0x103
je 0x1400054b2
mov al, 0xa
jmp 0x140005709
lea rdx, [rsp + 0x78]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ntoskrnl.exe_KeStackAttachProcess]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ntoskrnl.exe_PsReferencePrimaryToken]
mov qword [rsp + 0x68], rax
mov rax, qword [rsp + 0x68]
add rax, 0x40
mov qword [rsp + 0x40], rax
mov eax, 8
imul rax, rax, 0
mov rcx, qword [rsp + 0x40]
mov rax, qword [rcx + rax]
bts rax, 0x14
mov ecx, 8
imul rcx, rcx, 0
mov rdx, qword [rsp + 0x40]
mov qword [rdx + rcx], rax
mov eax, 8
imul rax, rax, 1
mov rcx, qword [rsp + 0x40]
mov rax, qword [rcx + rax]
bts rax, 0x14
mov ecx, 8
imul rcx, rcx, 1
mov rdx, qword [rsp + 0x40]
mov qword [rdx + rcx], rax
mov eax, 8
imul rax, rax, 2
mov rcx, qword [rsp + 0x40]
mov rax, qword [rcx + rax]
bts rax, 0x14
mov ecx, 8
imul rcx, rcx, 2
mov rdx, qword [rsp + 0x40]
mov qword [rdx + rcx], rax
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ntoskrnl.exe_PsDereferencePrimaryToken]
mov qword [rsp + 0x38], 0
movsxd rax, dword [rsp + 0xd0]
mov qword [rsp + 0x58], rax
mov dword [rsp + 0x28], 4
mov dword [rsp + 0x20], 0x1000
lea r9, [rsp + 0x58]
xor r8d, r8d
lea rdx, [rsp + 0x38]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwAllocateVirtualMemory]
mov dword [rsp + 0x30], eax
mov r8, qword [rsp + 0x58]
xor edx, edx
mov rcx, qword [rsp + 0x38]
call fcn.140006900
mov edx, dword [rsp + 0x58]
mov rcx, qword [rsp + 0x38]
call fcn.140005020
mov rax, cr3
mov qword [rsp + 0x70], rax
mov rax, qword [rsp + 0x70]
mov cr3, rax
mov rax, qword [rsp + 0x38]
mov qword [rsp + 0x20], rax
mov r9d, dword [rsp + 0x30]
lea r8, [0x1400070b0]
xor edx, edx
mov ecx, 0x4d
call qword [sym.imp.ntoskrnl.exe_DbgPrintEx]
cmp dword [rsp + 0x30], 0
jge 0x140005608
jmp 0x1400056d5
mov rax, qword [rsp + 0x38]
mov qword [rsp + 0x60], rax
movsxd rax, dword [rsp + 0xd0]
mov r8, rax
mov rdx, qword [rsp + 0xc8]
mov rcx, qword [rsp + 0x38]
call fcn.140006640
mov r9, qword [rsp + 0x60]
lea r8, [0x1400070e0]
xor edx, edx
mov ecx, 0x4d
call qword [sym.imp.ntoskrnl.exe_DbgPrintEx]
mov r9d, 8
lea r8, [rsp + 0x60]
mov edx, 0x28
mov rcx, 0xffffffffffffffff
call sub.ntoskrnl.exe_ZwSetInformationProcess
mov dword [rsp + 0x30], eax
mov eax, dword [rsp + 0xd0]
mov dword [rsp + 0x20], eax
mov r9d, dword [rsp + 0x30]
lea r8, [0x140007100]
xor edx, edx
mov ecx, 0x4d
call qword [sym.imp.ntoskrnl.exe_DbgPrintEx]
cmp qword [rsp + 0xd8], 0
je 0x1400056a7
mov rax, qword [rsp + 0xd8]
mov rcx, qword [rsp + 0x38]
mov qword [rax], rcx
cmp dword [rsp + 0x30], 0
jge 0x1400056cb
mov r9d, 0x8000
lea r8, [rsp + 0x58]
lea rdx, [rsp + 0x38]
mov rcx, 0xffffffffffffffff
call qword [sym.imp.ntoskrnl.exe_ZwFreeVirtualMemory]
xor eax, eax
test eax, eax
jne 0x1400054c2
lea rcx, [rsp + 0x78]
call qword [sym.imp.ntoskrnl.exe_KeUnstackDetachProcess]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ntoskrnl.exe_ObfDereferenceObject]
cmp dword [rsp + 0x30], 0
jl 0x1400056fc
mov dword [rsp + 0x48], 1
jmp 0x140005704
mov dword [rsp + 0x48], 0
movzx eax, byte [rsp + 0x48]
mov rcx, qword [rsp + 0xa8]
xor rcx, rsp
call fcn.140006420
add rsp, 0xb0
pop rdi
ret