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

Disassembly:
push ebp
mov ebp, esp
and esp, 0xfffffff8
sub esp, 0x64
mov eax, dword [0x428004]
xor eax, esp
mov dword [esp + 0x60], eax
push ebx
push esi
mov ebx, ecx
mov dword [esp + 0x18], 0
push edi
mov dword [esp + 0x14], ebx
mov dword [esp + 0x20], 0
call dword [sym.imp.KERNEL32.dll_GetTickCount]
push 0xf003f
push 0
push 0
mov dword [esp + 0x24], eax
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
test eax, eax
jne 0x406d14
cmp dword [0x4287b0], eax
je 0x406d00
push ebx
push str.____Failed_to_open_service_manager_for:__s__n
call fcn.00404800
add esp, 8
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x60]
xor ecx, esp
call fcn.004096d4
mov esp, ebp
pop ebp
ret
push 0x2c
push ebx
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x406d55
cmp dword [0x4287b0], eax
je 0x406d41
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push ebx
push str.____Failed_to_open_service_handle_for:__s___d_n
call fcn.00404800
add esp, 0xc
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x60]
xor ecx, esp
call fcn.004096d4
mov esp, ebp
pop ebp
ret
lea eax, [esp + 0x1c]
push eax
push 0x24
lea eax, [esp + 0x50]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x406d9f
cmp dword [0x4287b0], eax
je 0x406d84
push ebx
push str.____Failed_to_get_service_information_for:__s__n
call fcn.00404800
add esp, 8
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x60]
xor ecx, esp
call fcn.004096d4
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x4c]
cmp eax, 1
je 0x406f0b
cmp eax, 3
je 0x406f0b
lea eax, [esp + 0x20]
push eax
lea eax, [esp + 0x20]
push eax
push 0
push 0
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_EnumDependentServicesW]
test eax, eax
jne 0x406dee
call dword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0xea
je 0x406dee
cmp dword [0x4287b0], 0
je 0x406d84
push ebx
push str.____Failed_to_enum_dependent_services_for__s__n
jmp 0x406d7c
mov eax, dword [esp + 0x1c]
xor ecx, ecx
mov edx, 0x24
mul edx
seto cl
neg ecx
or ecx, eax
push ecx
call fcn.0040d6b1
add esp, 4
mov edi, eax
lea eax, [esp + 0x20]
mov dword [esp + 0x10], edi
push eax
lea eax, [esp + 0x20]
push eax
push dword [esp + 0x24]
push edi
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_EnumDependentServicesW]
test eax, eax
jne 0x406e67
cmp dword [0x4287b0], eax
je 0x406e43
push ebx
push str.____Failed_to_enum_dependent_services_for__s__n
call fcn.00404800
add esp, 8
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call fcn.0040d6ac
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x60]
xor ecx, esp
call fcn.004096d4
mov esp, ebp
pop ebp
ret
mov eax, dword [esp + 0x20]
test eax, eax
je 0x406e9d
xor edi, edi
test eax, eax
je 0x406e99
mov ebx, dword [esp + 0x10]
nop dword [eax]
mov ecx, dword [ebx]
call fcn.00406ca0
test eax, eax
jne 0x406f29
inc edi
add ebx, 0x24
cmp edi, dword [esp + 0x20]
jb 0x406e80
mov edi, dword [esp + 0x10]
lea eax, [esp + 0x24]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x406e43
cmp dword [esp + 0x28], 1
je 0x406f02
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
nop dword [eax]
push dword [esp + 0x3c]
call ebx
lea eax, [esp + 0x1c]
push eax
push 0x24
lea eax, [esp + 0x2c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x406e43
cmp dword [esp + 0x28], 1
je 0x406f02
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x18]
cmp eax, 0x7530
ja 0x406f02
cmp dword [esp + 0x28], 1
jne 0x406ec0
push edi
call fcn.0040d6ac
add esp, 4
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [esp + 0x60]
xor ecx, esp
call fcn.004096d4
mov esp, ebp
pop ebp
ret
cmp dword [0x4287b0], 0
je 0x406f43
push dword [esp + 0x14]
push str.____Failed_to_kill_dependent_services_for__s__n
call fcn.00404800
add esp, 8
push esi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push dword [esp + 0x10]
call fcn.0040d6ac
mov ecx, dword [esp + 0x70]
add esp, 4
xor eax, eax
pop edi
pop esi
pop ebx
xor ecx, esp
call fcn.004096d4
mov esp, ebp
pop ebp
ret