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

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x3c
mov eax, dword [0x1010f16c]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
push 0xf003f
push 0
push 0
mov byte [ebp - 0x29], dl
mov esi, ecx
call dword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov ebx, eax
test ebx, ebx
jne 0x10068804
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenSCManager_failed___d__n
call fcn.10005c70
add esp, 8
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100908e7
mov esp, ebp
pop ebp
ret
movzx eax, byte [ebp - 0x29]
lea eax, [eax*2 + 0x14]
push eax
push esi
push ebx
call dword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov esi, eax
test esi, esi
jne 0x1006884c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.OpenService_failed___d__n
call fcn.10005c70
add esp, 8
push ebx
call dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100908e7
mov esp, ebp
pop ebp
ret
lea eax, [ebp - 0x38]
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 0x1006887c
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.10005c70
add esp, 8
jmp 0x10068afa
mov eax, dword [ebp - 0x24]
cmp eax, 1
je 0x100688b5
cmp eax, 3
je 0x100688b5
push str.Cannot_start_the_service_because_it_is_already_running_n
call fcn.10005c70
add esp, 4
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebx
call esi
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100908e7
mov esp, ebp
pop ebp
ret
mov edi, dword [sym.imp.KERNEL32.dll_GetTickCount]
call edi
cmp dword [ebp - 0x24], 3
mov ecx, 0x2710
mov dword [ebp - 0x34], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
jne 0x10068940
mov eax, 0xcccccccd
mul dword [ebp - 0x10]
shr edx, 3
cmp edx, 0x3e8
jae 0x100688eb
mov edx, 0x3e8
jmp 0x100688f4
cmp edx, 0x2710
cmova edx, ecx
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x38]
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 0x10068863
mov eax, dword [ebp - 0x30]
cmp dword [ebp - 0x14], eax
jbe 0x1006892b
call edi
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x34], eax
mov dword [ebp - 0x30], ecx
jmp 0x10068935
call edi
sub eax, dword [ebp - 0x34]
cmp eax, dword [ebp - 0x10]
ja 0x100689b4
cmp dword [ebp - 0x24], 3
mov ecx, 0x2710
je 0x100688d1
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x100689c6
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.StartService_failed___d__n
call fcn.10005c70
add esp, 8
cmp byte [ebp - 0x29], 0
je 0x10068afa
push 0
push 0
push 0
push 0
push 0
push 0
push 0
push 0xffffffffffffffff
push 3
push 0xffffffffffffffff
push esi
call dword [sym.imp.ADVAPI32.dll_ChangeServiceConfigW]
test eax, eax
jne 0x100689a0
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.ChangeServiceConfig_failed___d__n
call fcn.10005c70
add esp, 8
push 0
push 0
push esi
call dword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x100689d3
jmp 0x10068afa
push str.Timeout_waiting_for_service_to_stop_n
call fcn.10005c70
add esp, 4
jmp 0x10068afa
push str.Service_start_pending..._n
call fcn.10005c70
add esp, 4
lea eax, [ebp - 0x38]
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 0x10068863
call edi
cmp dword [ebp - 0x24], 2
mov dword [ebp - 0x30], eax
mov eax, dword [ebp - 0x14]
mov dword [ebp - 0x34], eax
jne 0x10068a84
mov eax, 0xcccccccd
mul dword [ebp - 0x10]
shr edx, 3
cmp edx, 0x3e8
jae 0x10068a1d
mov edx, 0x3e8
jmp 0x10068a2b
cmp edx, 0x2710
mov eax, 0x2710
cmova edx, eax
push edx
call dword [sym.imp.KERNEL32.dll_Sleep]
lea eax, [ebp - 0x38]
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 0x10068a70
mov eax, dword [ebp - 0x34]
cmp dword [ebp - 0x14], eax
jbe 0x10068a5e
call edi
mov ecx, dword [ebp - 0x14]
mov dword [ebp - 0x30], eax
mov dword [ebp - 0x34], ecx
jmp 0x10068a68
call edi
sub eax, dword [ebp - 0x30]
cmp eax, dword [ebp - 0x10]
ja 0x10068a84
cmp dword [ebp - 0x24], 2
je 0x10068a03
jmp 0x10068a84
call dword [sym.imp.KERNEL32.dll_GetLastError]
push eax
push str.QueryServiceStatusEx_failed___d__n
call fcn.10005c70
add esp, 8
cmp dword [ebp - 0x24], 4
jne 0x10068ab6
push str.Service_started_successfully._n
call fcn.10005c70
add esp, 4
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebx
call esi
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.100908e7
mov esp, ebp
pop ebp
ret
push str.Service_not_started.__n
call fcn.10005c70
add esp, 4
push dword [ebp - 0x24]
push str.__Current_State:__d_n
call fcn.10005c70
push dword [ebp - 0x1c]
push str.__Exit_Code:__d_n
call fcn.10005c70
push dword [ebp - 0x14]
push str.__Check_Point:__d_n
call fcn.10005c70
push dword [ebp - 0x10]
push str.__Wait_Hint:__d_n
call fcn.10005c70
add esp, 0x20
push esi
mov esi, dword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
call esi
push ebx
call esi
mov ecx, dword [ebp - 4]
xor al, al
pop edi
pop esi
xor ecx, ebp
pop ebx
call fcn.100908e7
mov esp, ebp
pop ebp
ret