Function at 0x401810
Capabilities:
Check for time delay via gettickcount
Query service status
Stop service
Terminate process

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [0x41f004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push edi
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
push 0xf003f
push 0
push 0
mov ebx, eax
mov dword [ebp - 0x34], 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov dword [ebp - 0x30], eax
test eax, eax
jne 0x40186d
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.00401040
add esp, 8
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00402251
mov esp, ebp
pop ebp
ret
push esi
push 0x2c
push str.TermService
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x4018b0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed___d__n
call fcn.00401040
add esp, 8
push dword [ebp - 0x30]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop esi
pop edi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.00402251
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x4018e0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.00401040
add esp, 8
jmp 0x401a04
mov eax, dword [ebp - 0x28]
cmp eax, 1
jne 0x4018f2
push str.Service_is_already_stopped._n
jmp 0x4019fc
mov ecx, dword [ebp - 0x10]
mov dword [ebp - 0x34], ecx
cmp eax, 3
jne 0x40196e
nop dword [eax]
push str.Service_stop_pending..._n
call fcn.00401040
mov eax, 0xcccccccd
add esp, 4
mul dword [ebp - 0x14]
shr edx, 3
cmp edx, 0x3e8
jae 0x401927
mov edx, 0x3e8
jmp 0x401935
cmp edx, 0x2710
mov eax, 0x2710
cmova edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x4018c7
cmp dword [ebp - 0x28], 1
je 0x4019a6
call edi
sub eax, ebx
cmp eax, 0x7530
ja 0x40199f
cmp dword [ebp - 0x28], 3
je 0x401900
mov ecx, dword [ebp - 0x30]
mov edx, esi
call fcn.00401640
lea eax, [ebp - 0x2c]
push eax
push 1
push esi
call dword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x4019ad
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ControlService_failed___d__n
call fcn.00401040
add esp, 8
jmp 0x401a04
push str.Service_stop_timedout._n
jmp 0x4019fc
push str.Service_stopped_successfully._n
jmp 0x4019fc
cmp dword [ebp - 0x28], 1
je 0x4019f7
mov eax, 0xcccccccd
mul dword [ebp - 0x14]
shr edx, 3
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x4018c7
cmp dword [ebp - 0x28], 1
je 0x4019f7
call edi
sub eax, ebx
cmp eax, 0x7530
ja 0x401a3d
cmp dword [ebp - 0x28], 1
jne 0x4019b3
push str.Service_stopped_successfully_n
call fcn.00401040
add esp, 4
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push dword [ebp - 0x30]
call esi
push dword [ebp - 0x34]
push 0
push 1
call dword [sym.imp.KERNEL32.dll_OpenProcess]
test eax, eax
je 0x401a2c
push 0
push eax
call dword [sym.imp.KERNEL32.dll_TerminateProcess]
mov ecx, dword [ebp - 4]
pop esi
pop edi
xor ecx, ebp
pop ebx
call fcn.00402251
mov esp, ebp
pop ebp
ret
push str.Wait_timed_out_n
jmp 0x4019fc