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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x437068]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0xf003f
push 0
push 0
mov esi, ecx
mov dword [ebp - 0x38], 0
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov dword [ebp - 0x34], eax
test eax, eax
je 0x408197
cmp dword [esi + 0x14], 0x10
jb 0x407f8e
mov esi, dword [esi]
push 0xf01ff
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov edi, eax
test edi, edi
jne 0x407fbd
push dword [ebp - 0x34]
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004096fc
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x408189
mov eax, dword [ebp - 0x28]
cmp eax, 1
je 0x408009
cmp eax, 3
je 0x408009
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push dword [ebp - 0x34]
call esi
mov eax, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004096fc
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call esi
cmp dword [ebp - 0x28], 3
mov ecx, 0x2710
mov ebx, dword [ebp - 0x18]
mov dword [ebp - 0x30], eax
jne 0x40808f
mov eax, 0xcccccccd
mul dword [ebp - 0x14]
shr edx, 3
cmp edx, 0x3e8
jae 0x40803c
mov edx, 0x3e8
jmp 0x408045
cmp edx, 0x2710
cmova edx, ecx
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 edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x408189
cmp dword [ebp - 0x18], ebx
jbe 0x408076
call esi
mov ebx, dword [ebp - 0x18]
mov dword [ebp - 0x30], eax
jmp 0x408084
call esi
sub eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x14]
ja 0x408189
cmp dword [ebp - 0x28], 3
mov ecx, 0x2710
je 0x408022
push 0
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
je 0x408189
push str.Service_start_pending..._n
call fcn.004071d0
add esp, 4
lea eax, [ebp - 8]
push eax
push 0x24
lea eax, [ebp - 0x2c]
push eax
push 0
push edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x408189
call esi
mov ebx, dword [ebp - 0x18]
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x28]
cmp eax, 2
jne 0x40814c
nop word [eax + eax]
mov eax, 0xcccccccd
mul dword [ebp - 0x14]
shr edx, 3
cmp edx, 0x3e8
jae 0x4080fa
mov edx, 0x3e8
jmp 0x408108
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 edi
call dword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x408149
cmp dword [ebp - 0x18], ebx
jbe 0x408135
call esi
mov ebx, dword [ebp - 0x18]
mov dword [ebp - 0x30], eax
jmp 0x40813f
call esi
sub eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x14]
ja 0x408149
mov eax, dword [ebp - 0x28]
cmp eax, 2
je 0x4080e0
jmp 0x40814c
mov eax, dword [ebp - 0x28]
cmp eax, 4
jne 0x40815a
mov dword [ebp - 0x38], 1
jmp 0x408167
push str.Service_not_started.__n
call fcn.004071d0
add esp, 4
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push dword [ebp - 0x34]
call esi
mov eax, dword [ebp - 0x38]
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.004096fc
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
push edi
call esi
push dword [ebp - 0x34]
call esi
mov ecx, dword [ebp - 4]
xor eax, eax
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.004096fc
mov esp, ebp
pop ebp
ret