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

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], rsi
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0x430]
sub rsp, 0x530
mov rax, qword [0x14010a010]
xor rax, rsp
mov qword [rbp + 0x420], rax
mov rsi, rdx
mov r14d, ecx
mov qword [rbp - 0x10], 1
xor r15d, r15d
mov dword [rsp + 0x70], 0x15180
mov qword [rbp - 0x80], r15
mov qword [rsp + 0x78], r15
mov dword [rbp - 0x78], 1
lea rax, [rbp - 0x10]
mov qword [rbp - 0x70], rax
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rdi, rax
lea r12, [0x1400e21d8]
test rax, rax
je 0x140058ef0
mov r8d, 0xf003f
mov rdx, r12
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
je 0x140058ee7
lea r8, [rsp + 0x70]
lea edx, [r15 + 2]
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
cmp r14d, 1
jle 0x1400591ae
mov rdx, qword [rsi + 8]
movzx eax, word [rdx]
sub ax, 0x2d
mov ecx, 0xfffd
test cx, ax
jne 0x1400591ae
add rdx, 2
lea rcx, str.install
call fcn.140099b9c
test eax, eax
jne 0x14005904e
mov r8d, 0x104
lea rdx, [rbp]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x140058f5a
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.GetModuleFileName_failed_w_err_0x_08lx_n
call fcn.140058dd0
jmp 0x14005929c
lea r8, [rbp]
lea rdx, str.__s_
lea rcx, [rbp + 0x210]
call qword [sym.imp.USER32.dll_wsprintfW]
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 3]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rbx, rax
test rax, rax
jne 0x140058fa1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenSCManager_failed_w_err_0x_08lx_n
call fcn.140058dd0
jmp 0x14005929c
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x58], r15
lea rax, [0x1400d8d10]
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x48], r15
mov qword [rsp + 0x40], r15
lea rax, [rbp + 0x210]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 0x10
mov r9d, 4
lea r8, [0x1400e21b0]
mov rdx, r12
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov rdi, rax
test rax, rax
jne 0x140059028
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.CreateService_failed_w_err_0x_08lx_n
call fcn.140058dd0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x14005929c
mov rdx, r12
lea rcx, str._s_is_installed._n
call fcn.140058dd0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x14005929c
mov rdx, qword [rsi + 8]
add rdx, 2
lea rcx, str.remove
call fcn.140099b9c
test eax, eax
jne 0x14005929c
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rsp + 0x70], xmm0
mov qword [rbp - 0x80], rax
mov dword [rbp - 0x78], eax
xor edx, edx
xor ecx, ecx
lea r8d, [rax + 1]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rdi, rax
test rax, rax
je 0x140058f88
mov r8d, 0x10024
mov rdx, r12
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
jne 0x1400590d1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenService_failed_w_err_0x_08lx_n
call fcn.140058dd0
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x14005929c
lea r8, [rsp + 0x70]
mov edx, 1
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x140059165
mov rdx, r12
lea rcx, str.Stopping__s.
call fcn.140058dd0
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 0x140059146
mov eax, dword [rsp + 0x74]
cmp eax, 3
jne 0x14005914a
lea rcx, [0x1400dafdc]
call fcn.140058dd0
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 0x140059114
mov eax, dword [rsp + 0x74]
mov rdx, r12
cmp eax, 1
lea rcx, str._n_s_is_stopped._n
je 0x140059160
lea rcx, str._n_s_failed_to_stop._n
call fcn.140058dd0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x140059188
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.DeleteService_failed_w_err_0x_08lx_n
call fcn.140058dd0
jmp 0x140059197
mov rdx, r12
lea rcx, str._s_is_removed._n
call fcn.140058dd0
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x14005929c
lea rcx, str.Parameters:_n
call fcn.140058dd0
lea rcx, str.__install__to_install_the_service._n
call fcn.140058dd0
lea rcx, str.__remove___to_remove_the_service._n
call fcn.140058dd0
xorps xmm0, xmm0
xor eax, eax
movups xmmword [rbp - 0x60], xmm0
movups xmmword [rbp - 0x50], xmm0
movups xmmword [rbp - 0x40], xmm0
movups xmmword [rbp - 0x30], xmm0
mov qword [rbp - 0x20], rax
mov qword [rbp - 0x58], r12
mov qword [rbp - 0x30], r15
mov dword [rbp - 0x50], 0x10
mov dword [rbp - 0x4c], 2
mov qword [rbp - 0x48], 0x85
mov qword [rbp - 0x40], r15
mov dword [rbp - 0x38], r15d
lea rbx, vtable.CSampleService.0
mov qword [rbp - 0x60], rbx
mov dword [rbp - 0x28], r15d
xor r9d, r9d
xor r8d, r8d
lea edx, [rax + 1]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_CreateEventW]
mov qword [rbp - 0x20], rax
test rax, rax
je 0x1400592c9
lea rax, [rbp - 0x60]
mov qword [0x1401104f8], rax
mov rax, qword [rbp - 0x58]
mov qword [rsp + 0x70], rax
lea rax, [0x1400587f0]
mov qword [rsp + 0x78], rax
mov qword [rbp - 0x80], r15
mov qword [rbp - 0x78], r15
lea rcx, [rsp + 0x70]
call qword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
test eax, eax
jne 0x140059289
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.Service_failed_to_run_w_err_0x_08lx_n
call fcn.140058dd0
mov qword [rbp - 0x60], rbx
mov rcx, qword [rbp - 0x20]
test rcx, rcx
je 0x14005929c
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov rcx, qword [rbp + 0x420]
xor rcx, rsp
call fcn.140060fe0
lea r11, [rsp + 0x530]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop
mov dword [rbp - 0x10], eax
lea rdx, [0x1400f82b8]
lea rcx, [rbp - 0x10]
call fcn.14008d720
int3