Function at 0x140019c70
Capabilities:
Enumerate services

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
mov rbp, rsp
sub rsp, 0x50
mov qword [rbp - 0x20], 0xfffffffffffffffe
xor r8d, r8d
lea rdx, str.EnumSpoolerRelatedService
lea rcx, [rbp - 0x18]
call fcn.140001190
nop
xor edi, edi
mov dword [rbp + 0x48], edi
mov dword [rbp + 0x50], edi
xor eax, eax
mov word [rbp + 0x40], ax
call fcn.140059f20
mov r14, qword [rax + 8]
xor edx, edx
xor ecx, ecx
mov r8d, 0x800f003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov r13, rax
test rax, rax
je 0x140019eab
mov r8d, 0xf01ff
lea rdx, str.SPOOLER
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rsi, rax
test rax, rax
je 0x140019ea2
mov dword [rbp + 0x48], edi
lea rax, [rbp + 0x50]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x48]
mov qword [rsp + 0x20], rax
mov r9d, 1
lea r8, [rbp + 0x40]
mov edx, r9d
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_EnumDependentServicesW]
test eax, eax
jne 0x140019d6a
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
je 0x140019d6a
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, str._t_t_tEnumDependentServices
lea rcx, [rbp - 0x18]
call fcn.1400165d0
lea r8, [0x1402209ac]
lea edx, [rdi + 2]
lea rcx, [rbp - 0x18]
call fcn.140001370
nop
jmp 0x140019ec1
mov edx, dword [rbp + 0x48]
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov r12, rax
mov rcx, rsi
test rax, rax
jne 0x140019dbd
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, str._t_t_tGlobalAlloc
lea rcx, [rbp - 0x18]
call fcn.1400165d0
lea r8, [0x1402209ac]
lea edx, [r12 + 2]
lea rcx, [rbp - 0x18]
call fcn.140001370
nop
jmp 0x140019ec1
lea rax, [rbp + 0x50]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x48]
mov qword [rsp + 0x20], rax
mov r9d, dword [rbp + 0x48]
mov r8, r12
mov edx, 1
call qword [sym.imp.ADVAPI32.dll_EnumDependentServicesW]
test eax, eax
jne 0x140019e2b
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_GlobalFree]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, str._t_t_tEnumDependentServices
lea rcx, [rbp - 0x18]
call fcn.1400165d0
lea r8, [0x1402209ac]
mov edx, 2
lea rcx, [rbp - 0x18]
call fcn.140001370
nop
jmp 0x140019ec1
cmp dword [rbp + 0x50], edi
jbe 0x140019e90
mov rbx, r12
mov eax, dword [rbx + 0x14]
cmp eax, 4
je 0x140019e45
cmp eax, 2
je 0x140019e45
cmp eax, 5
jne 0x140019e85
mov rdx, qword [rbx]
lea rcx, [rbp + 0x58]
call fcn.1400054e0
nop
lea rcx, [r14 + 0x278]
mov r8, rax
mov rdx, qword [rcx + 0x10]
call fcn.140059134
nop
mov rdx, qword [rbp + 0x58]
add rdx, 0xffffffffffffffe8
or eax, 0xffffffff
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140019e85
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + reloc.OLEAUT32.dll_VariantClear]
inc edi
add rbx, 0x30
cmp edi, dword [rbp + 0x50]
jb 0x140019e33
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_GlobalFree]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea r8, [0x1402209ac]
mov edx, 2
lea rcx, [rbp - 0x18]
call fcn.140001370
nop
lea rcx, [rbp - 0x18]
call fcn.140001320
add rsp, 0x50
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret