Function at 0x40e6c0
Capabilities:
Enumerate services

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
push 0xffffffffffffffff
push 0x55bca0
mov eax, dword fs:[0]
push eax
sub esp, 0x28
push ebx
push esi
push edi
mov eax, dword [0x5b4450]
xor eax, esp
push eax
lea eax, [esp + 0x38]
mov dword fs:[0], eax
xor esi, esi
push esi
lea eax, [esp + 0x30]
push str.EnumSpoolerRelatedService
push eax
call fcn.0040ac70
add esp, 0xc
mov dword [esp + 0x40], esi
call fcn.00442c4d
mov ecx, dword [eax + 4]
push 0x800f003f
push esi
push esi
mov dword [esp + 0x30], ecx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
mov dword [esp + 0x1c], ebx
cmp ebx, esi
je 0x40e8ca
push 0xf01ff
push str.SPOOLER
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov edi, eax
cmp edi, esi
je 0x40e8c3
lea edx, [esp + 0x18]
push edx
lea eax, [esp + 0x18]
push eax
push 1
lea ecx, [esp + 0x1c]
push ecx
push 1
mov dword [esp + 0x28], esi
mov esi, dword [sym.imp.ADVAPI32.dll_EnumDependentServicesW]
push edi
call esi
test eax, eax
jne 0x40e7a4
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
je 0x40e7a4
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push ebx
call esi
push str._t_t_tEnumDependentServices
lea edx, [esp + 0x30]
push edx
call fcn.0040b040
push 0x58a8c8
push 2
lea eax, [esp + 0x34]
push eax
jmp 0x40e8d6
mov ecx, dword [esp + 0x14]
push ecx
push 0x40
call dword [sym.imp.KERNEL32.dll_GlobalAlloc]
mov ebx, eax
mov dword [esp + 0x20], ebx
test ebx, ebx
jne 0x40e7eb
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
mov edx, dword [esp + 0x1c]
push edx
call esi
push str._t_t_tGlobalAlloc
lea eax, [esp + 0x30]
push eax
call fcn.0040b040
push 0x58a8c8
push 2
lea ecx, [esp + 0x34]
push ecx
jmp 0x40e8d6
mov ecx, dword [esp + 0x14]
lea edx, [esp + 0x18]
push edx
lea eax, [esp + 0x18]
push eax
push ecx
push ebx
push 1
push edi
call esi
test eax, eax
jne 0x40e83b
push ebx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
mov edx, dword [esp + 0x1c]
push edx
call esi
push str._t_t_tEnumDependentServices
lea eax, [esp + 0x30]
push eax
call fcn.0040b040
push 0x58a8c8
push 2
lea ecx, [esp + 0x34]
push ecx
jmp 0x40e8d6
xor ebx, ebx
cmp dword [esp + 0x18], ebx
jbe 0x40e8ad
mov esi, dword [esp + 0x20]
mov eax, dword [esi + 0xc]
cmp eax, 4
je 0x40e859
cmp eax, 2
je 0x40e859
cmp eax, 5
jne 0x40e8a3
mov edx, dword [esi]
push edx
lea ecx, [esp + 0x2c]
call fcn.00401210
mov ecx, dword [esp + 0x24]
add ecx, 0x14c
mov byte [esp + 0x40], 1
mov edx, dword [ecx + 8]
push eax
push edx
call fcn.00442275
mov byte [esp + 0x40], 0
mov eax, dword [esp + 0x28]
add eax, 0xfffffff0
lea ecx, [eax + 0xc]
or edx, 0xffffffff
lock xadd dword [ecx], edx
dec edx
test edx, edx
jg 0x40e8a3
mov ecx, dword [eax]
mov edx, dword [ecx]
push eax
mov eax, dword [edx + 4]
call eax
inc ebx
add esi, 0x24
cmp ebx, dword [esp + 0x18]
jb 0x40e847
mov ecx, dword [esp + 0x20]
push ecx
call dword [sym.imp.KERNEL32.dll_GlobalFree]
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ebx, dword [esp + 0x1c]
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push 0x58a8c8
push 2
lea edx, [esp + 0x34]
push edx
call fcn.0040aed0
add esp, 0xc
lea ecx, [esp + 0x2c]
mov dword [esp + 0x40], 0xffffffff
call fcn.0040ae50
mov ecx, dword [esp + 0x38]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret