Function at 0x405830
Capabilities:
Check for time delay via gettickcount
Enumerate services
Query service status
Stop service

Disassembly:
push ebx
mov ebx, esp
sub esp, 8
and esp, 0xfffffff0
add esp, 4
push ebp
mov ebp, dword [ebx + 4]
mov dword [esp + 4], ebp
mov ebp, esp
sub esp, 0xa8
mov eax, dword [0x459008]
xor eax, ebp
mov dword [ebp - 4], eax
cmp dword [0x479b08], 0
push esi
push edi
je 0x40586e
push str.KillService
call fcn.00401d20
add esp, 4
push 0x80
push str.Count_service_:__d
mov dword [ebp - 0x5c], 0
call fcn.00401d20
add esp, 8
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [ebp - 0x60], eax
test eax, eax
je 0x405a79
mov edi, 0x4431a0
mov dword [ebp - 0x64], edi
nop dword [eax]
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0x2c
push dword [edi]
mov esi, eax
push dword [ebp - 0x60]
mov dword [ebp - 0x58], esi
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov edi, eax
mov dword [ebp - 0x68], edi
test edi, edi
je 0x405a59
lea eax, [ebp - 0x54]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x405a4e
mov eax, dword [ebp - 0x28]
cmp eax, 1
je 0x405a4e
cmp eax, 3
je 0x405a4e
lea eax, [ebp - 8]
push eax
lea eax, [ebp - 0x54]
push eax
push 0
push dword [ebp - 0x5c]
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_EnumDependentServicesA]
test eax, eax
jne 0x4059fd
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
jne 0x4059fd
mov ecx, dword [ebp - 0x54]
call fcn.004056b0
mov dword [ebp - 0x5c], eax
test eax, eax
je 0x4059fd
lea ecx, [ebp - 8]
push ecx
lea ecx, [ebp - 0x54]
push ecx
push dword [ebp - 0x54]
push eax
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_EnumDependentServicesA]
test eax, eax
je 0x4059ec
mov eax, dword [ebp - 0x5c]
push 0x24
movups xmm1, xmmword [eax]
movups xmm0, xmmword [eax + 0x10]
movd eax, xmm1
movups xmmword [ebp - 0x90], xmm0
push eax
push dword [ebp - 0x60]
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
test esi, esi
je 0x4059e9
lea eax, [ebp - 0x50]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x4059e9
cmp dword [ebp - 0x4c], 1
je 0x4059e2
mov edi, dword [ebp - 0x58]
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x54]
push eax
push 0x24
lea eax, [ebp - 0x50]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x4059d9
cmp dword [ebp - 0x4c], 1
je 0x4059df
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, edi
cmp eax, 0x1388
ja 0x4059df
cmp dword [ebp - 0x4c], 1
jne 0x4059a5
mov edi, dword [ebp - 0x68]
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esi, dword [ebp - 0x58]
push dword [ebp - 0x5c]
push 0
push dword [0x47a330]
call dword [sym.imp.KERNEL32.dll_HeapFree]
lea eax, [ebp - 0x2c]
push eax
push 1
push edi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x405a4e
cmp dword [ebp - 0x28], 1
je 0x405a4e
push 0x64
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x54]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x405a4e
cmp dword [ebp - 0x28], 1
je 0x405a4e
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, esi
cmp eax, 0x1388
ja 0x405a4e
cmp dword [ebp - 0x28], 1
jne 0x405a14
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
jmp 0x405a5f
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edi, dword [ebp - 0x64]
add edi, 4
mov dword [ebp - 0x64], edi
cmp edi, 0x4433a0
jl 0x4058b0
push dword [ebp - 0x60]
call esi
cmp dword [0x479b08], 0
je 0x405a8f
push str.return_KillService
call fcn.00401d20
add esp, 4
mov ecx, dword [ebp - 4]
pop edi
xor ecx, ebp
pop esi
call fcn.0040a2df
mov esp, ebp
pop ebp
mov esp, ebx
pop ebx
ret