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

Disassembly:
mov qword [rsp + 0x18], r8
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
sub rsp, 0x2d8
mov byte [rsp + 0x70], 0
mov byte [rsp + 0x78], 0
cmp qword [rsp + 0x2e0], 0
jne 0x140021dca
lea rax, str.KProcessHacker2
mov qword [rsp + 0x2e0], rax
mov eax, 0x20
imul rax, rax, 0
mov dword [rsp + rax + 0x90], 1
mov eax, 0x20
imul rax, rax, 0
lea rax, [rsp + rax + 0xa0]
lea rdx, str.Device_
mov rcx, rax
call fcn.14000aae0
xor eax, eax
test eax, eax
jne 0x140021dca
mov eax, 0x20
imul rax, rax, 1
mov dword [rsp + rax + 0x90], 1
mov eax, 0x20
imul rax, rax, 1
lea rax, [rsp + rax + 0xa0]
mov rdx, qword [rsp + 0x2e0]
mov rcx, rax
call fcn.14000aae0
xor eax, eax
test eax, eax
jne 0x140021e04
mov qword [rsp + 0x20], 0
mov r9d, 0x200
lea r8, [rsp + 0xd0]
mov edx, 2
lea rcx, [rsp + 0x90]
call sym.ProcessHacker.exe_PhFormatToBuffer
movzx eax, al
test eax, eax
jne 0x140021e79
mov eax, 0xc0000106
jmp 0x1400220d7
lea rcx, [rsp + 0xd0]
call sym.ProcessHacker.exe_KphConnect
mov dword [rsp + 0x74], eax
cmp dword [rsp + 0x74], 0
jge 0x140021e9b
cmp dword [rsp + 0x74], 0xc000020a
jne 0x140021ea4
mov eax, dword [rsp + 0x74]
jmp 0x1400220d7
cmp dword [rsp + 0x74], 0xc000000e
je 0x140021ed5
cmp dword [rsp + 0x74], 0xc000000f
je 0x140021ed5
cmp dword [rsp + 0x74], 0xc0000034
je 0x140021ed5
cmp dword [rsp + 0x74], 0xc000003a
je 0x140021ed5
mov eax, dword [rsp + 0x74]
jmp 0x1400220d7
mov r8d, 1
xor edx, edx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov qword [rsp + 0x88], rax
cmp qword [rsp + 0x88], 0
je 0x140021f5f
mov r8d, 0x10
mov rdx, qword [rsp + 0x2e0]
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov qword [rsp + 0x80], rax
cmp qword [rsp + 0x80], 0
je 0x140021f51
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
je 0x140021f43
mov byte [rsp + 0x70], 1
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
movzx eax, byte [rsp + 0x70]
test eax, eax
jne 0x140022094
mov rcx, qword [rsp + 0x2e8]
call qword [sym.imp.ntdll.dll_RtlDoesFileExists_U]
movzx eax, al
test eax, eax
je 0x140022094
mov r8d, 2
xor edx, edx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov qword [rsp + 0x88], rax
cmp qword [rsp + 0x88], 0
je 0x140022094
lea rax, [0x140110d6c]
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x58], 0
mov qword [rsp + 0x50], 0
mov qword [rsp + 0x48], 0
mov qword [rsp + 0x40], 0
mov rax, qword [rsp + 0x2e8]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 0
mov dword [rsp + 0x28], 3
mov dword [rsp + 0x20], 1
mov r9d, 0xf01ff
mov r8, qword [rsp + 0x2e0]
mov rdx, qword [rsp + 0x2e0]
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov qword [rsp + 0x80], rax
cmp qword [rsp + 0x80], 0
je 0x140022086
mov byte [rsp + 0x78], 1
cmp qword [rsp + 0x2f0], 0
je 0x14002206a
mov rdx, qword [rsp + 0x2f0]
mov rcx, qword [rsp + 0x2e0]
call sym.ProcessHacker.exe_KphSetParameters
mov dword [rsp + 0x74], eax
cmp dword [rsp + 0x74], 0
jge 0x14002206a
jmp 0x1400220ae
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
je 0x140022086
mov byte [rsp + 0x70], 1
mov rcx, qword [rsp + 0x88]
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
movzx eax, byte [rsp + 0x70]
test eax, eax
je 0x1400220ae
lea rcx, [rsp + 0xd0]
call sym.ProcessHacker.exe_KphConnect
mov dword [rsp + 0x74], eax
movzx eax, byte [rsp + 0x78]
test eax, eax
je 0x1400220d3
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.ADVAPI32.dll_DeleteService]
mov rcx, qword [rsp + 0x80]
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [rsp + 0x74]
add rsp, 0x2d8
ret