Function at 0x140001624
Capabilities:
Create process on windows
Query service status
Resume thread
Spoof parent pid
Start service

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x20]
sub rsp, 0x120
xorps xmm0, xmm0
xor r12d, r12d
mov r15, rcx
mov qword [rbp + 0x70], r12
xor eax, eax
xor edx, edx
xor ecx, ecx
mov dword [rbp - 0x60], eax
lea r13d, [r12 + 1]
mov r8d, r13d
movups xmmword [rbp - 0x80], xmm0
movups xmmword [rbp - 0x70], xmm0
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rcx, rax
lea r8d, [r12 + 0x14]
lea rdx, str.TrustedInstaller
mov r14, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
mov edi, r13d
test rax, rax
je 0x1400016dc
mov esi, r13d
jmp 0x1400016ba
cmp dword [rbp - 0x7c], r13d
mov edi, r12d
sete dil
jne 0x1400016dc
test esi, esi
je 0x1400016dc
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
je 0x1400016dc
mov esi, r12d
lea rax, [rbp + 0x68]
mov r9d, 0x24
lea r8, [rbp - 0x80]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x140001694
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
jne 0x140001a7b
mov edi, dword [rbp - 0x64]
xor edx, edx
mov r8d, edi
mov ecx, 0x80
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov qword [rsp + 0x78], rax
test rax, rax
je 0x140001a7b
mov ebx, dword [0x14000505c]
mov esi, 4
lea r14d, [rsi - 2]
test r14b, bl
je 0x140001808
mov r8d, edi
mov qword [rbp + 0x70], r12
xor edx, edx
mov ecx, 0x400
call qword [sym.imp.KERNEL32.dll_OpenProcess]
mov rbx, rax
test rax, rax
je 0x1400017a2
lea r8, [rbp + 0x78]
mov qword [rbp + 0x78], r12
mov edx, r14d
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x140001799
mov rcx, qword [rbp + 0x78]
lea rax, [rbp + 0x70]
mov qword [rsp + 0x28], rax
mov r9d, r13d
xor r8d, r8d
mov dword [rsp + 0x20], r13d
mov edx, 0x1a9
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
neg eax
sbb rcx, rcx
and qword [rbp + 0x70], rcx
mov rcx, qword [rbp + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp qword [rbp + 0x70], r12
jne 0x1400017c9
call qword [sym.imp.msvcrt.dll___iob_func]
lea rdx, str._E__Failed_to_create_TrustedInstaller_token_n
lea rcx, [rax + 0x60]
call qword [sym.imp.msvcrt.dll_fwprintf]
mov eax, 5
jmp 0x140001a97
call qword [sym.imp.KERNEL32.dll_WTSGetActiveConsoleSessionId]
mov dword [rbp + 0x68], eax
cmp eax, 0xffffffff
je 0x1400017ed
mov rcx, qword [rbp + 0x70]
lea r8, [rbp + 0x68]
mov r9d, esi
mov edx, 0xc
call qword [sym.imp.ADVAPI32.dll_SetTokenInformation]
mov edx, dword [0x14000505c]
mov rcx, qword [rbp + 0x70]
shr edx, 2
and edx, r13d
call fcn.140001ed4
mov ebx, dword [0x14000505c]
mov edi, 0x70
lea rcx, [rbp - 0x50]
mov r8d, edi
xor edx, edx
call sub.msvcrt.dll_memset
mov dword [rbp - 0x50], edi
mov edi, 8
mov dword [rbp - 0x14], r13d
mov word [rbp - 0x10], r13w
test r14b, bl
jne 0x14000189f
lea r9, [rbp + 0x68]
mov qword [rbp + 0x68], r12
xor r8d, r8d
mov edx, r13d
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_InitializeProcThreadAttributeList]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rbp + 0x68]
mov edx, edi
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
lea r9, [rbp + 0x68]
xor r8d, r8d
mov rcx, rax
mov qword [rbp + 0x18], rax
mov edx, r13d
call qword [sym.imp.KERNEL32.dll_InitializeProcThreadAttributeList]
mov rcx, qword [rbp + 0x18]
lea r9, [rsp + 0x78]
mov qword [rsp + 0x30], r12
xor edx, edx
mov qword [rsp + 0x28], r12
mov r8d, 0x20000
mov qword [rsp + 0x20], rdi
call qword [sym.imp.KERNEL32.dll_UpdateProcThreadAttribute]
mov ebx, dword [0x14000505c]
xor eax, eax
xorps xmm0, xmm0
mov qword [rsp + 0x70], rax
mov eax, ebx
and al, r14b
neg al
movups xmmword [rsp + 0x60], xmm0
sbb edi, edi
not edi
and edi, 0x80014
test sil, bl
je 0x1400018d1
lea rcx, str._D__Creating_specified_process_n
call qword [sym.imp.msvcrt.dll_wprintf]
mov rcx, qword [rbp + 0x70]
lea rax, [rsp + 0x60]
mov qword [rsp + 0x50], rax
xor r9d, r9d
lea rax, [rbp - 0x50]
mov r8, r15
mov qword [rsp + 0x48], rax
xor edx, edx
mov qword [rsp + 0x40], r12
mov qword [rsp + 0x38], r12
mov dword [rsp + 0x30], edi
mov dword [rsp + 0x28], r12d
mov qword [rsp + 0x20], r12
call qword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov edi, eax
test eax, eax
je 0x140001919
mov ebx, r12d
jmp 0x140001921
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
test byte [0x14000505c], r14b
je 0x140001936
mov rcx, qword [rbp + 0x70]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
jmp 0x140001955
mov rcx, qword [rbp + 0x18]
call qword [sym.imp.KERNEL32.dll_DeleteProcThreadAttributeList]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, qword [rbp + 0x18]
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
test edi, edi
je 0x140001a5d
mov eax, dword [0x14000505c]
test r14b, al
jne 0x1400019bb
mov rcx, qword [rsp + 0x60]
lea r8, [rbp + 0x68]
mov edx, 0x28
mov qword [rbp + 0x68], r12
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov edx, dword [0x14000505c]
mov rcx, qword [rbp + 0x68]
shr edx, 2
and edx, r13d
call fcn.140001ed4
mov rcx, qword [rbp + 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_ResumeThread]
mov eax, dword [0x14000505c]
test sil, al
je 0x1400019d7
mov edx, dword [rsp + 0x70]
lea rcx, str._D__Created_process_ID:__ld_n
call qword [sym.imp.msvcrt.dll_wprintf]
mov eax, dword [0x14000505c]
test al, 8
je 0x140001a43
test sil, al
je 0x1400019ed
lea rcx, str._D__Waiting_for_process_to_exit_n
call qword [sym.imp.msvcrt.dll_wprintf]
mov rcx, qword [rsp + 0x60]
or edx, 0xffffffff
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
test byte [0x14000505c], sil
je 0x140001a11
lea rcx, str._D__Process_exited_n
call qword [sym.imp.msvcrt.dll_wprintf]
mov rcx, qword [rsp + 0x60]
lea rdx, [rbp + 0x68]
call qword [sym.imp.KERNEL32.dll_GetExitCodeProcess]
test eax, eax
je 0x140001a43
test byte [0x14000505c], sil
mov edx, dword [rbp + 0x68]
mov dword [0x140005058], edx
je 0x140001a43
lea rcx, str._D__Process_exit_code:__ld_n
call qword [sym.imp.msvcrt.dll_wprintf]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
jmp 0x140001a97
call qword [sym.imp.msvcrt.dll___iob_func]
mov r8d, ebx
lea rdx, str._E__Process_creation_failed._Error_code:_0x_08X_n
lea rcx, [rax + 0x60]
call qword [sym.imp.msvcrt.dll_fwprintf]
mov eax, esi
jmp 0x140001a97
call qword [sym.imp.msvcrt.dll___iob_func]
lea rdx, str._E__Could_not_open_start_the_TrustedInstaller_service_n
lea rcx, [rax + 0x60]
call qword [sym.imp.msvcrt.dll_fwprintf]
mov eax, 3
mov rbx, qword [rsp + 0x160]
add rsp, 0x120
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret