Function at 0x40c880
Capabilities:
Enumerate services

Disassembly:
sub esp, 0x220
mov eax, dword [0x422760]
xor eax, esp
mov dword [esp + 0x21c], eax
mov eax, dword [esp + 0x22c]
push ebx
mov ebx, dword [esp + 0x228]
push ebp
push esi
mov esi, dword [esp + 0x234]
push edi
mov edi, dword [esp + 0x240]
push eax
push esi
push ebx
mov dword [esp + 0x1c], esi
mov dword [esp + 0x34], edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov ebp, eax
test ebp, ebp
je 0x40c911
test edi, edi
je 0x40c90a
cmp edi, esi
je 0x40c90a
lea ecx, [esp + 0x10]
push ecx
lea edx, [esp + 0x30]
push edx
push esi
push ebx
mov dword [esp + 0x20], 0x100
call dword [sym.imp.ADVAPI32.dll_GetServiceDisplayNameW]
mov eax, dword [esp + 0x244]
lea ecx, [esp + 0x14]
push ecx
push edi
lea edx, [esp + 0x34]
push edx
push ebx
mov dword [esp + 0x24], eax
call dword [sym.imp.ADVAPI32.dll_GetServiceKeyNameW]
mov eax, ebp
jmp 0x40cae5
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
call esi
cmp eax, 0x424
je 0x40c949
call esi
push eax
call fcn.00404fa0
add esp, 4
push eax
push 0x4000021f
call fcn.00412306
add eax, 0x40
push eax
call fcn.00405150
add esp, 0xc
xor eax, eax
jmp 0x40cae5
test edi, edi
je 0x40c920
lea eax, [esp + 0x20]
push eax
lea ecx, [esp + 0x1c]
push ecx
lea edx, [esp + 0x24]
push edx
push 0
push 0
push 3
push 0x3b
push ebx
mov dword [esp + 0x40], 0
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusW]
call esi
cmp eax, 0xea
jne 0x40ca52
mov eax, dword [esp + 0x1c]
push eax
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebp, eax
test ebp, ebp
jne 0x40c9c1
push str.open_service__
push str.ENUM_SERVICE_STATUS
push 0xc00001fa
call fcn.00412306
add eax, 0x40
push eax
call fcn.00405150
add esp, 0x10
xor eax, eax
jmp 0x40cae5
mov ecx, dword [esp + 0x1c]
mov dword [esp + 0x14], ecx
lea esp, [esp]
lea edx, [esp + 0x20]
push edx
mov edx, dword [esp + 0x18]
lea eax, [esp + 0x1c]
push eax
lea ecx, [esp + 0x24]
push ecx
push edx
push ebp
push 3
push 0x3b
push ebx
call dword [sym.imp.ADVAPI32.dll_EnumServicesStatusW]
mov edi, eax
mov dword [esp + 0x24], edi
test edi, edi
jne 0x40ca03
call esi
cmp eax, 0xea
jne 0x40ca42
xor esi, esi
cmp dword [esp + 0x18], esi
jbe 0x40ca32
lea edi, [ebp + 4]
mov edi, edi
mov eax, dword [esp + 0x10]
mov ecx, dword [edi]
push eax
push ecx
call fcn.004094c0
add esp, 8
test eax, eax
jne 0x40ca68
inc esi
add edi, 0x24
cmp esi, dword [esp + 0x18]
jb 0x40ca10
mov edi, dword [esp + 0x24]
test edi, edi
jne 0x40cacb
mov esi, dword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x40c9d0
push ebp
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
call esi
push eax
call fcn.00404fa0
add esp, 4
push eax
push 0x40000220
jmp 0x40c931
mov ecx, dword [esp + 0x244]
lea edx, [esi + esi*8]
mov eax, dword [ebp + edx*4]
mov esi, dword [esp + 0x28]
push eax
push 0x41d488
push 0xffffffffffffffff
push ecx
push esi
call fcn.004126d2
add esp, 0x14
push ebp
push 0
test eax, eax
jge 0x40caaf
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
push str.open_service__
push str.canonical_name
jmp 0x40c9a4
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov edx, dword [esp + 0x23c]
push 0
push 0
push edx
push esi
jmp 0x40cadc
mov eax, dword [esp + 0x23c]
mov ecx, dword [esp + 0x10]
push 0
push 0
push eax
push ecx
push ebx
call fcn.0040c880
add esp, 0x14
mov ecx, dword [esp + 0x22c]
pop edi
pop esi
pop ebp
pop ebx
xor ecx, esp
call fcn.004126f3
add esp, 0x220
ret