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

Disassembly:
push 0xffffffffffffffff
push 0x447d38
mov eax, dword fs:[0]
push eax
sub esp, 0x30
push ebx
push ebp
push esi
push edi
mov eax, dword [0x4650f0]
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 0x410620
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.004331ac
add esp, 8
lea ecx, [esp + 0x54]
mov dword [esp + 0x4c], 0xffffffff
call fcn.00411520
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 0x41063b
mov eax, dword [eax - 0xc]
push eax
lea ecx, [esp + 0x5c]
call fcn.00401df0
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 0x410668
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed___d__n
call fcn.004331ac
add esp, 8
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x4105f6
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 0x41069c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.004331ac
add esp, 8
jmp 0x410790
mov eax, dword [esp + 0x24]
cmp eax, 1
je 0x410790
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
mov ebp, 3
cmp eax, ebp
jne 0x4106f6
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 0x410683
cmp dword [esp + 0x24], 1
je 0x410790
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x18]
cmp eax, 0x7530
ja 0x410730
cmp dword [esp + 0x24], ebp
je 0x4106b8
mov eax, dword [esp + 0x1c]
push esi
push eax
call fcn.00410270
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 0x410737
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ControlService_failed___d__n
call fcn.004331ac
add esp, 8
jmp 0x410790
push str.Service_stop_timed_out._n
jmp 0x410788
cmp dword [esp + 0x5c], 0
je 0x410790
cmp dword [esp + 0x24], ebp
je 0x410790
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 0x410683
cmp dword [esp + 0x24], ebp
je 0x410790
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x18]
cmp eax, 0x7530
ja 0x410783
cmp dword [esp + 0x24], ebp
jne 0x410744
jmp 0x410790
push str.Wait_timed_out_n
call fcn.004331ac
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.00411520
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