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

Disassembly:
push 0xffffffffffffffff
push 0x4465f8
mov eax, dword fs:[0]
push eax
sub esp, 0x30
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4630d8]
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 0x40fa00
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.0043184f
add esp, 8
lea ecx, [esp + 0x54]
mov dword [esp + 0x4c], 0xffffffff
call fcn.0040ed80
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 0x40fa1b
mov eax, dword [eax - 0xc]
push eax
lea ecx, [esp + 0x5c]
call fcn.00401c20
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 0x40fa48
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed___d__n
call fcn.0043184f
add esp, 8
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40f9d6
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 0x40fa7c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.0043184f
add esp, 8
jmp 0x40fb70
mov eax, dword [esp + 0x24]
cmp eax, 1
je 0x40fb70
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov ebp, 3
cmp eax, ebp
jne 0x40fad6
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 0x40fa63
cmp dword [esp + 0x24], 1
je 0x40fb70
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x18]
cmp eax, 0x7530
ja 0x40fb10
cmp dword [esp + 0x24], ebp
je 0x40fa98
mov eax, dword [esp + 0x1c]
push esi
push eax
call fcn.0040f650
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 0x40fb17
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ControlService_failed___d__n
call fcn.0043184f
add esp, 8
jmp 0x40fb70
push str.Service_stop_timed_out._n
jmp 0x40fb68
cmp dword [esp + 0x5c], 0
je 0x40fb70
cmp dword [esp + 0x24], ebp
je 0x40fb70
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 0x40fa63
cmp dword [esp + 0x24], ebp
je 0x40fb70
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x18]
cmp eax, 0x7530
ja 0x40fb63
cmp dword [esp + 0x24], ebp
jne 0x40fb24
jmp 0x40fb70
push str.Wait_timed_out_n
call fcn.0043184f
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.0040ed80
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