Function at 0x40f860
Capabilities:
Check for time delay via gettickcount
Query service status
Stop service

Disassembly:
push 0xffffffffffffffff
push 0x446588
mov eax, dword fs:[0]
push eax
sub esp, 0x30
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4630c8]
xor eax, esp
push eax
lea eax, [esp + 0x44]
mov dword fs:[0], eax
mov dword [esp + 0x4c], 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]
mov edi, eax
test edi, edi
mov dword [esp + 0x1c], edi
jne 0x40f8f0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.00431d95
add esp, 8
lea ecx, [esp + 0x54]
mov dword [esp + 0x4c], 0xffffffff
call fcn.0040ec70
mov eax, 0x64
mov ecx, dword [esp + 0x44]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret
mov eax, dword [esp + 0x58]
cmp dword [eax - 4], 1
jle 0x40f90b
mov eax, dword [eax - 0xc]
push eax
lea ecx, [esp + 0x5c]
call fcn.00401bf0
mov eax, dword [esp + 0x58]
push 0x2c
push eax
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x40f938
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed___d__n
call fcn.00431d95
add esp, 8
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40f8c6
mov edi, dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
lea ecx, [esp + 0x14]
push ecx
push 0x24
lea edx, [esp + 0x28]
push edx
push 0
push esi
call edi
test eax, eax
jne 0x40f96c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.00431d95
add esp, 8
jmp 0x40fa60
mov eax, dword [esp + 0x24]
cmp eax, 1
je 0x40fa60
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov ebp, 3
cmp eax, ebp
jne 0x40f9c6
mov eax, dword [esp + 0x38]
push eax
call ebx
lea ecx, [esp + 0x14]
push ecx
push 0x24
lea edx, [esp + 0x28]
push edx
push 0
push esi
call edi
test eax, eax
je 0x40f953
cmp dword [esp + 0x24], 1
je 0x40fa60
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x18]
cmp eax, 0x7530
ja 0x40fa00
cmp dword [esp + 0x24], ebp
je 0x40f988
mov eax, dword [esp + 0x1c]
push esi
push eax
call fcn.0040f540
add esp, 8
lea ecx, [esp + 0x20]
push ecx
mov ebp, 1
push ebp
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x40fa07
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ControlService_failed___d__n
call fcn.00431d95
add esp, 8
jmp 0x40fa60
push str.Service_stop_timed_out._n
jmp 0x40fa58
cmp dword [esp + 0x5c], 0
je 0x40fa60
cmp dword [esp + 0x24], ebp
je 0x40fa60
mov edx, dword [esp + 0x38]
push edx
call ebx
lea eax, [esp + 0x14]
push eax
push 0x24
lea ecx, [esp + 0x28]
push ecx
push 0
push esi
call edi
test eax, eax
je 0x40f953
cmp dword [esp + 0x24], ebp
je 0x40fa60
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x18]
cmp eax, 0x7530
ja 0x40fa53
cmp dword [esp + 0x24], ebp
jne 0x40fa14
jmp 0x40fa60
push str.Wait_timed_out_n
call fcn.00431d95
add esp, 4
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov edx, dword [esp + 0x1c]
push edx
call esi
lea ecx, [esp + 0x54]
mov dword [esp + 0x4c], 0xffffffff
call fcn.0040ec70
xor eax, eax
mov ecx, dword [esp + 0x44]
mov dword fs:[0], ecx
pop ecx
pop edi
pop esi
pop ebp
pop ebx
add esp, 0x3c
ret