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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov eax, dword [0x45563c]
xor eax, ebp
mov dword [ebp - 4], eax
mov dword [ebp - 0x30], ecx
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x40], eax
mov dword [ebp - 0x3c], 0x7530
mov byte [ebp - 0x35], 0
push str.NamSvc
push 0x50
mov eax, dword [ebp - 0x30]
push eax
call fcn.0040cc20
push 0x44d640
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ecx, dword [ebp - 0x30]
mov dword [ecx + 0x45c], eax
mov edx, dword [ebp - 0x30]
cmp dword [edx + 0x45c], 0
jne 0x40f2ef
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44d654
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
jmp 0x40f722
push str.OpenSCManager_success_n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
push 0x2c
mov eax, dword [ebp - 0x30]
push eax
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x45c]
push edx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov ecx, dword [ebp - 0x30]
mov dword [ecx + 0x460], eax
mov edx, dword [ebp - 0x30]
cmp dword [edx + 0x460], 0
jne 0x40f35e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44d688
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0x45c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x40f722
push str.OpenService_success_n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
lea edx, [ebp - 8]
push edx
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x460]
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x40f3bc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x242
push 0x44d6bc
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0x10
jmp 0x40f702
push 0x247
push 0x44d6e4
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
cmp dword [ebp - 0x28], 1
jne 0x40f3f7
push str.Service_is_already_stopped._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
jmp 0x40f702
cmp dword [ebp - 0x28], 3
jne 0x40f539
push str.Service_stop_pending..._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
mov eax, dword [ebp - 0x14]
xor edx, edx
mov ecx, 0xa
div ecx
mov dword [ebp - 0x34], eax
cmp dword [ebp - 0x34], 0x3e8
jae 0x40f435
mov dword [ebp - 0x34], 0x3e8
jmp 0x40f445
cmp dword [ebp - 0x34], 0x2710
jbe 0x40f445
mov dword [ebp - 0x34], 0x2710
mov edx, dword [ebp - 0x34]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea ecx, [ebp - 0x2c]
push ecx
push 0
mov edx, dword [ebp - 0x30]
mov eax, dword [edx + 0x460]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x40f49a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x269
push 0x44d744
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0x10
jmp 0x40f702
push 0x26e
push str._d:QueryServiceStatusEx_success_n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
cmp dword [ebp - 0x28], 1
jne 0x40f4d7
push str.Service_stopped_successfully._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
jmp 0x40f702
push 0x278
push str._d:Service_stop_wait._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x40]
cmp eax, dword [ebp - 0x3c]
jbe 0x40f51c
push str.Service_stop_timed_out._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
jmp 0x40f702
push 0x282
push 0x44d7e4
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
jmp 0x40f3f7
lea ecx, [ebp - 0x2c]
push ecx
push 1
mov edx, dword [ebp - 0x30]
mov eax, dword [edx + 0x460]
push eax
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x40f579
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ControlService_failed___d__n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
jmp 0x40f702
push str.ControlService_success_n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
cmp dword [ebp - 0x28], 1
je 0x40f66d
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [ebp - 8]
push edx
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x460]
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x40f5eb
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x2a3
push 0x44d834
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0x10
jmp 0x40f702
push 0x2a8
push 0x44d85c
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
cmp dword [ebp - 0x28], 1
jne 0x40f623
push 0x2ac
push str._d:Service_stopped_successfully_and_break._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
jmp 0x40f66d
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x40]
cmp eax, dword [ebp - 0x3c]
jbe 0x40f650
push str.Wait_timed_out_n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 8
jmp 0x40f702
push 0x2b7
push str._d:Service_stop_wait..._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
jmp 0x40f58c
lea eax, [ebp - 8]
push eax
push 0x24
lea ecx, [ebp - 0x2c]
push ecx
push 0
mov edx, dword [ebp - 0x30]
mov eax, dword [edx + 0x460]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x40f6b2
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x2c3
push str._d:QueryServiceStatusEx_failed___d__n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0x10
jmp 0x40f702
push 0x2c8
push str._d:QueryServiceStatusEx_success._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
cmp dword [ebp - 0x28], 1
jne 0x40f6ea
push 0x2cc
push str._d:Service_stopped_successfully_and_return._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
jmp 0x40f702
push 0x2d0
push str._d:Service_stopped_failed_and_return._n
call fcn.004034b0
push eax
call fcn.004038b0
add esp, 0xc
mov ecx, dword [ebp - 0x30]
mov edx, dword [ecx + 0x460]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x30]
mov ecx, dword [eax + 0x45c]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00411455
mov esp, ebp
pop ebp
ret