Function at 0x140021f60
Capabilities:
Enumerate services
Query service status
Stop service

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rbp
push rdi
push r14
lea rbp, [rsp - 0x47]
sub rsp, 0xd0
mov rax, qword [0x1400a9100]
xor rax, rsp
mov qword [rbp + 0x37], rax
movzx r14d, dl
mov rbx, rcx
mov rcx, qword [rcx]
test rcx, rcx
je 0x1400221ac
xor esi, esi
mov dword [rbp - 0x51], esi
lea rax, [rbp - 0x51]
mov qword [rsp + 0x20], rax
mov r9d, 0x24
lea r8, [rbp + 0xf]
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x1400221ac
mov eax, dword [rbp + 0x13]
cmp eax, 1
je 0x1400221a8
mov edi, esi
cmp eax, 3
jne 0x140022016
mov ecx, dword [rbx + 0x14]
call qword [sym.imp.KERNEL32.dll_Sleep]
inc edi
cmp edi, dword [rbx + 0x10]
ja 0x1400221ac
lea rax, [rbp - 0x51]
mov qword [rsp + 0x20], rax
mov r9d, 0x24
lea r8, [rbp + 0xf]
xor edx, edx
mov rcx, qword [rbx]
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x1400221ac
cmp dword [rbp + 0x13], 3
je 0x140021fd6
test r14b, r14b
je 0x140022153
lea rax, [rbp - 0x55]
mov qword [rsp + 0x28], rax
lea rax, [rbp - 0x59]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov edx, 1
mov rcx, qword [rbx]
call qword [sym.imp.ADVAPI32.dll_EnumDependentServicesW]
test eax, eax
jne 0x140022153
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x140022153
mov eax, dword [rbp - 0x59]
test eax, eax
je 0x140022153
mov edi, eax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, edi
mov edx, 8
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbp - 0x49], rax
test rax, rax
je 0x140022153
lea rcx, [rbp - 0x49]
mov qword [rbp - 0x29], rcx
lea rcx, [rbp - 0x55]
mov qword [rsp + 0x28], rcx
lea rcx, [rbp - 0x59]
mov qword [rsp + 0x20], rcx
mov r9d, dword [rbp - 0x59]
mov r8, rax
mov edx, 1
mov rcx, qword [rbx]
call qword [sym.imp.ADVAPI32.dll_EnumDependentServicesW]
test eax, eax
je 0x14002213b
mov r14d, esi
cmp dword [rbp - 0x55], esi
jbe 0x14002213b
nop
mov eax, r14d
lea rcx, [rax + rax*2]
add rcx, rcx
mov rax, qword [rbp - 0x49]
movups xmm2, xmmword [rax + rcx*8]
mov rdi, qword [rbx + 8]
mov dword [rbp - 0x31], 6
mov dword [rbp - 0x2d], 0xbb8
mov r8d, 0x24
movq rdx, xmm2
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov qword [rbp - 0x41], rax
mov qword [rbp - 0x39], rdi
test rax, rax
jne 0x140022117
jmp 0x140022132
xor edx, edx
lea rcx, [rbp - 0x41]
call fcn.140021f60
nop
mov rcx, qword [rbp - 0x41]
test rcx, rcx
je 0x140022132
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
inc r14d
cmp r14d, dword [rbp - 0x55]
jb 0x1400220d0
mov rdi, qword [rbp - 0x49]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rdi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
lea r8, [rbp + 0xf]
mov edx, 1
mov rcx, qword [rbx]
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x1400221ac
cmp dword [rbp + 0x13], 1
je 0x1400221a8
nop
mov ecx, dword [rbx + 0x14]
call qword [sym.imp.KERNEL32.dll_Sleep]
inc esi
cmp esi, dword [rbx + 0x10]
jae 0x1400221ac
lea rax, [rbp - 0x51]
mov qword [rsp + 0x20], rax
mov r9d, 0x24
lea r8, [rbp + 0xf]
xor edx, edx
mov rcx, qword [rbx]
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x1400221ac
cmp dword [rbp + 0x13], 1
jne 0x140022170
mov al, 1
jmp 0x1400221ae
xor al, al
mov rcx, qword [rbp + 0x37]
xor rcx, rsp
call fcn.140053250
lea r11, [rsp + 0xd0]
mov rbx, qword [r11 + 0x28]
mov rsi, qword [r11 + 0x30]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret