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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x10], eax
mov dword [ebp - 0xc], 0x7530
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0xa4], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 0xa4], 0
jne 0x406593
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44a124
call fcn.00432174
add esp, 8
jmp 0x4067fa
push 0x2c
mov eax, dword [ebp + 8]
add eax, 0xac
push eax
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0xa4]
push edx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov ecx, dword [ebp + 8]
mov dword [ecx + 0xa8], eax
mov edx, dword [ebp + 8]
cmp dword [edx + 0xa8], 0
jne 0x4065ec
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44a140
call fcn.00432174
add esp, 8
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xa4]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4067fa
lea edx, [ebp - 8]
push edx
push 0x24
lea eax, [ebp - 0x34]
push eax
push 0
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0xa8]
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x40662a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44a15c
call fcn.00432174
add esp, 8
jmp 0x4067da
cmp dword [ebp - 0x30], 1
jne 0x406647
push str.Service_is_already_stopped._n
call fcn.00432174
add esp, 4
jmp 0x4067da
cmp dword [ebp - 0x30], 3
jne 0x40671e
push str.Service_stop_pending..._n
call fcn.00432174
add esp, 4
mov eax, dword [ebp - 0x1c]
xor edx, edx
mov ecx, 0xa
div ecx
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0x3e8
jae 0x40667f
mov dword [ebp - 4], 0x3e8
jmp 0x40668f
cmp dword [ebp - 4], 0x2710
jbe 0x40668f
mov dword [ebp - 4], 0x2710
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea ecx, [ebp - 0x34]
push ecx
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xa8]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x4066d7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44a1bc
call fcn.00432174
add esp, 8
jmp 0x4067da
cmp dword [ebp - 0x30], 1
jne 0x4066f4
push str.Service_stopped_successfully._n
call fcn.00432174
add esp, 4
jmp 0x4067da
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0xc]
jbe 0x406719
push str.Service_stop_timed_out._n
call fcn.00432174
add esp, 4
jmp 0x4067da
jmp 0x406647
mov ecx, dword [ebp + 8]
push ecx
call fcn.00406800
lea edx, [ebp - 0x34]
push edx
push 1
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xa8]
push ecx
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x40675c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ControlService_failed___d__n
call fcn.00432174
add esp, 8
jmp 0x4067da
cmp dword [ebp - 0x30], 1
je 0x4067cd
mov edx, dword [ebp - 0x1c]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea ecx, [ebp - 0x34]
push ecx
push 0
mov edx, dword [ebp + 8]
mov eax, dword [edx + 0xa8]
push eax
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x4067a4
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x44a238
call fcn.00432174
add esp, 8
jmp 0x4067da
cmp dword [ebp - 0x30], 1
jne 0x4067ac
jmp 0x4067cd
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x10]
cmp eax, dword [ebp - 0xc]
jbe 0x4067cb
push str.Wait_timed_out_n
call fcn.00432174
add esp, 4
jmp 0x4067da
jmp 0x40675c
push str.Service_stopped_successfully_n
call fcn.00432174
add esp, 4
mov ecx, dword [ebp + 8]
mov edx, dword [ecx + 0xa8]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp + 8]
mov ecx, dword [eax + 0xa4]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esp, ebp
pop ebp
ret 4