Function at 0x406140
Capabilities:
Check for time delay via gettickcount
Enumerate services
Query service status

Disassembly:
push 0xffffffffffffffff
push 0x42fbc8
mov eax, dword fs:[0]
push eax
mov dword fs:[0], esp
sub esp, 0x64
push ebx
push ebp
push esi
push edi
mov dword [esp + 0x20], ecx
xor edi, edi
mov dword [esp + 0x7c], edi
call sym.HPZwis01.exe_unsigned_int___cdecl_IsNT_void_
test eax, eax
jne 0x406188
push str.This_operating_system_does_not_have_services.__Skipping_the_action_of_stopping_the_service.
push 1
push 0x444698
call fcn.00413026
add esp, 0xc
jmp 0x406685
mov ecx, dword [esp + 0x98]
mov dword [esp + 0x1c], edi
cmp ecx, edi
mov ebx, 1
jne 0x4061fe
push 0xf003f
push edi
push edi
mov dword [esp + 0x28], ebx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov ecx, eax
cmp ecx, edi
mov dword [esp + 0x98], ecx
jne 0x4061fe
mov eax, dword [esp + 0x88]
cmp eax, edi
jne 0x4061ca
mov eax, 0x43257c
push eax
push str._s_Service_attempting_to_stop.__OpenSCManager_failed.
push 8
push 0x444698
call fcn.00413026
add esp, 0x10
lea ecx, [esp + 0x84]
mov dword [esp + 0x7c], 0xffffffff
push ebx
call fcn.00403360
mov eax, 0x41c
jmp 0x4067b5
mov eax, dword [esp + 0x88]
cmp eax, edi
jne 0x40620e
mov eax, 0x43257c
push 0xac
push eax
push ecx
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov esi, eax
cmp esi, edi
mov dword [esp + 0x28], esi
jne 0x406269
mov eax, dword [esp + 0x88]
cmp eax, edi
jne 0x406235
mov eax, 0x43257c
push eax
push str._s_Service_attempting_to_stop.__OpenService_failed.
push 8
push 0x444698
call fcn.00413026
add esp, 0x10
lea ecx, [esp + 0x84]
mov dword [esp + 0x7c], 0xffffffff
push ebx
call fcn.00403360
mov eax, 0x424
jmp 0x4067b5
lea eax, [esp + 0x34]
push eax
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x406771
cmp dword [esp + 0x38], ebx
jne 0x4062c3
mov eax, dword [esp + 0x88]
cmp eax, edi
jne 0x406293
mov eax, 0x43257c
push eax
push str._s_Service_attempting_to_stop.__Service_found_to_be_stopped_already.
push ebx
push 0x444698
call fcn.00413026
add esp, 0x10
lea ecx, [esp + 0x84]
mov dword [esp + 0x7c], 0xffffffff
push ebx
call fcn.00403360
xor eax, eax
jmp 0x4067b5
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
mov ebp, eax
mov eax, dword [esp + 0x38]
mov ebx, 3
mov dword [esp + 0x2c], ebp
cmp eax, ebx
jne 0x406321
mov ecx, dword [esp + 0x4c]
push ecx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea edx, [esp + 0x34]
push edx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x40641c
cmp dword [esp + 0x38], 1
je 0x406395
call edi
mov ecx, dword [esp + 0x94]
sub eax, ebp
cmp eax, ecx
ja 0x4063d7
cmp dword [esp + 0x38], ebx
je 0x4062de
mov ebp, dword [sym.imp.ADVAPI32.dll_EnumDependentServicesA]
lea ecx, [esp + 0x18]
lea edx, [esp + 0x14]
xor eax, eax
push ecx
push edx
push eax
push eax
push 1
push esi
mov dword [esp + 0x2c], eax
mov dword [esp + 0x30], eax
call ebp
test eax, eax
jne 0x40659f
mov ebx, dword [sym.imp.KERNEL32.dll_GetLastError]
call ebx
cmp eax, 0xea
je 0x406458
mov eax, dword [esp + 0x88]
test eax, eax
jne 0x40636d
mov eax, 0x43257c
push eax
push str._s_Dependent_Service_attempting_to_stop.__EnumDependentServices_failed_to_return_ERROR_MORE_DATA.
push 8
push 0x444698
call fcn.00413026
add esp, 0x10
call ebx
mov esi, eax
mov dword [esp + 0x7c], 0xffffffff
push 1
jmp 0x4067a7
mov eax, dword [esp + 0x88]
test eax, eax
jne 0x4063a5
mov eax, 0x43257c
push eax
push str._s_Service_successfully_stopped.
push 1
push 0x444698
call fcn.00413026
add esp, 0x10
lea ecx, [esp + 0x84]
mov dword [esp + 0x7c], 0xffffffff
push 1
call fcn.00403360
xor eax, eax
jmp 0x4067b5
mov eax, dword [esp + 0x88]
test eax, eax
jne 0x4063e7
mov eax, 0x43257c
push eax
push str._s_Service_attempting_to_stop.__Service_found_to_be_pending_a_stop_event_and_timed_out_waiting_for_the_service_to_stop.
push 8
push 0x444698
call fcn.00413026
add esp, 0x10
lea ecx, [esp + 0x84]
mov dword [esp + 0x7c], 0xffffffff
push 1
call fcn.00403360
mov eax, 0x5b4
jmp 0x4067b5
mov eax, dword [esp + 0x88]
test eax, eax
jne 0x40642c
mov eax, 0x43257c
push eax
push str._s_Service_attempting_to_stop.__Service_found_to_be_pending_a_stop_event_and_QueryServiceStatus_failed.
push 8
push 0x444698
call fcn.00413026
add esp, 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [esp + 0x7c], 0xffffffff
push 1
jmp 0x4067a7
mov eax, dword [esp + 0x14]
push eax
push 8
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov ebx, eax
test ebx, ebx
mov dword [esp + 0x24], ebx
jne 0x4064d6
mov eax, dword [esp + 0x88]
test eax, eax
jne 0x406486
mov eax, 0x43257c
push eax
push str._s_Dependent_Service_attempting_to_stop.__HeapAlloc_failed.
push 8
push 0x444698
call fcn.00413026
add esp, 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x88]
mov esi, eax
test ecx, ecx
je 0x4067b3
mov al, byte [ecx - 1]
test al, al
je 0x4064c7
cmp al, 0xff
je 0x4064c7
dec al
mov byte [ecx - 1], al
jmp 0x4067b3
dec ecx
push ecx
call fcn.004296d1
add esp, 4
jmp 0x4067b3
mov eax, dword [esp + 0x14]
lea ecx, [esp + 0x18]
lea edx, [esp + 0x14]
push ecx
push edx
push eax
push ebx
push 1
push esi
call ebp
test eax, eax
jne 0x406507
mov eax, dword [esp + 0x88]
test eax, eax
jne 0x4064ff
mov eax, 0x43257c
push eax
push str._s_Dependent_Service_attempting_to_stop.__EnumDependentServices_failed.
jmp 0x40648c
mov eax, dword [esp + 0x18]
xor ebp, ebp
test eax, eax
jbe 0x40658f
mov eax, dword [esp + 0x88]
mov ecx, 9
mov esi, ebx
lea edi, [esp + 0x50]
test eax, eax
rep movsd dword es:[edi], dword [esi]
jne 0x40652e
mov eax, 0x43257c
mov esi, dword [esp + 0x50]
push eax
push esi
push str.Attempting_to_stop__s___s_Dependent_Service_.
push 1
push 0x444698
call fcn.00413026
mov ecx, dword [esp + 0xac]
mov edx, dword [esp + 0xa8]
add esp, 0x14
lea eax, [esp + 0x13]
push ecx
push edx
sub esp, 0x10
mov ecx, esp
mov dword [esp + 0x48], esp
push eax
push esi
call fcn.004069d0
mov ecx, dword [esp + 0x38]
call fcn.00406140
mov eax, dword [esp + 0x18]
inc ebp
add ebx, 0x24
cmp ebp, eax
jb 0x406511
mov ebx, dword [esp + 0x24]
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
mov esi, dword [esp + 0x28]
push ebx
push 0
call dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push eax
call dword [sym.imp.KERNEL32.dll_HeapFree]
mov ebx, dword [sym.imp.ADVAPI32.dll_ControlService]
lea ecx, [esp + 0x34]
push ecx
push 1
push esi
call ebx
test eax, eax
jne 0x4065ce
mov eax, dword [esp + 0x88]
test eax, eax
jne 0x4065c3
mov eax, 0x43257c
push eax
push str._s_Service_attempting_to_stop.__ControlService_with_SERVICE_CONTROL_STOP_failed.
jmp 0x406727
cmp dword [esp + 0x38], 4
jne 0x4065fe
call edi
mov ebp, eax
mov eax, dword [esp + 0x38]
cmp eax, 4
jne 0x4065fe
call edi
sub eax, ebp
cmp eax, 0x7530
jae 0x4065fe
lea edx, [esp + 0x34]
push edx
push 1
push esi
call ebx
cmp dword [esp + 0x38], 4
je 0x4065e2
cmp dword [esp + 0x38], 1
je 0x406645
mov ebp, dword [esp + 0x94]
mov ebx, dword [esp + 0x2c]
mov eax, dword [esp + 0x4c]
push eax
call dword [sym.imp.KERNEL32.dll_Sleep]
lea ecx, [esp + 0x34]
push ecx
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatus]
test eax, eax
je 0x406711
cmp dword [esp + 0x38], 1
je 0x406645
call edi
sub eax, ebx
cmp eax, ebp
ja 0x4066b3
cmp dword [esp + 0x38], 1
jne 0x406610
mov eax, dword [esp + 0x88]
test eax, eax
jne 0x406655
mov eax, 0x43257c
push eax
push str._s_Service_successfully_stopped.
push 1
push 0x444698
call fcn.00413026
add esp, 0x10
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
mov eax, dword [esp + 0x1c]
test eax, eax
je 0x406685
mov edx, dword [esp + 0x98]
push edx
call esi
mov ecx, dword [esp + 0x88]
test ecx, ecx
je 0x40676d
mov al, byte [ecx - 1]
test al, al
je 0x406763
cmp al, 0xff
je 0x406763
dec al
mov byte [ecx - 1], al
xor eax, eax
jmp 0x4067b5
mov eax, dword [esp + 0x88]
test eax, eax
jne 0x4066c3
mov eax, 0x43257c
push eax
push str._s_Service_attempting_to_stop.__Timed_out_waiting_for_the_service_to_stop.
push 8
push 0x444698
call fcn.00413026
mov ecx, dword [esp + 0x98]
add esp, 0x10
test ecx, ecx
je 0x406707
mov al, byte [ecx - 1]
test al, al
je 0x4066fd
cmp al, 0xff
je 0x4066fd
dec al
mov byte [ecx - 1], al
mov eax, 0x5b4
jmp 0x4067b5
dec ecx
push ecx
call fcn.004296d1
add esp, 4
mov eax, 0x5b4
jmp 0x4067b5
mov eax, dword [esp + 0x88]
test eax, eax
jne 0x406721
mov eax, 0x43257c
push eax
push str._s_Service_attempting_to_stop.__QueryServiceStatus_failed.
push 8
push 0x444698
call fcn.00413026
add esp, 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [esp + 0x88]
mov esi, eax
test ecx, ecx
je 0x4067b3
mov al, byte [ecx - 1]
test al, al
je 0x4064c7
cmp al, 0xff
je 0x4064c7
dec al
mov byte [ecx - 1], al
jmp 0x4067b3
dec ecx
push ecx
call fcn.004296d1
add esp, 4
xor eax, eax
jmp 0x4067b5
mov eax, dword [esp + 0x88]
cmp eax, edi
jne 0x406781
mov eax, 0x43257c
push eax
push str._s_Service_attempting_to_stop.__QueryServiceStatus_failed.
push 8
push 0x444698
call fcn.00413026
add esp, 0x10
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov esi, eax
mov dword [esp + 0x7c], 0xffffffff
push ebx
lea ecx, [esp + 0x88]
call fcn.00403360
mov eax, esi
mov ecx, dword [esp + 0x74]
pop edi
pop esi
pop ebp
mov dword fs:[0], ecx
pop ebx
add esp, 0x70
ret 0x18