Function at 0x140007650
Capabilities:
Create service
Delete service
Persist via windows service
Query service status
Stop service

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r14
lea rbp, [rsp - 0x3e0]
sub rsp, 0x4e0
mov rax, qword [0x1400ab008]
xor rax, rsp
mov qword [rbp + 0x3d0], rax
mov rdi, r8
mov rbx, rcx
cmp edx, 1
jle 0x140007a19
mov rdx, qword [r8 + 8]
mov ecx, 0xfffd
movzx eax, word [rdx]
sub ax, 0x2d
test cx, ax
jne 0x140007a19
add rdx, 2
lea rcx, str.install
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
test eax, eax
jne 0x140007812
mov rsi, qword [rbx + 0x18]
lea rcx, [rbp - 0x50]
mov r14, qword [rbx + 0x10]
xor edx, edx
mov rdi, qword [rbx + 8]
mov r8d, 0x208
call sub.VCRUNTIME140.dll_memset
mov r8d, 0x104
lea rdx, [rbp + 0x1c0]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x14000770e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.GetModuleFileName_failed_w_err_0x_08lx_n
call fcn.140007300
jmp 0x140007a9e
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 3]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rbx, rax
test rax, rax
je 0x14000785a
lea r8, [0x140065898]
mov edx, 0x104
lea rcx, [rbp - 0x50]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscat_s]
lea r8, [rbp + 0x1c0]
mov edx, 0x104
lea rcx, [rbp - 0x50]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscat_s]
lea r8, [0x140065898]
mov edx, 0x104
lea rcx, [rbp - 0x50]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscat_s]
xor eax, eax
lea rcx, [0x1400642a8]
mov qword [rsp + 0x60], rax
mov r9d, 4
mov qword [rsp + 0x58], rsi
mov r8, r14
mov qword [rsp + 0x50], rcx
mov rdx, rdi
mov qword [rsp + 0x48], rax
mov rcx, rbx
mov qword [rsp + 0x40], rax
lea rax, [rbp - 0x50]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 0x10
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov rsi, rax
test rax, rax
jne 0x1400077ec
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.CreateService_failed_w_err_0x_08lx_n
call fcn.140007300
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007a9e
mov rdx, rdi
lea rcx, str._s_is_installed._n
call fcn.140007300
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007a9e
mov rdx, qword [rdi + 8]
lea rcx, str.remove
add rdx, 2
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
test eax, eax
jne 0x14000798c
mov rdi, qword [rbx + 8]
xor eax, eax
xorps xmm0, xmm0
mov qword [rbp - 0x80], rax
xor edx, edx
mov dword [rbp - 0x78], eax
xor ecx, ecx
lea r8d, [rax + 1]
movups xmmword [rsp + 0x70], xmm0
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rsi, rax
test rax, rax
jne 0x140007873
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenSCManager_failed_w_err_0x_08lx_n
call fcn.140007300
jmp 0x140007a9e
mov r8d, 0x10024
mov rdx, rdi
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
jne 0x1400078af
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenService_failed_w_err_0x_08lx_n
call fcn.140007300
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007a9e
lea r8, [rsp + 0x70]
mov edx, 1
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x140007943
mov rdx, rdi
lea rcx, str.Stopping__s.
call fcn.140007300
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rdx, [rsp + 0x70]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x140007924
mov eax, dword [rsp + 0x74]
cmp eax, 3
jne 0x140007928
lea rcx, [0x140065974]
call fcn.140007300
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rdx, [rsp + 0x70]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x1400078f2
mov eax, dword [rsp + 0x74]
lea rcx, [0x140065978]
mov rdx, rdi
cmp eax, 1
je 0x14000793e
lea rcx, str._n_s_failed_to_stop._n
call fcn.140007300
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x140007966
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.DeleteService_failed_w_err_0x_08lx_n
call fcn.140007300
jmp 0x140007975
mov rdx, rdi
lea rcx, str._s_is_removed._n
call fcn.140007300
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007a9e
mov rdx, qword [rdi + 8]
lea rcx, str.console
add rdx, 2
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll__wcsicmp]
test eax, eax
jne 0x140007a9e
mov rdx, qword [rbx]
lea rsi, [rdx + 0x70]
cmp qword [rsi + 0x18], 8
jb 0x1400079ba
mov rsi, qword [rsi]
mov rbx, qword [rdx + 0x68]
lea rcx, [rsp + 0x70]
mov rdi, qword [rdx + 0x60]
add rdx, 0x50
call fcn.140006860
mov r9, rsi
mov r8, rbx
mov rdx, rdi
mov rcx, rax
call fcn.14003fca0
xor eax, eax
lea rcx, [rsp + 0x70]
mov qword [rbp - 0x58], rax
call fcn.14003ff20
mov ebx, eax
test eax, eax
je 0x140007a9e
call qword [sym.imp.Logging.dll_public:_static_class_Hp::Bridge::Logging::TraceLogger____ptr64___cdecl_Hp::Bridge::Logging::LogManager::GetLogger_void_]
mov r8d, ebx
lea rdx, str.RpcServiceHost::Listen
mov rcx, rax
call qword [sym.imp.Logging.dll_public:_void___cdecl_Hp::Bridge::Logging::TraceLogger::LogLastError_wchar_t_const____ptr64__unsigned_long_int____ptr64]
jmp 0x140007a9e
lea rcx, str.Parameters:_n
call fcn.140007300
lea rcx, str.__install__to_install_the_service._n
call fcn.140007300
lea rcx, str.__remove___to_remove_the_service._n
call fcn.140007300
lea rcx, str.__console__to_run_in_console_mode._n
call fcn.140007300
mov rax, qword [rbx]
lea rcx, [rsp + 0x70]
mov qword [0x1400affc0], rax
mov rax, qword [rax + 0x10]
mov qword [rsp + 0x70], rax
lea rax, [0x140007b50]
mov qword [rsp + 0x78], rax
xor eax, eax
mov qword [rbp - 0x80], rax
mov qword [rbp - 0x78], rax
call qword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
test eax, eax
jne 0x140007a9e
mov rbx, qword [rbx + 0x20]
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.Service_failed_to_run_w_err_0x_08lx_n
mov rcx, rbx
mov r8d, eax
call qword [sym.imp.Logging.dll_public:_void___cdecl_Hp::Bridge::Logging::TraceLogger::LogError_wchar_t_const____ptr64____ptr64]
xor eax, eax
mov rcx, qword [rbp + 0x3d0]
xor rcx, rsp
call fcn.140058b20
lea r11, [rsp + 0x4e0]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret