Function at 0x140004110
Capabilities:
Enumerate processes via ntquerysysteminformation
Get system information on windows

Disassembly:
mov qword [rsp + 0x20], r9
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
sub rsp, 0x1e8
mov rax, qword [0x14000f040]
xor rax, rsp
mov qword [rsp + 0x1d8], rax
mov dword [rsp + 0x40], 0
mov qword [rsp + 0x1b0], 0
mov qword [rsp + 0x60], 0
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x68], 0
mov qword [rsp + 0x1c8], 0
mov qword [rsp + 0x1a8], 0
mov dword [rsp + 0x1d4], 0
mov dword [rsp + 0x4c], 0x1000
mov dword [rsp + 0x74], 0
mov qword [rsp + 0x1b8], 0
mov dword [rsp + 0x58], 0xc0000004
mov qword [rsp + 0x1c0], 0
lea rdx, [rsp + 0x1b0]
mov rcx, qword [rsp + 0x1f8]
call sub.ADVAPI32.dll_ConvertStringSidToSidW
test eax, eax
jne 0x1400041dd
jmp 0x140004764
xor eax, eax
cmp eax, 1
je 0x140004764
mov eax, dword [rsp + 0x4c]
mov edx, eax
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rsp + 0x60], rax
cmp qword [rsp + 0x60], 0
je 0x140004210
cmp dword [rsp + 0x58], 0xc0000004
je 0x140004215
jmp 0x140004764
lea r9, [rsp + 0x1d4]
mov r8d, dword [rsp + 0x4c]
mov rdx, qword [rsp + 0x60]
mov ecx, 5
call qword [sym.imp.ntdll.dll_NtQuerySystemInformation]
mov dword [rsp + 0x58], eax
cmp dword [rsp + 0x58], 0
jl 0x14000474a
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x50], rax
xor eax, eax
cmp eax, 1
je 0x14000474a
mov rax, qword [rsp + 0x50]
mov rcx, qword [rax + 0x50]
call fcn.140005cd0
mov r8d, eax
xor edx, edx
mov ecx, 0x400
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov qword [rsp + 0x68], rax
cmp qword [rsp + 0x68], 0
je 0x140004719
lea r8, [rsp + 0x1c8]
mov edx, 0xa
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x14000470d
lea rax, [rsp + 0x1a8]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 2
mov r9d, 2
xor r8d, r8d
mov edx, 0x2000000
mov rcx, qword [rsp + 0x1c8]
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
test eax, eax
je 0x1400046fe
lea r8, [rsp + 0x1b8]
mov rdx, qword [rsp + 0x1a8]
mov rcx, qword [rsp + 0x1f0]
call fcn.140005580
test eax, eax
je 0x1400046e8
lea r8, [rsp + 0x1c0]
mov rdx, qword [rsp + 0x1a8]
mov rcx, qword [rsp + 0x1f0]
call fcn.1400057f0
test eax, eax
je 0x1400046e8
mov r8, qword [rsp + 0x1b0]
mov rdx, qword [rsp + 0x1b8]
mov rcx, qword [rsp + 0x1f0]
call fcn.140005470
test eax, eax
je 0x1400046cb
mov rax, qword [rsp + 0x1c0]
mov qword [rsp + 0x78], rax
mov rax, qword [rsp + 0x50]
mov rax, qword [rax + 0x40]
mov qword [rsp + 0x80], rax
mov rax, qword [rsp + 0x50]
mov rcx, qword [rax + 0x50]
call fcn.140005cd0
mov dword [rsp + 0x70], eax
lea rdx, str.Found_a_potential_Process_candidate:_PID_d___Image_ws___User_ws
lea rcx, [rsp + 0xe8]
call fcn.140002b80
nop
lea rdx, [0x14000b6f8]
lea rcx, [rsp + 0x88]
call fcn.140002be0
mov rax, qword [rsp + 0x78]
mov qword [rsp + 0x30], rax
mov rax, qword [rsp + 0x80]
mov qword [rsp + 0x28], rax
mov eax, dword [rsp + 0x70]
mov dword [rsp + 0x20], eax
lea r9, [rsp + 0xe8]
lea r8, [rsp + 0x88]
mov edx, 9
lea rcx, [0x14000f170]
call fcn.1400027e0
nop
lea rcx, [rsp + 0xe8]
call fcn.140003340
nop
mov dword [rsp + 0x1d0], 0
lea r8, [rsp + 0x1d0]
mov rdx, qword [rsp + 0x1a8]
mov rcx, qword [rsp + 0x1f0]
call fcn.1400059c0
nop
cmp dword [rsp + 0x1d0], 0
je 0x140004483
lea rdx, str.This_token_is_not_restricted.
lea rcx, [rsp + 0x108]
call fcn.140002b80
nop
lea rdx, [0x14000b748]
lea rcx, [rsp + 0x98]
call fcn.140002be0
lea r9, [rsp + 0x108]
lea r8, [rsp + 0x98]
mov edx, 9
lea rcx, [0x14000f170]
call fcn.1400021a0
nop
lea rcx, [rsp + 0x108]
call fcn.140003340
nop
jmp 0x1400044dc
lea rdx, str.This_token_is_restricted.
lea rcx, [rsp + 0x128]
call fcn.140002b80
nop
lea rdx, [0x14000b798]
lea rcx, [rsp + 0xa8]
call fcn.140002be0
lea r9, [rsp + 0x128]
lea r8, [rsp + 0xa8]
mov edx, 9
lea rcx, [0x14000f170]
call fcn.1400021a0
nop
lea rcx, [rsp + 0x128]
call fcn.140003340
nop
cmp dword [rsp + 0x1d0], 0
je 0x1400046cb
cmp qword [rsp + 0x208], 0
je 0x140004657
cmp dword [rsp + 0x210], 0
je 0x140004657
mov dword [rsp + 0x48], 0
mov dword [rsp + 0x44], 0
jmp 0x140004523
mov eax, dword [rsp + 0x44]
inc eax
mov dword [rsp + 0x44], eax
mov eax, dword [rsp + 0x210]
cmp dword [rsp + 0x44], eax
jae 0x140004568
mov eax, dword [rsp + 0x44]
xor r9d, r9d
mov rcx, qword [rsp + 0x208]
mov r8, qword [rcx + rax*8]
mov rdx, qword [rsp + 0x1a8]
mov rcx, qword [rsp + 0x1f0]
call fcn.140004fb0
test eax, eax
je 0x140004566
mov eax, dword [rsp + 0x48]
inc eax
mov dword [rsp + 0x48], eax
jmp 0x140004519
lea rdx, str.Found__d__d_required_privileges_in_token.
lea rcx, [rsp + 0x148]
call fcn.140002b80
nop
lea rdx, [0x14000b7f8]
lea rcx, [rsp + 0xb8]
call fcn.140002be0
mov eax, dword [rsp + 0x210]
mov dword [rsp + 0x28], eax
mov eax, dword [rsp + 0x48]
mov dword [rsp + 0x20], eax
lea r9, [rsp + 0x148]
lea r8, [rsp + 0xb8]
mov edx, 9
lea rcx, [0x14000f170]
call fcn.1400024a0
nop
lea rcx, [rsp + 0x148]
call fcn.140003340
nop
mov eax, dword [rsp + 0x210]
cmp dword [rsp + 0x48], eax
jne 0x140004655
lea rdx, str.Found_a_valid_Token_candidate.
lea rcx, [rsp + 0x168]
call fcn.140002b80
nop
lea rdx, [0x14000b848]
lea rcx, [rsp + 0xc8]
call fcn.140002be0
lea r9, [rsp + 0x168]
lea r8, [rsp + 0xc8]
mov edx, 9
lea rcx, [0x14000f170]
call fcn.1400021a0
nop
lea rcx, [rsp + 0x168]
call fcn.140003340
nop
mov rax, qword [rsp + 0x200]
mov rcx, qword [rsp + 0x1a8]
mov qword [rax], rcx
mov dword [rsp + 0x40], 1
jmp 0x1400046cb
lea rdx, str.Found_a_valid_Token.
lea rcx, [rsp + 0x188]
call fcn.140002b80
nop
lea rdx, str.c_impersonate::find_process_token_and_duplicate
lea rcx, [rsp + 0xd8]
call fcn.140002be0
lea r9, [rsp + 0x188]
lea r8, [rsp + 0xd8]
mov edx, 9
lea rcx, [0x14000f170]
call fcn.1400021a0
nop
lea rcx, [rsp + 0x188]
call fcn.140003340
nop
mov rax, qword [rsp + 0x200]
mov rcx, qword [rsp + 0x1a8]
mov qword [rax], rcx
mov dword [rsp + 0x40], 1
mov rcx, qword [rsp + 0x1b8]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x1c0]
call qword [sym.imp.KERNEL32.dll_LocalFree]
nop
cmp dword [rsp + 0x40], 0
jne 0x1400046fe
mov rcx, qword [rsp + 0x1a8]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
mov rcx, qword [rsp + 0x1c8]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
nop
cmp dword [rsp + 0x40], 0
je 0x140004722
jmp 0x14000474a
mov rax, qword [rsp + 0x50]
cmp dword [rax], 0
jne 0x14000472e
jmp 0x14000474a
mov rax, qword [rsp + 0x50]
mov eax, dword [rax]
mov rcx, qword [rsp + 0x50]
add rcx, rax
mov rax, rcx
mov qword [rsp + 0x50], rax
jmp 0x14000424b
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, dword [rsp + 0x4c]
shl eax, 1
mov dword [rsp + 0x4c], eax
jmp 0x1400041dd
cmp qword [rsp + 0x1b0], 0
je 0x14000477e
mov rcx, qword [rsp + 0x1b0]
call qword [sym.imp.KERNEL32.dll_LocalFree]
nop
mov eax, dword [rsp + 0x40]
mov rcx, qword [rsp + 0x1d8]
xor rcx, rsp
call fcn.140009940
add rsp, 0x1e8
ret