Function at 0x412846
Capabilities:
Enumerate services

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
push edi
xor eax, eax
mov ebx, ecx
push 5
push str.ServicesActive
mov esi, eax
mov dword [ebp - 0x1c], ebx
push eax
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], eax
mov dword [ebp - 4], eax
mov dword [ebp - 0x20], esi
mov dword [ebp - 0x28], eax
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
je 0x412938
lea eax, [ebx + 0x28]
mov dword [ebp - 0x2c], 1
mov dword [ebp - 0x18], eax
xor ecx, ecx
lea eax, [ebp - 0xc]
push ecx
push eax
lea eax, [ebp - 4]
mov dword [ebp - 0xc], ecx
push eax
lea eax, [ebp - 0x10]
push eax
push ecx
push ecx
push 3
push 0x30
push ecx
push edi
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusExW]
mov esi, dword [ebp - 0x10]
mov ecx, esi
call fcn.00406944
push 0
mov ebx, eax
lea eax, [ebp - 0xc]
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x10]
push eax
push esi
push ebx
push 3
push 0x30
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusExW]
mov esi, dword [ebp - 0x18]
test eax, eax
jne 0x4128e9
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x412935
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
mov dword [ebp - 0x14], eax
cmp dword [ebp - 4], eax
jbe 0x412935
mov edi, ebx
cmp dword [edi], 0
je 0x412935
push dword [edi]
lea ecx, [ebp - 8]
call fcn.0040346a
push dword [esi]
push dword [ebp - 8]
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
test eax, eax
je 0x41294b
mov ecx, dword [ebp - 8]
call fcn.004068b7
mov ecx, dword [ebp - 0x14]
add edi, 0x2c
and dword [ebp - 8], 0
inc ecx
mov dword [ebp - 0x14], ecx
cmp ecx, dword [ebp - 4]
jb 0x4128fc
mov esi, dword [ebp - 0x20]
and dword [ebp - 0x2c], 0
mov ecx, esi
call fcn.004068b7
mov eax, dword [ebp - 0x2c]
pop edi
pop esi
pop ebx
leave
ret
imul esi, dword [ebp - 0x14], 0x2c
lea ecx, [ebp - 0x24]
push dword [esi + ebx]
call fcn.0040346a
push eax
lea ecx, [ebp - 0x20]
call fcn.004035de
mov ecx, dword [ebp - 0x24]
call fcn.004068b7
mov eax, dword [esi + ebx + 0x24]
mov esi, dword [ebp - 0x1c]
mov ecx, dword [ebp - 8]
and dword [ebp - 0x24], 0
mov dword [esi + 0x2c], eax
call fcn.004068b7
and dword [ebp - 8], 0
xor edi, edi
mov eax, dword [esi + 0x2c]
test eax, eax
jne 0x4129cd
inc edi
cmp dword [ebp - 0x28], edi
je 0x412935
mov esi, dword [ebp - 0x18]
push 2
push esi
call fcn.004130d1
push esi
call fcn.0041304c
push ebx
mov dword [ebp - 0x28], edi
call fcn.00401014
pop ecx
push 5
push str.ServicesActive
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
jne 0x41288c
jmp 0x412935
mov ecx, dword [ebp - 4]
mov esi, dword [ebp - 0x20]
mov dword [ebp - 0x28], edi
test ecx, ecx
je 0x41293c
cmp dword [ebx], 0
je 0x41293c
cmp dword [ebx + 0x24], eax
jne 0x412a31
push dword [ebx]
lea ecx, [ebp - 0x18]
call fcn.0040346a
push esi
push dword [ebp - 0x18]
call dword [sym.imp.KERNEL32.dll_lstrcmpW]
test eax, eax
je 0x412a1c
mov edi, dword [ebp - 0x1c]
push ecx
mov ecx, esp
push dword [ebx]
call fcn.0040346a
lea ecx, [edi + 0x44]
call fcn.004131bb
mov edi, dword [ebp - 0x28]
mov ecx, dword [ebp - 0x18]
call fcn.004068b7
mov eax, dword [ebp - 0x1c]
and dword [ebp - 0x18], 0
mov ecx, dword [ebp - 4]
mov eax, dword [eax + 0x2c]
inc edi
add ebx, 0x2c
mov dword [ebp - 0x28], edi
cmp edi, ecx
jb 0x4129de
jmp 0x41293c