Function at 0x140045670
Capabilities:
Query service status

Disassembly:
mov qword [rsp + 0x18], rbx
push rbp
push r14
push r15
sub rsp, 0x40
mov rbx, rdx
mov r15, r8
xor edx, edx
xor ecx, ecx
mov r14, r9
lea r8d, [rdx + 4]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rbp, rax
test rax, rax
jne 0x1400456d7
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r9, str.ERROR
mov dword [rsp + 0x20], eax
lea r8, [0x1400cbd78]
mov ebx, eax
lea rdx, str.__s_____s___0x_lx__open_scmanager_failed._r_n
lea ecx, [rbp + 3]
call fcn.14000afc0
mov eax, ebx
mov rbx, qword [rsp + 0x70]
add rsp, 0x40
pop r15
pop r14
pop rbp
ret
mov r8d, 5
mov qword [rsp + 0x60], rsi
mov rdx, rbx
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rsi, rax
test rax, rax
jne 0x140045724
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r9, str.ERROR
mov dword [rsp + 0x20], eax
lea r8, [0x1400cbd78]
mov ebx, eax
lea rdx, str.__s_____s___0x_lx__open_service_failed._r_n
lea ecx, [rsi + 3]
call fcn.14000afc0
jmp 0x140045998
lea r9, [rsp + 0x30]
mov qword [rsp + 0x68], rdi
xor r8d, r8d
mov dword [rsp + 0x30], 0
xor edx, edx
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x14004577d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp eax, 0x7a
je 0x14004577d
lea r9, str.ERROR
mov dword [rsp + 0x20], eax
lea r8, [0x1400cbd78]
mov ecx, 3
lea rdx, str.__s_____s___0x_lx__QueryServiceConfig_get_buffer_failed._r_n
call fcn.14000afc0
jmp 0x14004582d
mov edx, dword [rsp + 0x30]
mov ecx, 1
call fcn.1400a8ec4
mov rbx, rax
test rax, rax
jne 0x1400457bd
mov ebx, 0x23300002
lea r9, str.ERROR
lea r8, [0x1400cbd78]
mov dword [rsp + 0x20], ebx
lea rdx, str.__s_____s___0x_lx__alloc_memory_failed._r_n
mov edi, ebx
lea ecx, [rax + 3]
call fcn.14000afc0
jmp 0x140045833
mov r8d, dword [rsp + 0x30]
lea r9, [rsp + 0x30]
mov rdx, rbx
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigW]
test eax, eax
jne 0x140045804
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r9, str.ERROR
mov ecx, 3
lea r8, [0x1400cbd78]
mov dword [rsp + 0x20], eax
lea rdx, str.__s_____s___0x_lx__QueryServiceConfig_failed._r_n
mov edi, eax
call fcn.14000afc0
jmp 0x140045825
mov rdx, qword [rbx + 0x10]
mov r8, 0xffffffffffffffff
nop
inc r8
cmp word [rdx + r8*2], 0
jne 0x140045810
mov rcx, r14
call fcn.140004810
xor edi, edi
mov rcx, rbx
call fcn.1400a8ecc
mov ebx, edi
test edi, edi
je 0x14004585b
lea r9, str.ERROR
mov dword [rsp + 0x20], edi
lea r8, [0x1400cbd78]
mov ecx, 3
lea rdx, str.__s_____s___0x_lx__query_service_filepath_failed_r_n
call fcn.14000afc0
jmp 0x140045993
lea rax, [rsp + 0x30]
mov dword [rsp + 0x30], 0
xor r9d, r9d
mov qword [rsp + 0x20], rax
xor r8d, r8d
xor edx, edx
mov rcx, rsi
mov edi, 0xffffffff
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x1400458bc
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edi, eax
cmp eax, 0x7a
je 0x1400458bc
lea r9, str.ERROR
mov dword [rsp + 0x20], eax
lea r8, [0x1400cbd78]
mov ecx, 3
lea rdx, str.__s_____s___0x_lx__QueryServiceStatusEx_get_buffer_failed._r_n
call fcn.14000afc0
jmp 0x140045966
mov edx, dword [rsp + 0x30]
mov ecx, 1
call fcn.1400a8ec4
mov rbx, rax
test rax, rax
jne 0x1400458fc
mov ebx, 0x23300002
lea r9, str.ERROR
lea r8, [0x1400cbd78]
mov dword [rsp + 0x20], ebx
lea rdx, str.__s_____s___0x_lx__alloc_memory_failed._r_n
mov edi, ebx
lea ecx, [rax + 3]
call fcn.14000afc0
jmp 0x14004596c
mov r9d, dword [rsp + 0x30]
lea rax, [rsp + 0x30]
mov r8, rbx
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x14004594a
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea r9, str.ERROR
mov ecx, 3
lea r8, [0x1400cbd78]
mov dword [rsp + 0x20], eax
lea rdx, str.__s_____s___0x_lx__QueryServiceStatusEx_failed._r_n
mov edi, eax
call fcn.14000afc0
jmp 0x14004595e
mov eax, dword [rbx + 4]
dec eax
test eax, 0xfffffffd
je 0x14004595e
mov eax, dword [rbx + 0x1c]
xor edi, edi
mov dword [r15], eax
mov rcx, rbx
call fcn.1400a8ecc
mov ebx, edi
test edi, edi
je 0x140045991
lea r9, str.ERROR
mov dword [rsp + 0x20], edi
lea r8, [0x1400cbd78]
mov ecx, 3
lea rdx, str.__s_____s___0x_lx__query_service_status_failed_r_n
call fcn.14000afc0
jmp 0x140045993
xor ebx, ebx
mov rdi, qword [rsp + 0x68]
mov rcx, rbp
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test rsi, rsi
je 0x1400459af
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rsi, qword [rsp + 0x60]
mov eax, ebx
mov rbx, qword [rsp + 0x70]
add rsp, 0x40
pop r15
pop r14
pop rbp
ret