Function at 0x665200
Capabilities:
Enumerate services
Query service status

Disassembly:
push ebp
mov ebp, esp
add esp, 0xffffff90
push ebx
push esi
push edi
xor eax, eax
mov dword [ebp - 0x50], eax
mov dword [ebp - 4], eax
mov dword [ebp - 8], eax
xor eax, eax
push ebp
push 0x6654b4
push dword fs:[eax]
mov dword fs:[eax], esp
mov eax, dword [0x78cb00]
mov dword [ebp - 0xc], eax
mov eax, dword [ebp - 0xc]
mov edx, dword [eax]
call dword [edx + 0x44]
xor edx, edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax]
call dword [ecx + 0x38]
mov edx, 0x6654d4
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax]
call dword [ecx + 0x38]
xor edx, edx
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax]
call dword [ecx + 0x38]
xor eax, eax
mov dword [ebp - 0x10], eax
xor eax, eax
mov dword [ebp - 0x14], eax
xor eax, eax
mov dword [ebp - 0x18], eax
xor eax, eax
mov dword [ebp - 0x24], eax
xor edx, edx
push ebp
push 0x66548a
push dword fs:[edx]
mov dword fs:[edx], esp
push 0xf003f
push 0
push 0
call sub.advapi32.dll_OpenSCManagerW
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
jne 0x665296
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x665491
mov eax, dword [ebp - 0x10]
push eax
call sub.advapi32.dll_LockServiceDatabase
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x6652be
call sub.kernel32.dll_GetLastError
cmp eax, 0x41f
jne 0x6652be
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x665491
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x1c]
push eax
push 0
mov eax, dword [ebp - 0x18]
push eax
push 3
push 0x30
mov eax, dword [ebp - 0x10]
push eax
call sub.advapi32.dll_EnumServicesStatusW
cmp dword [ebp - 0x1c], 0
ja 0x6652ed
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x665491
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__System_AllocMem_qqrui
mov dword [ebp - 0x18], eax
xor ebx, ebx
jmp 0x665322
inc ebx
cmp ebx, 0xa
jbe 0x66530c
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x665491
call sub.kernel32.dll_GetLastError
cmp eax, 0xea
je 0x665322
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x665491
lea eax, [ebp - 0x24]
push eax
lea eax, [ebp - 0x20]
push eax
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x18]
push eax
push 3
push 0x30
mov eax, dword [ebp - 0x10]
push eax
call sub.advapi32.dll_EnumServicesStatusW
test eax, eax
je 0x6652fc
cmp dword [ebp - 0x20], 0
ja 0x665357
call sub.rtl120.bpl__System__TryFinallyExit_qqrv
jmp 0x665491
mov ebx, dword [ebp - 0x18]
mov eax, dword [ebp - 0x20]
dec eax
test eax, eax
jb 0x665450
inc eax
mov dword [ebp - 0x30], eax
lea eax, [ebp - 4]
mov esi, dword [ebx]
mov edx, esi
call sub.rtl120.bpl__System__UStrFromPWChar_qqrr20System_UnicodeStringpb
lea eax, [ebp - 8]
mov edx, dword [ebx + 4]
call sub.rtl120.bpl__System__UStrFromPWChar_qqrr20System_UnicodeStringpb
or edi, 0xffffffff
mov dword [ebp - 0x2c], 0xffffffff
push 5
push esi
mov eax, dword [ebp - 0x10]
push eax
call sub.advapi32.dll_OpenServiceW
mov esi, eax
test esi, esi
je 0x6653fe
lea eax, [ebp - 0x4c]
push eax
push esi
call sub.advapi32.dll_QueryServiceStatus
test eax, eax
je 0x6653ae
mov edi, dword [ebp - 0x48]
lea eax, [ebp - 0x1c]
push eax
push 0
push 0
push esi
call sub.advapi32.dll_QueryServiceConfigW
call sub.kernel32.dll_GetLastError
cmp eax, 0x7a
jne 0x6653fe
cmp dword [ebp - 0x1c], 0
jbe 0x6653fe
mov eax, dword [ebp - 0x1c]
call sub.rtl120.bpl__System_AllocMem_qqrui
mov dword [ebp - 0x28], eax
lea eax, [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x1c]
push eax
mov eax, dword [ebp - 0x28]
push eax
push esi
call sub.advapi32.dll_QueryServiceConfigW
test eax, eax
je 0x6653f6
mov eax, dword [ebp - 0x28]
mov eax, dword [eax + 4]
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x28]
call sub.rtl120.bpl__System__FreeMem_qqrpv
lea eax, [ebp - 0x50]
push eax
mov eax, dword [ebp - 4]
mov dword [ebp - 0x70], eax
mov byte [ebp - 0x6c], 0x11
mov eax, dword [ebp - 8]
mov dword [ebp - 0x68], eax
mov byte [ebp - 0x64], 0x11
mov dword [ebp - 0x60], edi
mov byte [ebp - 0x5c], 0
mov eax, dword [ebp - 0x2c]
mov dword [ebp - 0x58], eax
mov byte [ebp - 0x54], 0
lea edx, [ebp - 0x70]
mov ecx, 3
mov eax, 0x66550c
call fcn.0040fdb0
mov edx, dword [ebp - 0x50]
mov eax, dword [ebp - 0xc]
mov ecx, dword [eax]
call dword [ecx + 0x38]
add ebx, 0x24
dec dword [ebp - 0x30]
jne 0x66536a
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x665491
cmp dword [ebp - 0x18], 0
je 0x66546b
mov eax, dword [ebp - 0x18]
call sub.rtl120.bpl__System__FreeMem_qqrpv
cmp dword [ebp - 0x14], 0
je 0x66547a
mov eax, dword [ebp - 0x14]
push eax
call sub.advapi32.dll_UnlockServiceDatabase
cmp dword [ebp - 0x10], 0
je 0x665489
mov eax, dword [ebp - 0x10]
push eax
call sub.advapi32.dll_CloseServiceHandle
ret
xor eax, eax
pop edx
pop ecx
pop ecx
mov dword fs:[eax], edx
push 0x6654bb
lea eax, [ebp - 0x50]
call sub.rtl120.bpl__System__UStrClr_qqrpv
lea eax, [ebp - 8]
mov edx, 2
call sub.rtl120.bpl__System__UStrArrayClr_qqrpvi
ret