Function at 0x140010040
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.14000b870
nop
call fcn.140050920
mov r14, qword [rax + 8]
xor edx, edx
xor ecx, ecx
mov r8d, 0x800f003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov r12, rax
test rax, rax
je 0x14001026e
mov r8d, 0xf01ff
lea rdx, str.SPOOLER
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rsi, rax
test rax, rax
je 0x140010265
xor edi, edi
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 0x14001012e
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
je 0x14001012e
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, str._t_t_tEnumDependentServices
lea rcx, [rbp - 0x18]
call fcn.14000bba0
lea r8, [0x1402145dc]
lea edx, [rdi + 2]
lea rcx, [rbp - 0x18]
call fcn.14000ba50
nop
jmp 0x140010284
mov edx, dword [rbp + 0x48]
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov r13, rax
mov rcx, rsi
test rax, rax
jne 0x140010180
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, str._t_t_tGlobalAlloc
lea rcx, [rbp - 0x18]
call fcn.14000bba0
lea r8, [0x1402145dc]
lea edx, [r13 + 2]
lea rcx, [rbp - 0x18]
call fcn.14000ba50
nop
jmp 0x140010284
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, r13
mov edx, 1
call qword [sym.imp.ADVAPI32.dll_EnumDependentServicesW]
test eax, eax
jne 0x1400101ee
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_GlobalFree]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, str._t_t_tEnumDependentServices
lea rcx, [rbp - 0x18]
call fcn.14000bba0
lea r8, [0x1402145dc]
mov edx, 2
lea rcx, [rbp - 0x18]
call fcn.14000ba50
nop
jmp 0x140010284
cmp dword [rbp + 0x50], edi
jbe 0x140010253
mov rbx, r13
mov eax, dword [rbx + 0x14]
cmp eax, 4
je 0x140010208
cmp eax, 2
je 0x140010208
cmp eax, 5
jne 0x140010248
mov rdx, qword [rbx]
lea rcx, [rbp + 0x58]
call fcn.140001110
nop
lea rcx, [r14 + 0x278]
mov r8, rax
mov rdx, qword [rcx + 0x10]
call fcn.14004fb34
nop
mov rdx, qword [rbp + 0x58]
add rdx, 0xffffffffffffffe8
or eax, 0xffffffff
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140010248
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 0x1400101f6
mov rcx, r13
call qword [sym.imp.KERNEL32.dll_GlobalFree]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea r8, [0x1402145dc]
mov edx, 2
lea rcx, [rbp - 0x18]
call fcn.14000ba50
nop
lea rcx, [rbp - 0x18]
call fcn.14000ba00
add rsp, 0x50
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret