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

Disassembly:
sub esp, 0x30
push ebx
push ebp
push esi
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
mov dword [esp + 0x10], eax
mov eax, edi
call fcn.0040b8c0
test al, al
je 0x40bbd3
mov edx, dword [edi + 0xc]
mov ebp, dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
lea eax, [esp + 0xc]
push eax
push 0x24
lea ecx, [esp + 0x20]
push ecx
push 0
push edx
call ebp
test eax, eax
jne 0x40bbdc
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
sub esp, 0x1c
mov esi, esp
xor eax, eax
mov dword [esi + 0x18], 7
mov dword [esi + 0x14], 0
mov dword [esp + 0x30], esp
mov word [esi + 4], ax
push 0x21
mov eax, str.QueryServiceStatusEx_FAILED___d__n
call fcn.00409d40
call fcn.00409570
add esp, 0x20
xor al, al
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
mov eax, dword [esp + 0x1c]
cmp eax, 1
jne 0x40bc09
sub esp, 0x1c
mov dword [esp + 0x2c], esp
mov eax, str.Service_is_already_stopped._n
mov ecx, esp
call fcn.00409610
call fcn.00409570
add esp, 0x1c
xor al, al
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
mov ebx, dword [sym.imp.KERNEL32.dll_Sleep]
cmp eax, 3
jne 0x40bc91
sub esp, 0x1c
mov esi, esp
mov dword [esp + 0x30], esp
xor ecx, ecx
mov dword [esi + 0x18], 7
mov dword [esi + 0x14], 0
push 0x18
mov eax, str.Service_stop_pending..._n
mov word [esi + 4], cx
call fcn.00409d40
call fcn.00409570
mov edx, dword [esp + 0x4c]
add esp, 0x1c
push edx
call ebx
mov edx, dword [edi + 0xc]
lea eax, [esp + 0xc]
push eax
push 0x24
lea ecx, [esp + 0x20]
push ecx
push 0
push edx
call ebp
test eax, eax
je 0x40bcd7
cmp dword [esp + 0x1c], 1
je 0x40bd02
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [esp + 0x10]
cmp eax, 0x7530
ja 0x40bd13
cmp dword [esp + 0x1c], 3
je 0x40bc14
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
push edi
call fcn.0040bdd0
mov ecx, dword [edi + 0xc]
lea eax, [esp + 0x18]
push eax
push 1
push ecx
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x40bd24
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
sub esp, 0x1c
mov eax, str.ControlService_FAILED___d__n
mov ecx, esp
mov dword [esp + 0x34], esp
call fcn.00409610
call fcn.00409570
add esp, 0x20
xor al, al
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
sub esp, 0x1c
mov eax, str.QueryServiceStatusEx_FAILED___d__n
mov ecx, esp
mov dword [esp + 0x34], esp
call fcn.00409610
call fcn.00409570
add esp, 0x20
xor al, al
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
sub esp, 0x1c
mov dword [esp + 0x30], esp
mov eax, str.Service_stopped_successfully._n
jmp 0x40bbf1
sub esp, 0x1c
mov dword [esp + 0x30], esp
mov eax, str.Service_stop_timed_out._n
jmp 0x40bbf1
cmp dword [esp + 0x1c], 1
je 0x40bd6a
jmp 0x40bd30
mov edx, dword [esp + 0x30]
push edx
call ebx
mov edx, dword [edi + 0xc]
lea eax, [esp + 0xc]
push eax
push 0x24
lea ecx, [esp + 0x20]
push ecx
push 0
push edx
call ebp
test eax, eax
je 0x40bd8e
cmp dword [esp + 0x1c], 1
je 0x40bd6a
call esi
sub eax, dword [esp + 0x10]
cmp eax, 0x7530
ja 0x40bdb9
cmp dword [esp + 0x1c], 1
jne 0x40bd30
sub esp, 0x1c
mov eax, str.Service_stopped_successfully_n
mov ecx, esp
mov dword [esp + 0x30], esp
call fcn.00409610
call fcn.00409570
add esp, 0x1c
mov al, 1
pop esi
pop ebp
pop ebx
add esp, 0x30
ret
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
sub esp, 0x1c
mov eax, str.QueryServiceStatusEx_FAILED___d__n
mov ecx, esp
mov dword [esp + 0x34], esp
call fcn.00409610
call fcn.00409570
add esp, 0x20
pop esi
pop ebp
xor al, al
pop ebx
add esp, 0x30
ret
sub esp, 0x1c
mov dword [esp + 0x30], esp
mov eax, str.Wait_timed_out_n
jmp 0x40bbf1