Function at 0x140007740
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 0x140007b03
mov rdx, qword [r8 + 8]
mov ecx, 0xfffd
movzx eax, word [rdx]
sub ax, 0x2d
test cx, ax
jne 0x140007b03
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 0x140007902
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 0x1400077fe
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.GetModuleFileName_failed_w_err_0x_08lx_n
call fcn.1400073f0
jmp 0x140007b85
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 3]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rbx, rax
test rax, rax
je 0x140007949
lea r8, [0x14009c308]
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, [0x14009c308]
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, [0x14009ae68]
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 0x1400078dc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.CreateService_failed_w_err_0x_08lx_n
call fcn.1400073f0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007b85
mov rdx, rdi
lea rcx, str._s_is_installed._n
call fcn.1400073f0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007b85
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 0x140007a77
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 0x140007962
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenSCManager_failed_w_err_0x_08lx_n
call fcn.1400073f0
jmp 0x140007b85
mov r8d, 0x10024
mov rdx, rdi
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
jne 0x14000799e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenService_failed_w_err_0x_08lx_n
call fcn.1400073f0
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007b85
lea r8, [rbp - 0x50]
mov edx, 1
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x140007a2e
mov rdx, rdi
lea rcx, str.Stopping__s.
call fcn.1400073f0
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 0x140007a10
nop
mov eax, dword [rbp - 0x4c]
cmp eax, 3
jne 0x140007a13
lea rcx, [0x14009c3e4]
call fcn.1400073f0
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 0x1400079e0
mov eax, dword [rbp - 0x4c]
lea rcx, [0x14009c3e8]
mov rdx, rdi
cmp eax, 1
je 0x140007a29
lea rcx, str._n_s_failed_to_stop._n
call fcn.1400073f0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x140007a51
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.DeleteService_failed_w_err_0x_08lx_n
call fcn.1400073f0
jmp 0x140007a60
mov rdx, rdi
lea rcx, str._s_is_removed._n
call fcn.1400073f0
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140007b85
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 0x140007b85
mov rdx, qword [rbx]
lea rsi, [rdx + 0x70]
cmp qword [rsi + 0x18], 7
jbe 0x140007aa5
mov rsi, qword [rsi]
mov rbx, qword [rdx + 0x68]
lea rcx, [rbp - 0x50]
mov rdi, qword [rdx + 0x60]
add rdx, 0x50
call fcn.140005bc0
mov r9, rsi
mov r8, rbx
mov rdx, rdi
mov rcx, rax
call fcn.140049c70
xor eax, eax
lea rcx, [rsp + 0x70]
mov qword [rbp - 0x58], rax
call fcn.140049f10
mov ebx, eax
test eax, eax
je 0x140007b85
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 0x140007b85
lea rcx, str.Parameters:_n
call fcn.1400073f0
lea rcx, str.__install__to_install_the_service._n
call fcn.1400073f0
lea rcx, str.__remove___to_remove_the_service._n
call fcn.1400073f0
lea rcx, str.__console__to_run_in_console_mode._n
call fcn.1400073f0
mov rax, qword [rbx]
lea rcx, [rbp - 0x50]
mov qword [0x1400d70a0], rax
mov rax, qword [rax + 0x10]
mov qword [rbp - 0x50], rax
lea rax, [0x140007c80]
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 0x140007b85
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.140068870
lea r11, [rsp + 0x500]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret