Function at 0x140002474
Capabilities:
Query service status

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
push rdi
sub rsp, 0x50
mov rax, qword [0x140014240]
xor rax, rsp
mov qword [rsp + 0x40], rax
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 1]
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_OpenSCManagerW]
mov rdi, rax
test rax, rax
jne 0x1400023c5
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
jmp 0x140002452
mov r8d, 0x14
lea rdx, str.DiagnosticsHub.StandardCollector.Service
mov rcx, rdi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_OpenServiceW]
mov rbx, rax
test rax, rax
je 0x14000240e
lea rdx, [rsp + 0x20]
mov rcx, rax
call qword [sym.imp.api_ms_win_service_winsvc_l1_2_0.dll_QueryServiceStatus]
test eax, eax
je 0x14000240e
cmp dword [rsp + 0x24], 1
jne 0x14000242d
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_StartServiceW]
test eax, eax
jne 0x140002424
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
jmp 0x14000243b
lea rcx, str.SUCCESS:_The_service_was_started_successfully_n
jmp 0x140002434
lea rcx, str.WARNING:_The_service_is_already_started_n
call fcn.14000bc50
xor esi, esi
test rbx, rbx
je 0x140002449
mov rcx, rbx
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CloseServiceHandle]
mov rcx, rdi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CloseServiceHandle]
mov eax, esi
mov rcx, qword [rsp + 0x40]
xor rcx, rsp
call fcn.14000ab00
mov rbx, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
add rsp, 0x50
pop rdi
ret
mov qword [rsp + 8], rbx
mov qword [rsp + 0x10], rsi
push rdi
sub rsp, 0x50
mov rax, qword [0x140014240]
xor rax, rsp
mov qword [rsp + 0x40], rax
mov esi, 1
xor edx, edx
mov r8d, esi
xor ecx, ecx
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_OpenSCManagerW]
mov rdi, rax
test rax, rax
jne 0x1400024c5
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
jmp 0x140002553
mov r8d, 0x24
lea rdx, str.DiagnosticsHub.StandardCollector.Service
mov rcx, rdi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_OpenServiceW]
mov rbx, rax
test rax, rax
je 0x14000250f
lea rdx, [rsp + 0x20]
mov rcx, rax
call qword [sym.imp.api_ms_win_service_winsvc_l1_2_0.dll_QueryServiceStatus]
test eax, eax
je 0x14000250f
cmp dword [rsp + 0x24], esi
je 0x14000252e
lea r8, [rsp + 0x20]
mov edx, esi
mov rcx, rbx
call qword [sym.imp.api_ms_win_service_winsvc_l1_2_0.dll_ControlService]
test eax, eax
jne 0x140002525
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
jmp 0x14000253c
lea rcx, str.SUCCESS:_The_service_was_stopped_successfully_n
jmp 0x140002535
lea rcx, str.WARNING:_The_service_is_already_stopped_n
call fcn.14000bc50
xor esi, esi
test rbx, rbx
je 0x14000254a
mov rcx, rbx
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CloseServiceHandle]
mov rcx, rdi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CloseServiceHandle]
mov eax, esi
mov rcx, qword [rsp + 0x40]
xor rcx, rsp
call fcn.14000ab00
mov rbx, qword [rsp + 0x60]
mov rsi, qword [rsp + 0x68]
add rsp, 0x50
pop rdi
ret
sub rsp, 0x48
cmp r8d, 4
jle 0x140002b1b
cmp r8d, 6
jle 0x140002ab6
cmp r8d, 8
jle 0x140002b1b
or eax, 0xffffffff
add rsp, 0x48
ret
cmp dword [rdx], 5
jne 0x140002b0f
and qword [rsp + 0x30], 0
lea rax, str.DiagnosticsHub.StandardCollector.Service
and qword [rsp + 0x38], 0
lea rcx, [rsp + 0x20]
mov qword [rsp + 0x20], rax
lea rax, [0x140002b90]
mov qword [rsp + 0x28], rax
call qword [sym.imp.api_ms_win_service_core_l1_1_1.dll_StartServiceCtrlDispatcherW]
test eax, eax
jne 0x140002b14
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_1.dll_GetLastError]
mov ecx, eax
cmp eax, 0x420
je 0x140002b14
movzx eax, cx
or eax, 0x80070000
test ecx, ecx
cmovle eax, ecx
add rsp, 0x48
ret
call fcn.140002c20
xor eax, eax
add rsp, 0x48
ret
mov ecx, dword [rdx]
sub ecx, 3
je 0x140002b3a
cmp ecx, 1
je 0x140002b31
mov eax, 0x8000ffff
add rsp, 0x48
ret
add rsp, 0x48
jmp 0x140002474
add rsp, 0x48
jmp 0x140002378