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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [0x5eb10c]
xor eax, ebp
mov dword [ebp - 4], eax
cmp word [0x5f05d8], 0
je 0x4145a4
push edi
push 0xf003f
push 0
push 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov edi, eax
test edi, edi
jne 0x4142c7
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.004134c0
add esp, 8
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054eec4
mov esp, ebp
pop ebp
ret
push esi
push 0xf01ff
push 0x5f05d8
push edi
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x41430c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed___d__n
push 0xf
call fcn.00401fa0
add esp, 0xc
push edi
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
pop esi
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054eec4
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x414355
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
push 0xf
call fcn.00401fa0
add esp, 0xc
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
pop esi
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054eec4
mov esp, ebp
pop ebp
ret
mov eax, dword [ebp - 0x24]
cmp eax, 1
je 0x41438d
cmp eax, 3
je 0x41438d
push str.Cannot_start_the_service_because_it_is_already_running_n
push 0xf
call fcn.00401fa0
add esp, 8
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
pop esi
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054eec4
mov esp, ebp
pop ebp
ret
push ebx
mov ebx, dword [sym.imp.KERNEL32.dll_GetTickCount]
call ebx
cmp dword [ebp - 0x24], 3
mov ecx, 0x2710
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
jne 0x41441b
nop word [eax + eax]
mov eax, 0xcccccccd
mul dword [ebp - 0x10]
shr edx, 3
cmp edx, 0x3e8
jae 0x4143ca
mov edx, 0x3e8
jmp 0x4143d3
cmp edx, 0x2710
cmova edx, ecx
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x414459
mov eax, dword [ebp - 0x2c]
cmp dword [ebp - 0x14], eax
jbe 0x414406
call ebx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x2c], ecx
jmp 0x414410
call ebx
sub eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x10]
ja 0x414445
cmp dword [ebp - 0x24], 3
mov ecx, 0x2710
je 0x4143b0
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x414474
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService_failed___d__n
push 0xf
call fcn.00401fa0
add esp, 0xc
jmp 0x414595
push str.Timeout_waiting_for_service_to_stop_n
push 0xf
call fcn.00401fa0
add esp, 8
jmp 0x414595
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
push 0xf
call fcn.00401fa0
add esp, 0xc
jmp 0x414595
push str.Service_start_pending..._n
push 0xf
call fcn.00401fa0
add esp, 8
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x414459
call ebx
cmp dword [ebp - 0x24], 2
mov dword [ebp - 0x2c], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
jne 0x414533
nop
mov eax, 0xcccccccd
mul dword [ebp - 0x10]
shr edx, 3
cmp edx, 0x3e8
jae 0x4144ca
mov edx, 0x3e8
jmp 0x4144d8
cmp edx, 0x2710
mov eax, 0x2710
cmova edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x34]
push eax
push 0x24
lea eax, [ebp - 0x28]
push eax
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x41451d
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x14], eax
jbe 0x41450b
call ebx
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x2c], eax
mov dword [ebp - 0x30], ecx
jmp 0x414515
call ebx
sub eax, dword [ebp - 0x2c]
cmp eax, dword [ebp - 0x10]
ja 0x414533
cmp dword [ebp - 0x24], 2
je 0x4144b0
jmp 0x414533
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
push 0xf
call fcn.00401fa0
add esp, 0xc
cmp dword [ebp - 0x24], 4
jne 0x41454a
push str.Service_started_successfully._n
push 0xf
call fcn.00401fa0
add esp, 8
jmp 0x414595
push str.Service_not_started.__n
push 0xf
call fcn.00401fa0
push dword [ebp - 0x24]
push str.__Current_State:__d_n
push 0xf
call fcn.00401fa0
push dword [ebp - 0x1c]
push str.__Exit_Code:__d_n
push 0xf
call fcn.00401fa0
push dword [ebp - 0x14]
push str.__Check_Point:__d_n
push 0xf
call fcn.00401fa0
push dword [ebp - 0x10]
push str.__Wait_Hint:__d_n
push 0xf
call fcn.00401fa0
add esp, 0x38
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push edi
call esi
pop ebx
pop esi
pop edi
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0054eec4
mov esp, ebp
pop ebp
ret