Function at 0x140012790
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.140017fc0
nop
call fcn.140054cb8
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 0x1400129be
mov r8d, 0xf01ff
lea rdx, str.SPOOLER
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rsi, rax
test rax, rax
je 0x1400129b5
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 0x14001287e
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
je 0x14001287e
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.140017de0
lea r8, [0x1401c6ea8]
lea edx, [rdi + 2]
lea rcx, [rbp - 0x18]
call fcn.140017c80
nop
jmp 0x1400129d4
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 0x1400128d0
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.140017de0
lea r8, [0x1401c6ea8]
lea edx, [r13 + 2]
lea rcx, [rbp - 0x18]
call fcn.140017c80
nop
jmp 0x1400129d4
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 0x14001293e
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.140017de0
lea r8, [0x1401c6ea8]
mov edx, 2
lea rcx, [rbp - 0x18]
call fcn.140017c80
nop
jmp 0x1400129d4
cmp dword [rbp + 0x50], edi
jbe 0x1400129a3
mov rbx, r13
mov eax, dword [rbx + 0x14]
cmp eax, 4
je 0x140012958
cmp eax, 2
je 0x140012958
cmp eax, 5
jne 0x140012998
mov rdx, qword [rbx]
lea rcx, [rbp + 0x58]
call fcn.1400020c0
nop
lea rcx, [r14 + 0x278]
mov r8, rax
mov rdx, qword [rcx + 0x10]
call fcn.140053ecc
nop
mov rdx, qword [rbp + 0x58]
add rdx, 0xffffffffffffffe8
or eax, 0xffffffff
lock xadd dword [rdx + 0x10], eax
dec eax
test eax, eax
jg 0x140012998
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 0x140012946
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, [0x1401c6ea8]
mov edx, 2
lea rcx, [rbp - 0x18]
call fcn.140017c80
nop
lea rcx, [rbp - 0x18]
call fcn.140018150
add rsp, 0x50
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret