Function at 0x140007760
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 - 0x400]
sub rsp, 0x500
mov rax, qword [section..data]
xor rax, rsp
mov qword [rbp + 0x3f0], rax
mov rdi, r8
mov rbx, rcx
cmp edx, 1
jle 0x140007b23
mov rdx, qword [r8 + 8]
mov ecx, 0xfffd
movzx eax, word [rdx]
sub ax, 0x2d
test cx, ax
jne 0x140007b23
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 0x140007922
mov rsi, qword [rbx + 0x18]
lea rcx, [rbp - 0x30]
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 + 0x1e0]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x14000781e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.GetModuleFileName_failed_w_err_0x_08lx_n
call fcn.140007410
jmp 0x140007ba5
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 3]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rbx, rax
test rax, rax
je 0x140007969
lea r8, [0x14009d308]
mov edx, 0x104
lea rcx, [rbp - 0x30]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscat_s]
lea r8, [rbp + 0x1e0]
mov edx, 0x104
lea rcx, [rbp - 0x30]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscat_s]
lea r8, [0x14009d308]
mov edx, 0x104
lea rcx, [rbp - 0x30]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_wcscat_s]
xor eax, eax
lea rcx, [0x14009be68]
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 - 0x30]
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 0x1400078fc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.CreateService_failed_w_err_0x_08lx_n
call fcn.140007410
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007ba5
mov rdx, rdi
lea rcx, str._s_is_installed._n
call fcn.140007410
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007ba5
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 0x140007a97
mov rdi, qword [rbx + 8]
xor eax, eax
xorps xmm0, xmm0
mov qword [rbp - 0x40], rax
xor edx, edx
mov dword [rbp - 0x38], eax
xor ecx, ecx
lea r8d, [rax + 1]
movups xmmword [rbp - 0x50], xmm0
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rsi, rax
test rax, rax
jne 0x140007982
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenSCManager_failed_w_err_0x_08lx_n
call fcn.140007410
jmp 0x140007ba5
mov r8d, 0x10024
mov rdx, rdi
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
jne 0x1400079be
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenService_failed_w_err_0x_08lx_n
call fcn.140007410
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007ba5
lea r8, [rbp - 0x50]
mov edx, 1
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x140007a4e
mov rdx, rdi
lea rcx, str.Stopping__s.
call fcn.140007410
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rdx, [rbp - 0x50]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x140007a30
nop
mov eax, dword [rbp - 0x4c]
cmp eax, 3
jne 0x140007a33
lea rcx, [0x14009d3e4]
call fcn.140007410
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rdx, [rbp - 0x50]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
jne 0x140007a00
mov eax, dword [rbp - 0x4c]
lea rcx, [0x14009d3e8]
mov rdx, rdi
cmp eax, 1
je 0x140007a49
lea rcx, str._n_s_failed_to_stop._n
call fcn.140007410
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x140007a71
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.DeleteService_failed_w_err_0x_08lx_n
call fcn.140007410
jmp 0x140007a80
mov rdx, rdi
lea rcx, str._s_is_removed._n
call fcn.140007410
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007ba5
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 0x140007ba5
mov rdx, qword [rbx]
lea rsi, [rdx + 0x70]
cmp qword [rsi + 0x18], 7
jbe 0x140007ac5
mov rsi, qword [rsi]
mov rbx, qword [rdx + 0x68]
lea rcx, [rbp - 0x50]
mov rdi, qword [rdx + 0x60]
add rdx, 0x50
call fcn.140005be0
mov r9, rsi
mov r8, rbx
mov rdx, rdi
mov rcx, rax
call fcn.140049c90
xor eax, eax
lea rcx, [rsp + 0x70]
mov qword [rbp - 0x58], rax
call fcn.140049f30
mov ebx, eax
test eax, eax
je 0x140007ba5
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 0x140007ba5
lea rcx, str.Parameters:_n
call fcn.140007410
lea rcx, str.__install__to_install_the_service._n
call fcn.140007410
lea rcx, str.__remove___to_remove_the_service._n
call fcn.140007410
lea rcx, str.__console__to_run_in_console_mode._n
call fcn.140007410
mov rax, qword [rbx]
lea rcx, [rbp - 0x50]
mov qword [0x1400d80a0], rax
mov rax, qword [rax + 0x10]
mov qword [rbp - 0x50], rax
lea rax, [0x140007ca0]
mov qword [rbp - 0x48], rax
xor eax, eax
mov qword [rbp - 0x40], rax
mov qword [rbp - 0x38], rax
call qword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
test eax, eax
jne 0x140007ba5
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 + 0x3f0]
xor rcx, rsp
call fcn.140068890
lea r11, [rsp + 0x500]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret