Function at 0x412aa0
Capabilities:
Check for time delay via gettickcount
Query service status
Start service

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x40
mov dword [ebp - 0x40], ecx
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
jne 0x412ada
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.004050e8
add esp, 8
jmp 0x412e41
push 0xf01ff
push 0x416478
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov dword [ebp - 4], eax
cmp dword [ebp - 4], 0
jne 0x412b1a
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed___d__n
call fcn.004050e8
add esp, 8
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x412e41
lea edx, [ebp - 0x10]
push edx
push 0x24
lea eax, [ebp - 0x3c]
push eax
push 0
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x412b61
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x41649c
call fcn.004050e8
add esp, 8
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, dword [ebp - 0x14]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x412e41
cmp dword [ebp - 0x38], 1
je 0x412b93
cmp dword [ebp - 0x38], 3
je 0x412b93
push str.Cannot_start_the_service_because_it_is_already_running_n
call fcn.004050e8
add esp, 4
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [ebp - 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x412e41
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 8], eax
cmp dword [ebp - 0x38], 3
jne 0x412c80
mov eax, dword [ebp - 0x24]
xor edx, edx
mov ecx, 0xa
div ecx
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0x3e8
jae 0x412bcd
mov dword [ebp - 0xc], 0x3e8
jmp 0x412bdd
cmp dword [ebp - 0xc], 0x2710
jbe 0x412bdd
mov dword [ebp - 0xc], 0x2710
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x10]
push eax
push 0x24
lea ecx, [ebp - 0x3c]
push ecx
push 0
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x412c2e
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x4164f8
call fcn.004050e8
add esp, 8
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x412e41
mov edx, dword [ebp - 0x28]
cmp edx, dword [ebp - 8]
jbe 0x412c47
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x18], eax
mov eax, dword [ebp - 0x28]
mov dword [ebp - 8], eax
jmp 0x412c7b
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x24]
jbe 0x412c7b
push str.Timeout_waiting_for_service_to_stop_n
call fcn.004050e8
add esp, 4
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [ebp - 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x412e41
jmp 0x412ba2
push 0
push 0
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x412cc1
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService_failed___d__n
call fcn.004050e8
add esp, 8
mov ecx, dword [ebp - 4]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov edx, dword [ebp - 0x14]
push edx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x412e41
push str.Service_start_pending..._n
call fcn.004050e8
add esp, 4
lea eax, [ebp - 0x10]
push eax
push 0x24
lea ecx, [ebp - 0x3c]
push ecx
push 0
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x412d15
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push 0x41657c
call fcn.004050e8
add esp, 8
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x412e41
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x18], eax
mov edx, dword [ebp - 0x28]
mov dword [ebp - 8], edx
cmp dword [ebp - 0x38], 2
jne 0x412dc7
mov eax, dword [ebp - 0x24]
xor edx, edx
mov ecx, 0xa
div ecx
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0x3e8
jae 0x412d4f
mov dword [ebp - 0xc], 0x3e8
jmp 0x412d5f
cmp dword [ebp - 0xc], 0x2710
jbe 0x412d5f
mov dword [ebp - 0xc], 0x2710
mov edx, dword [ebp - 0xc]
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x10]
push eax
push 0x24
lea ecx, [ebp - 0x3c]
push ecx
push 0
mov edx, dword [ebp - 4]
push edx
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x412d99
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.004050e8
add esp, 8
jmp 0x412dc7
mov eax, dword [ebp - 0x28]
cmp eax, dword [ebp - 8]
jbe 0x412db2
call dword [sym.imp.KERNEL32.dll_GetTickCount]
mov dword [ebp - 0x18], eax
mov ecx, dword [ebp - 0x28]
mov dword [ebp - 8], ecx
jmp 0x412dc2
call dword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, dword [ebp - 0x18]
cmp eax, dword [ebp - 0x24]
jbe 0x412dc2
jmp 0x412dc7
jmp 0x412d24
cmp dword [ebp - 0x38], 4
jne 0x412ddc
push str.Service_started_successfully._n
call fcn.004050e8
add esp, 4
jmp 0x412e2d
push str.Service_not_started.__n
call fcn.004050e8
add esp, 4
mov edx, dword [ebp - 0x38]
push edx
push str.__Current_State:__d_n
call fcn.004050e8
add esp, 8
mov eax, dword [ebp - 0x30]
push eax
push str.__Exit_Code:__d_n
call fcn.004050e8
add esp, 8
mov ecx, dword [ebp - 0x28]
push ecx
push str.__Check_Point:__d_n
call fcn.004050e8
add esp, 8
mov edx, dword [ebp - 0x24]
push edx
push str.__Wait_Hint:__d_n
call fcn.004050e8
add esp, 8
mov eax, dword [ebp - 4]
push eax
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, dword [ebp - 0x14]
push ecx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov esp, ebp
pop ebp
ret