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

Disassembly:
mov rax, rsp
push rbp
lea rbp, [rax - 0x228]
sub rsp, 0x320
mov qword [rsp + 0x70], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x14004e038]
xor rax, rsp
mov qword [rbp + 0x210], rax
mov rbx, rdx
cmp ecx, 1
jle 0x1400041e7
mov rdx, qword [rdx + 8]
movzx eax, word [rdx]
sub ax, 0x2d
mov ecx, 0xfffd
test cx, ax
jne 0x1400041e7
add rdx, 2
lea rcx, str.install
call fcn.1400181d4
test eax, eax
jne 0x140003fcc
mov r8d, 0x104
lea rdx, [rbp]
xor ecx, ecx
call qword [sym.imp.api_ms_win_core_libraryloader_l1_2_0.dll_GetModuleFileNameW]
test eax, eax
jne 0x140003f24
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edx, eax
lea rcx, str.GetModuleFileName_failed_w_err_0x_08lx_n
call fcn.140004350
jmp 0x140004304
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 3]
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_OpenSCManagerW]
mov rsi, rax
test rax, rax
je 0x14000400f
xor ebx, ebx
mov qword [rsp + 0x60], rbx
mov qword [rsp + 0x58], rbx
lea rax, [0x1400438fc]
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x48], rbx
mov qword [rsp + 0x40], rbx
lea rax, [rbp]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 0x10
lea r9d, [rbx + 4]
lea r8, [0x140043720]
lea rdi, str.FMAPOService
mov rdx, rdi
mov rcx, rsi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CreateServiceW]
mov rbx, rax
test rax, rax
jne 0x140003fc0
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edx, eax
lea rcx, str.CreateService_failed_w_err_0x_08lx_n
call fcn.140004350
jmp 0x140004123
lea rcx, str._s_is_installed._n
jmp 0x14000411b
mov rdx, qword [rbx + 8]
add rdx, 2
lea rcx, str.remove
call fcn.1400181d4
test eax, eax
jne 0x140004143
xor eax, eax
mov qword [rbp - 0x20], rax
mov qword [rbp - 0x18], rax
mov qword [rbp - 0x10], rax
mov dword [rbp - 8], eax
xor edx, edx
xor ecx, ecx
lea r8d, [rax + 1]
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_OpenSCManagerW]
mov rsi, rax
test rax, rax
jne 0x140004028
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenSCManager_failed_w_err_0x_08lx_n
call fcn.140004350
jmp 0x140004304
mov r8d, 0x10024
lea rdi, str.FMAPOService
mov rdx, rdi
mov rcx, rsi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_OpenServiceW]
mov rbx, rax
test rax, rax
jne 0x140004062
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenService_failed_w_err_0x_08lx_n
call fcn.140004350
jmp 0x140004123
lea r8, [rbp - 0x20]
mov edx, 1
mov rcx, rbx
call qword [sym.imp.api_ms_win_service_winsvc_l1_1_0.dll_ControlService]
test eax, eax
je 0x1400040f1
mov rdx, rdi
lea rcx, str.Stopping__s.
call fcn.140004350
mov ecx, 0x3e8
call qword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_Sleep]
lea rdx, [rbp - 0x20]
mov rcx, rbx
call qword [sym.imp.api_ms_win_service_winsvc_l1_1_0.dll_QueryServiceStatus]
test eax, eax
je 0x1400040d3
mov eax, dword [rbp - 0x1c]
cmp eax, 3
jne 0x1400040d6
lea rcx, [0x140047634]
call fcn.140004350
mov ecx, 0x3e8
call qword [sym.imp.api_ms_win_core_synch_l1_2_0.dll_Sleep]
lea rdx, [rbp - 0x20]
mov rcx, rbx
call qword [sym.imp.api_ms_win_service_winsvc_l1_1_0.dll_QueryServiceStatus]
test eax, eax
jne 0x1400040a3
mov eax, dword [rbp - 0x1c]
mov rdx, rdi
cmp eax, 1
lea rcx, [0x140047638]
je 0x1400040ec
lea rcx, str._n_s_failed_to_stop._n
call fcn.140004350
mov rcx, rbx
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_DeleteService]
test eax, eax
jne 0x140004114
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edx, eax
lea rcx, str.DeleteService_failed_w_err_0x_08lx_n
call fcn.140004350
jmp 0x140004123
lea rcx, str._s_is_removed._n
mov rdx, rdi
call fcn.140004350
mov rcx, rsi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CloseServiceHandle]
test rbx, rbx
je 0x140004304
mov rcx, rbx
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CloseServiceHandle]
jmp 0x140004304
mov rdx, qword [rbx + 8]
add rdx, 2
lea rcx, str.console
call fcn.1400181d4
test eax, eax
jne 0x140004304
xor edx, edx
lea r8d, [rax + 0x58]
lea rcx, [rbp - 0x80]
call fcn.140011520
mov dword [rbp - 0x78], 0xffffffff
xor ebx, ebx
mov qword [rbp - 0x40], rbx
lea rdi, str.FMAPOService
mov qword [rbp - 0x70], rdi
mov qword [rbp - 0x48], rbx
mov dword [rbp - 0x68], 0x10
mov dword [rbp - 0x64], 2
mov qword [rbp - 0x60], 5
mov qword [rbp - 0x58], rbx
mov dword [rbp - 0x50], ebx
lea rdi, vtable.CSampleService.0
mov qword [rbp - 0x80], rdi
mov qword [rbp - 0x38], rbx
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_CreateEventW]
mov qword [0x140051078], rax
lea rcx, [rbp - 0x80]
mov rax, qword [rbp - 0x80]
call qword [rax + 0x30]
mov esi, eax
test eax, eax
jne 0x14000432e
jmp 0x1400042cd
lea rcx, str.Parameters:_n
call fcn.140004350
lea rcx, str.__install__to_install_the_service._n
call fcn.140004350
lea rcx, str.__remove___to_remove_the_service._n
call fcn.140004350
lea rcx, str.__console__to_run_in_console_mode._n
call fcn.140004350
xor edx, edx
lea r8d, [rdx + 0x58]
lea rcx, [rbp - 0x80]
call fcn.140011520
mov dword [rbp - 0x78], 0xffffffff
xor ebx, ebx
mov qword [rbp - 0x40], rbx
lea rdi, str.FMAPOService
mov qword [rbp - 0x70], rdi
mov qword [rbp - 0x48], rbx
mov dword [rbp - 0x68], 0x10
mov dword [rbp - 0x64], 2
mov qword [rbp - 0x60], 5
mov qword [rbp - 0x58], rbx
mov dword [rbp - 0x50], ebx
lea rdi, vtable.CSampleService.0
mov qword [rbp - 0x80], rdi
mov qword [rbp - 0x38], rbx
xor r9d, r9d
xor r8d, r8d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.api_ms_win_core_synch_l1_1_0.dll_CreateEventW]
mov qword [0x140051078], rax
lea rax, [rbp - 0x80]
mov qword [0x140051080], rax
mov rax, qword [rbp - 0x70]
mov qword [rbp - 0x20], rax
lea rax, [0x14000bd50]
mov qword [rbp - 0x18], rax
mov qword [rbp - 0x10], rbx
mov qword [rbp - 8], rbx
lea rcx, [rbp - 0x20]
call qword [sym.imp.api_ms_win_service_core_l1_1_0.dll_StartServiceCtrlDispatcherW]
test eax, eax
jne 0x1400042cd
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edx, eax
lea rcx, str.Service_failed_to_run_w_err_0x_08lx_n
call fcn.140004350
mov rcx, qword [0x140051078]
test rcx, rcx
mov qword [rbp - 0x80], rdi
je 0x1400042e3
call qword [sym.imp.api_ms_win_core_handle_l1_1_0.dll_CloseHandle]
mov rcx, qword [rbp - 0x40]
lea rax, vtable.CServiceBase.0
test rcx, rcx
mov qword [rbp - 0x80], rax
mov qword [0x140051078], rbx
je 0x140004304
call qword [sym.imp.USER32.dll_UnregisterPowerSettingNotification]
xor eax, eax
mov rcx, qword [rbp + 0x210]
xor rcx, rsp
call fcn.14000c610
lea r11, [rsp + 0x320]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x20]
mov rdi, qword [r11 + 0x28]
mov rsp, r11
pop rbp
ret
mov edx, esi
lea rcx, str.RpcServerConnect_returned:_0x_x_n
call fcn.140009e50
mov ecx, esi
call fcn.140018ca0
int3