Function at 0x4c4bfc
Capabilities:
Enumerate services
Query service configuration

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffffcc
push ebx
push esi
push edi
or ebx, 0xffffffff
mov edi, dword [ebp + 0xc]
mov esi, dword [ebp + 8]
push esi
call fcn.004c4540
pop ecx
test eax, eax
je 0x4c4e0b
test edi, edi
je 0x4c4e0b
push str.ADVAPI32
call sub.KERNEL32.DLL_GetModuleHandleA
test eax, eax
je 0x4c4e0b
push str.QueryServiceConfig2A
push eax
call sub.KERNEL32.DLL_GetProcAddress
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
je 0x4c4e0b
push 0xf003f
push 0
push 0
call sub.ADVAPI32.DLL_OpenSCManagerA
mov dword [ebp - 8], eax
cmp dword [ebp - 8], 0
je 0x4c4e02
xor eax, eax
mov dword [ebp - 0x24], eax
lea edx, [ebp - 0x24]
push edx
lea ecx, [ebp - 0x20]
push ecx
lea eax, [ebp - 0x1c]
push eax
push 0
push 0
push 3
mov edx, dword [ebp + 0x10]
push edx
mov ecx, dword [ebp - 8]
push ecx
call sub.ADVAPI32.DLL_EnumServicesStatusA
test eax, eax
jne 0x4c4e02
call sub.KERNEL32.DLL_GetLastError
cmp eax, 0xea
jne 0x4c4e02
mov eax, dword [ebp - 0x1c]
mov dword [ebp - 0x28], eax
mov edx, dword [ebp - 0x28]
push edx
push 0x40
call sub.KERNEL32.DLL_LocalAlloc
mov dword [ebp - 0x10], eax
lea ecx, [ebp - 0x24]
push ecx
lea eax, [ebp - 0x20]
push eax
lea edx, [ebp - 0x1c]
push edx
mov ecx, dword [ebp - 0x28]
push ecx
mov eax, dword [ebp - 0x10]
push eax
push 3
mov edx, dword [ebp + 0x10]
push edx
mov ecx, dword [ebp - 8]
push ecx
call sub.ADVAPI32.DLL_EnumServicesStatusA
xor eax, eax
mov dword [ebp - 0x2c], eax
mov edx, dword [ebp - 0x10]
mov ecx, edx
mov dword [ebp - 0x34], ecx
mov eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x20]
jae 0x4c4df9
push 1
mov edx, dword [ebp - 0x34]
mov ecx, dword [edx]
push ecx
mov eax, dword [ebp - 8]
push eax
call sub.ADVAPI32.DLL_OpenServiceA
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x4c4de6
xor edx, edx
lea ecx, [ebp - 0x1c]
mov dword [ebp - 0x1c], edx
push ecx
push 0
push 0
mov eax, dword [ebp - 0xc]
push eax
call sub.ADVAPI32.DLL_QueryServiceConfigA
mov edx, dword [ebp - 0x1c]
push edx
push 0x40
call sub.KERNEL32.DLL_LocalAlloc
mov dword [ebp - 0x14], eax
lea ecx, [ebp - 0x1c]
push ecx
mov eax, dword [ebp - 0x1c]
push eax
mov edx, dword [ebp - 0x14]
push edx
mov ecx, dword [ebp - 0xc]
push ecx
call sub.ADVAPI32.DLL_QueryServiceConfigA
test eax, eax
lea ecx, [ebp - 0x1c]
setne al
and eax, 1
xor edx, edx
mov byte [ebp - 0x2d], al
mov dword [ebp - 0x1c], edx
push ecx
push 0
push 0
push 1
mov eax, dword [ebp - 0xc]
push eax
call dword [ebp - 4]
mov edx, dword [ebp - 0x1c]
push edx
push 0x40
call sub.KERNEL32.DLL_LocalAlloc
mov dword [ebp - 0x18], eax
lea ecx, [ebp - 0x1c]
push ecx
mov eax, dword [ebp - 0x1c]
push eax
mov edx, dword [ebp - 0x18]
push edx
push 1
mov ecx, dword [ebp - 0xc]
push ecx
call dword [ebp - 4]
test eax, eax
setne al
and eax, 1
and byte [ebp - 0x2d], al
cmp byte [ebp - 0x2d], 0
je 0x4c4dcb
mov edx, dword [ebp - 0x18]
push edx
mov ecx, dword [ebp - 0x14]
push ecx
mov eax, dword [ebp - 0x2c]
shl eax, 2
lea eax, [eax + eax*8]
add eax, dword [ebp - 0x10]
push eax
push esi
call fcn.004c491c
add esp, 0x10
push eax
push edi
call fcn.004129e8
add esp, 8
inc ebx
mov edx, dword [ebp - 0x14]
push edx
call sub.KERNEL32.DLL_LocalFree
mov ecx, dword [ebp - 0x18]
push ecx
call sub.KERNEL32.DLL_LocalFree
mov eax, dword [ebp - 0xc]
push eax
call sub.ADVAPI32.DLL_CloseServiceHandle
inc dword [ebp - 0x2c]
add dword [ebp - 0x34], 0x24
mov edx, dword [ebp - 0x2c]
cmp edx, dword [ebp - 0x20]
jb 0x4c4cf6
mov ecx, dword [ebp - 0x10]
push ecx
call sub.KERNEL32.DLL_LocalFree
mov eax, dword [ebp - 8]
push eax
call sub.ADVAPI32.DLL_CloseServiceHandle
mov eax, ebx
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret