Function at 0x1400ca220
Capabilities:
Create service
Delete service
Start service

Disassembly:
push rbp
push r15
sub rsp, 0xa8
xor edx, edx
mov r15, rcx
xor ecx, ecx
lea r8d, [rdx + 2]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rbp, rax
test rax, rax
jne 0x1400ca266
call qword [sym.imp.KERNEL32.dll_GetLastError]
test eax, eax
jle 0x1400ca550
movzx eax, ax
or eax, 0xc0070000
add rsp, 0xa8
pop r15
pop rbp
ret
mov qword [rsp + 0xa0], rsi
xor esi, esi
xor eax, eax
mov qword [rsp + 0x98], rdi
lock cmpxchg qword [0x1402169a0], rsi
mov rdi, rax
je 0x1400ca37f
lock inc dword [rax - 8]
mov r8, qword [r15 + 0x48]
lea rcx, str.__s___ras___s_
mov rdx, qword [rdi + 8]
mov qword [rsp + 0xc0], rbx
mov qword [rsp + 0x90], r12
mov qword [rsp + 0x80], r14
call sym.ProcessHacker.exe_PhFormatString
mov rdx, qword [r15 + 0x48]
mov rbx, rax
lea rax, [0x140192200]
mov r9d, 0xf01ff
mov qword [rsp + 0x60], rax
mov r8, rdx
lea rax, str.LocalSystem
mov rcx, qword [rbx + 8]
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x50], rsi
mov qword [rsp + 0x48], rsi
mov qword [rsp + 0x40], rsi
mov qword [rsp + 0x38], rcx
mov rcx, rbp
mov dword [rsp + 0x30], esi
mov dword [rsp + 0x28], 3
mov dword [rsp + 0x20], 0x10
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov r12, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r14d, 0xffffffff
lea rcx, [rbx - 0x10]
mov esi, eax
mov edx, r14d
lock xadd dword [rcx + 8], edx
cmp edx, 1
jne 0x1400ca345
nop
call fcn.140106290
lea rcx, [rdi - 0x10]
mov eax, r14d
lock xadd dword [rcx + 8], eax
cmp eax, 1
jne 0x1400ca35b
call fcn.140106290
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test r12, r12
jne 0x1400ca3b4
test esi, esi
jle 0x1400ca378
movzx esi, si
or esi, 0xc0070000
mov eax, esi
jmp 0x1400ca528
mov rcx, qword [sym.ProcessHacker.exe_PhInstanceHandle]
xor edx, edx
call sym.ProcessHacker.exe_PhGetDllFileName
mov rdi, rax
xor eax, eax
lock cmpxchg qword [0x1402169a0], rdi
jne 0x1400ca3a1
lock inc dword [rdi - 8]
test rdi, rdi
jne 0x1400ca290
mov eax, 0xc0000229
jmp 0x1400ca540
mov qword ss:[rsp + 0x88], r13
call fcn.1400ca060
xor r8d, r8d
xor edx, edx
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_DeleteService]
mov rbp, qword [r15 + 0x48]
lea rcx, str.BaseNamedObjects_
call sym.ProcessHacker.exe_PhCountStringZ
mov rsi, rax
mov rcx, rbp
add rsi, rsi
call sym.ProcessHacker.exe_PhCountStringZ
mov rdx, qword [0x140213b58]
mov rdi, rax
add rdi, rdi
lea rbx, [rdi + rsi]
lea rcx, [rbx + 0x12]
call sym.ProcessHacker.exe_PhCreateObject
mov r13, rax
lea rdx, str.BaseNamedObjects_
mov r8, rsi
lea rcx, [rax + 0x10]
mov qword [rax], rbx
mov qword [rax + 8], rcx
xor eax, eax
mov word [rcx + rbx], ax
mov rcx, qword [r13 + 8]
call fcn.140165120
mov rcx, qword [r13 + 8]
mov r8, rdi
add rcx, rsi
mov rdx, rbp
call fcn.140165120
movzx eax, word [r13]
mov edi, 0x32
mov word [rsp + 0x70], ax
movzx eax, word [r13]
add ax, 2
mov word [rsp + 0x72], ax
mov rax, qword [r13 + 8]
mov qword [rsp + 0x78], rax
lea rcx, [rsp + 0x70]
call fcn.1400918a0
mov ebx, eax
test eax, eax
jns 0x1400ca4ab
lea rdx, ds:[rsp + 0xd0]
mov qword [rsp + 0xd0], 0xfffffffffff0bdc0
xor ecx, ecx
call qword [sym.imp.ntdll.dll_NtDelayExecution]
add edi, 0xffffffff
jne 0x1400ca473
lea rcx, ds:[r13 - 0x10]
lock xadd dword [rcx + 8], r14d
mov r13, qword [rsp + 0x88]
cmp r14d, 1
jne 0x1400ca4cb
call fcn.140106290
test ebx, ebx
js 0x1400ca51d
mov rdx, r15
mov ecx, 0xc
call fcn.140091b20
mov rcx, qword [0x1402185c8]
mov ebx, eax
test rcx, rcx
je 0x1400ca4fb
call qword [sym.imp.ntdll.dll_RtlDestroyHeap]
xor edi, edi
mov qword [0x1402185c8], rdi
jmp 0x1400ca4fd
xor edi, edi
mov rcx, qword [0x1402185c0]
test rcx, rcx
je 0x1400ca516
call qword [sym.imp.ntdll.dll_NtClose]
mov qword [0x1402185c0], rdi
mov qword [0x1402185d0], rdi
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, ebx
mov r12, qword [rsp + 0x90]
mov rbx, qword [rsp + 0xc0]
mov r14, qword [rsp + 0x80]
mov rsi, qword [rsp + 0xa0]
mov rdi, qword [rsp + 0x98]
add rsp, 0xa8
pop r15
pop rbp
ret