Function at 0x4022e0
Capabilities:
Enumerate services

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x18
push ebx
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
push 0xf003f
push 0
push 0
mov dword [ebp - 8], 0
mov dword [ebp - 0x10], 0
mov dword [ebp - 0xc], 0
mov dword [ebp - 4], 0
call esi
mov ebx, eax
mov dword [ebp - 0x18], ebx
test ebx, ebx
jne 0x402333
push 5
push eax
push eax
call esi
mov ebx, eax
mov dword [ebp - 0x18], eax
test ebx, ebx
jne 0x402333
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
push edi
mov edi, dword [sym.imp.ADVAPI32.dll_EnumServicesStatusExA]
lea eax, [ebp - 4]
push 0
push 0
push eax
lea eax, [ebp - 0xc]
push eax
push 0
push 0
push 3
push 0x30
push 0
push ebx
call edi
mov esi, dword [ebp - 0xc]
add esi, 0x2c
push esi
call fcn.00416e4b
push esi
push 0
push eax
mov dword [ebp - 0x14], eax
call fcn.00413b10
add esp, 0x10
lea eax, [ebp - 4]
push 0
push 0
push eax
lea eax, [ebp - 0xc]
push eax
push esi
mov esi, dword [ebp - 0x14]
push esi
push 3
push 0x30
push 0
push ebx
call edi
test eax, eax
jne 0x4023a5
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push esi
call fcn.00416e46
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret
xor ebx, ebx
cmp dword [ebp - 4], ebx
jbe 0x402408
mov eax, dword [ebp + 8]
mov edi, esi
cmp byte [eax], 0
mov esi, eax
je 0x4023ff
push esi
push dword [edi]
call fcn.00413800
add esp, 8
test eax, eax
jne 0x4023e2
mov ecx, esi
lea edx, [ecx + 1]
nop dword [eax]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4023d0
sub ecx, edx
inc esi
add esi, ecx
cmp byte [esi], al
jne 0x4023b8
jmp 0x4023fc
mov ecx, dword [edi]
lea edx, [ecx + 1]
mov al, byte [ecx]
inc ecx
test al, al
jne 0x4023e7
mov eax, dword [ebp - 8]
sub ecx, edx
inc eax
add eax, ecx
inc dword [ebp - 0x10]
mov dword [ebp - 8], eax
mov eax, dword [ebp + 8]
inc ebx
add edi, 0x2c
cmp ebx, dword [ebp - 4]
jb 0x4023b1
mov eax, dword [ebp - 8]
mov ecx, dword [ebp - 0x10]
lea esi, [eax + ecx*2]
test esi, esi
jne 0x40241a
mov dword [ebp - 8], esi
jmp 0x402431
push esi
call fcn.00416e4b
push esi
mov ebx, eax
push 0
push ebx
mov dword [ebp - 8], ebx
call fcn.00413b10
add esp, 0x10
xor edi, edi
mov dword [ebp - 0x10], edi
cmp dword [ebp - 4], edi
jbe 0x4024d9
mov ebx, dword [ebp - 0x14]
mov eax, dword [ebp + 8]
cmp byte [eax], 0
mov esi, eax
je 0x4024c9
nop dword [eax]
push esi
push dword [ebx]
call fcn.00413800
add esp, 8
test eax, eax
jne 0x402476
mov eax, esi
lea edx, [eax + 1]
mov cl, byte [eax]
inc eax
test cl, cl
jne 0x402464
sub eax, edx
inc esi
add esi, eax
cmp byte [esi], cl
jne 0x402450
jmp 0x4024c6
mov edx, dword [ebx]
mov esi, edx
nop word [eax + eax]
mov al, byte [edx]
inc edx
test al, al
jne 0x402480
mov edi, dword [ebp - 8]
sub edx, esi
dec edi
nop dword [eax]
mov al, byte [edi + 1]
inc edi
test al, al
jne 0x402490
mov ecx, edx
shr ecx, 2
rep movsd dword es:[edi], dword [esi]
mov ecx, edx
and ecx, 3
rep movsb byte es:[edi], byte [esi]
mov edi, dword [ebp - 8]
dec edi
nop word [eax + eax]
mov al, byte [edi + 1]
lea edi, [edi + 1]
test al, al
jne 0x4024b0
mov ax, word [0x42931c]
mov word [edi], ax
mov edi, dword [ebp - 0x10]
mov eax, dword [ebp + 8]
inc edi
add ebx, 0x2c
mov dword [ebp - 0x10], edi
cmp edi, dword [ebp - 4]
jb 0x402445
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push dword [ebp - 0x14]
call fcn.00416e46
mov eax, dword [ebp - 8]
add esp, 4
pop edi
pop esi
pop ebx
mov esp, ebp
pop ebp
ret