Function at 0x7ff7c008a220
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 0x7ff7c008a266
call qword [sym.imp.kernel32.dll_GetLastError]
test eax, eax
jle 0x7ff7c008a550
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 [0x7ff7c01d69a0], rsi
mov rdi, rax
je 0x7ff7c008a37f
lock inc dword [rax - 8]
mov r8, qword [r15 + 0x48]
lea rcx, [0x7ff7c0185178]
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, [0x7ff7c0152200]
mov r9d, 0xf01ff
mov qword [rsp + 0x60], rax
mov r8, rdx
lea rax, [0x7ff7c0185198]
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 0x7ff7c008a345
nop
call fcn.7ff7c00c6290
lea rcx, [rdi - 0x10]
mov eax, r14d
lock xadd dword [rcx + 8], eax
cmp eax, 1
jne 0x7ff7c008a35b
call fcn.7ff7c00c6290
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test r12, r12
jne 0x7ff7c008a3b4
test esi, esi
jle 0x7ff7c008a378
movzx esi, si
or esi, 0xc0070000
mov eax, esi
jmp 0x7ff7c008a528
mov rcx, qword [sym.ProcessHacker.exe_PhInstanceHandle]
xor edx, edx
call sym.ProcessHacker.exe_PhGetDllFileName
mov rdi, rax
xor eax, eax
lock cmpxchg qword [0x7ff7c01d69a0], rdi
jne 0x7ff7c008a3a1
lock inc dword [rdi - 8]
test rdi, rdi
jne 0x7ff7c008a290
mov eax, 0xc0000229
jmp 0x7ff7c008a540
mov qword ss:[rsp + 0x88], r13
call fcn.7ff7c008a060
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, [0x7ff7c01851b0]
call sym.ProcessHacker.exe_PhCountStringZ
mov rsi, rax
mov rcx, rbp
add rsi, rsi
call sym.ProcessHacker.exe_PhCountStringZ
mov rdx, qword [0x7ff7c01d3b58]
mov rdi, rax
add rdi, rdi
lea rbx, [rdi + rsi]
lea rcx, [rbx + 0x12]
call sym.ProcessHacker.exe_PhCreateObject
mov r13, rax
lea rdx, [0x7ff7c01851b0]
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.7ff7c0125120
mov rcx, qword [r13 + 8]
mov r8, rdi
add rcx, rsi
mov rdx, rbp
call fcn.7ff7c0125120
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.7ff7c00518a0
mov ebx, eax
test eax, eax
jns 0x7ff7c008a4ab
lea rdx, ds:[rsp + 0xd0]
mov qword [rsp + 0xd0], 0xfffffffffff0bdc0
xor ecx, ecx
call qword [sym.imp.ntdll.dll_NtDelayExecution]
add edi, 0xffffffff
jne 0x7ff7c008a473
lea rcx, ds:[r13 - 0x10]
lock xadd dword [rcx + 8], r14d
mov r13, qword [rsp + 0x88]
cmp r14d, 1
jne 0x7ff7c008a4cb
call fcn.7ff7c00c6290
test ebx, ebx
js 0x7ff7c008a51d
mov rdx, r15
mov ecx, 0xc
call fcn.7ff7c0051b20
mov rcx, qword [0x7ff7c01d85c8]
mov ebx, eax
test rcx, rcx
je 0x7ff7c008a4fb
call qword [sym.imp.ntdll.dll_RtlDestroyHeap]
xor edi, edi
mov qword [0x7ff7c01d85c8], rdi
jmp 0x7ff7c008a4fd
xor edi, edi
mov rcx, qword [0x7ff7c01d85c0]
test rcx, rcx
je 0x7ff7c008a516
call qword [sym.imp.ntdll.dll_NtClose]
mov qword [0x7ff7c01d85c0], rdi
mov qword [0x7ff7c01d85d0], 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