Function at 0x412170
Capabilities:
Enumerate services

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x2c
push ebx
push esi
push edi
mov edi, ecx
mov dword [ebp - 0x14], 0
lea ecx, [ebp - 0x18]
mov dword [ebp - 0x10], 0
mov dword [ebp - 4], 0
call fcn.00403290
push 5
push str.ServicesActive
push 0
mov dword [ebp - 0x1c], 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
test ebx, ebx
je 0x412264
nop dword [eax + eax]
push 0
lea eax, [ebp - 0x10]
mov dword [ebp - 0x10], 0
push eax
lea eax, [ebp - 4]
push eax
lea eax, [ebp - 0x14]
push eax
push 0
push 0
push 3
push 0x30
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusExW]
mov esi, dword [ebp - 0x14]
push esi
call fcn.00407e80
add esp, 4
mov dword [ebp - 8], eax
lea ecx, [ebp - 0x10]
push 0
push ecx
lea ecx, [ebp - 4]
push ecx
lea ecx, [ebp - 0x14]
push ecx
push esi
push eax
push 3
push 0x30
push 0
push ebx
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusExW]
test eax, eax
jne 0x412223
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x412264
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor ebx, ebx
cmp dword [ebp - 4], ebx
jbe 0x412264
mov esi, dword [ebp - 8]
mov eax, dword [esi]
test eax, eax
je 0x412264
push eax
lea ecx, [ebp - 0xc]
call fcn.004032c0
lea eax, [edi + 0x28]
push eax
lea ecx, [ebp - 0xc]
call fcn.004034d0
test eax, eax
jne 0x412277
lea ecx, [ebp - 0xc]
call fcn.00403ca0
inc ebx
add esi, 0x2c
cmp ebx, dword [ebp - 4]
jb 0x412234
lea ecx, [ebp - 0x18]
xor esi, esi
call fcn.00403ca0
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
imul esi, ebx, 0x2c
lea ecx, [ebp - 0x28]
mov ebx, dword [ebp - 8]
push dword [esi + ebx]
call fcn.004032c0
push eax
lea ecx, [ebp - 0x18]
call fcn.00403b40
lea ecx, [ebp - 0x28]
call fcn.00403ca0
mov eax, dword [esi + ebx + 0x24]
lea ecx, [ebp - 0xc]
mov dword [edi + 0x2c], eax
call fcn.00403ca0
mov eax, dword [edi + 0x2c]
test eax, eax
jne 0x412308
cmp dword [ebp - 0x1c], 1
je 0x412264
push 2
lea ebx, [edi + 0x28]
mov ecx, edi
push ebx
call fcn.00412a60
push ebx
mov ecx, edi
call fcn.004129b0
push dword [ebp - 8]
mov dword [ebp - 0x1c], 1
call fcn.0040106e
add esp, 4
push 5
push str.ServicesActive
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
test ebx, ebx
jne 0x4121c0
lea ecx, [ebp - 0x18]
xor esi, esi
call fcn.00403ca0
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
mov edx, dword [ebp - 4]
xor esi, esi
mov dword [ebp - 0x28], esi
test edx, edx
je 0x412484
nop dword [eax + eax]
mov ecx, dword [ebx]
test ecx, ecx
je 0x412484
cmp dword [ebx + 0x24], eax
jne 0x412472
push ecx
lea ecx, [ebp - 0x24]
call fcn.004032c0
lea eax, [ebp - 0x18]
push eax
lea ecx, [ebp - 0x24]
call fcn.004034d0
test eax, eax
jne 0x412464
push dword [ebx]
lea ecx, [ebp - 0x20]
call fcn.004032c0
mov ecx, dword [edi + 0x48]
cmp ecx, dword [edi + 0x44]
jb 0x41244a
lea ebx, [ecx + 1]
mov edx, 4
imul ebx, dword [edi + 0x4c]
xor ecx, ecx
mov eax, ebx
mov dword [ebp - 0x1c], ebx
mul edx
seto cl
neg ecx
or ecx, eax
xor eax, eax
add ecx, 4
setb al
neg eax
or eax, ecx
push eax
call fcn.00407fa0
add esp, 4
test eax, eax
je 0x4123c4
mov esi, ebx
mov dword [eax], ebx
lea edx, [eax + 4]
mov dword [ebp - 0xc], edx
mov ebx, edx
test esi, esi
jbe 0x4123c9
nop dword [eax + eax]
mov ecx, ebx
call fcn.00403290
add ebx, 4
sub esi, 1
jne 0x4123b0
mov edx, dword [ebp - 0xc]
jmp 0x4123c9
xor edx, edx
mov dword [ebp - 0xc], edx
mov ecx, dword [edi + 0x48]
xor esi, esi
test ecx, ecx
je 0x4123f1
mov eax, dword [edi + 0x40]
lea ecx, [esi*4]
add eax, ecx
add ecx, edx
push eax
call fcn.00403b40
mov ecx, dword [edi + 0x48]
inc esi
mov edx, dword [ebp - 0xc]
cmp esi, ecx
jb 0x4123d2
mov eax, dword [edi + 0x40]
test eax, eax
je 0x412438
mov esi, dword [eax - 4]
lea ecx, [eax - 4]
mov dword [ebp - 0x2c], ecx
lea ebx, [eax + esi*4]
test esi, esi
je 0x412422
nop dword [eax + eax]
sub ebx, 4
mov ecx, ebx
call fcn.00403ca0
sub esi, 1
jne 0x412410
mov ecx, dword [ebp - 0x2c]
mov eax, dword [ecx]
lea eax, [eax*4 + 4]
push eax
push ecx
call fcn.00407fd0
mov ecx, dword [edi + 0x48]
add esp, 8
mov eax, dword [ebp - 0xc]
mov ebx, dword [ebp - 8]
mov esi, dword [ebp - 0x28]
mov dword [edi + 0x40], eax
mov eax, dword [ebp - 0x1c]
mov dword [edi + 0x44], eax
lea eax, [ebp - 0x20]
push eax
mov eax, dword [edi + 0x40]
lea ecx, [eax + ecx*4]
call fcn.00403b40
inc dword [edi + 0x48]
lea ecx, [ebp - 0x20]
call fcn.00403ca0
lea ecx, [ebp - 0x24]
call fcn.00403ca0
mov eax, dword [edi + 0x2c]
mov edx, dword [ebp - 4]
inc esi
add ebx, 0x2c
mov dword [ebp - 0x28], esi
mov dword [ebp - 8], ebx
cmp esi, edx
jb 0x412320
lea ecx, [ebp - 0x18]
mov esi, 1
call fcn.00403ca0
pop edi
mov eax, esi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret