Function at 0x140059140
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 [0x14010b010]
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, [0x1400e3218]
test rax, rax
je 0x140059200
mov r8d, 0xf003f
mov rdx, r12
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
je 0x1400591f7
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 0x1400594be
mov rdx, qword [rsi + 8]
movzx eax, word [rdx]
sub ax, 0x2d
mov ecx, 0xfffd
test cx, ax
jne 0x1400594be
add rdx, 2
lea rcx, str.install
call fcn.140099eac
test eax, eax
jne 0x14005935e
mov r8d, 0x104
lea rdx, [rbp]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
test eax, eax
jne 0x14005926a
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.GetModuleFileName_failed_w_err_0x_08lx_n
call fcn.1400590e0
jmp 0x1400595ac
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 0x1400592b1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenSCManager_failed_w_err_0x_08lx_n
call fcn.1400590e0
jmp 0x1400595ac
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x58], r15
lea rax, [0x1400d9d10]
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, [0x1400e31f0]
mov rdx, r12
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov rdi, rax
test rax, rax
jne 0x140059338
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.CreateService_failed_w_err_0x_08lx_n
call fcn.1400590e0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x1400595ac
mov rdx, r12
lea rcx, str._s_is_installed._n
call fcn.1400590e0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x1400595ac
mov rdx, qword [rsi + 8]
add rdx, 2
lea rcx, str.remove
call fcn.140099eac
test eax, eax
jne 0x1400595ac
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 0x140059298
mov r8d, 0x10024
mov rdx, r12
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
jne 0x1400593e1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenService_failed_w_err_0x_08lx_n
call fcn.1400590e0
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x1400595ac
lea r8, [rsp + 0x70]
mov edx, 1
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x140059475
mov rdx, r12
lea rcx, str.Stopping__s.
call fcn.1400590e0
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 0x140059456
mov eax, dword [rsp + 0x74]
cmp eax, 3
jne 0x14005945a
lea rcx, [0x1400dc01c]
call fcn.1400590e0
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 0x140059424
mov eax, dword [rsp + 0x74]
mov rdx, r12
cmp eax, 1
lea rcx, str._n_s_is_stopped._n
je 0x140059470
lea rcx, str._n_s_failed_to_stop._n
call fcn.1400590e0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
jne 0x140059498
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.DeleteService_failed_w_err_0x_08lx_n
call fcn.1400590e0
jmp 0x1400594a7
mov rdx, r12
lea rcx, str._s_is_removed._n
call fcn.1400590e0
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x1400595ac
lea rcx, str.Parameters:_n
call fcn.1400590e0
lea rcx, str.__install__to_install_the_service._n
call fcn.1400590e0
lea rcx, str.__remove___to_remove_the_service._n
call fcn.1400590e0
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 0x1400595d9
lea rax, [rbp - 0x60]
mov qword [0x1401114f8], rax
mov rax, qword [rbp - 0x58]
mov qword [rsp + 0x70], rax
lea rax, [0x140058b00]
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 0x140059599
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.Service_failed_to_run_w_err_0x_08lx_n
call fcn.1400590e0
mov qword [rbp - 0x60], rbx
mov rcx, qword [rbp - 0x20]
test rcx, rcx
je 0x1400595ac
call qword [sym.imp.KERNEL32.dll_CloseHandle]
xor eax, eax
mov rcx, qword [rbp + 0x420]
xor rcx, rsp
call fcn.1400612f0
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, [0x1400f9348]
lea rcx, [rbp - 0x10]
call fcn.14008da30
int3