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

Disassembly:
push rbp
mov rbp, rsp
sub rsp, 0x80
mov rax, qword [0x140294a28]
xor rax, rsp
mov qword [rbp - 0x20], rax
cmp word [0x14029b4f0], 0
je 0x140016969
xor edx, edx
mov qword [rsp + 0x78], r14
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov r14, rax
test rax, rax
jne 0x14001662e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenSCManager_failed___d__n
call fcn.140015790
jmp 0x140016964
mov r8d, 0xf01ff
mov qword [rsp + 0x90], rbx
lea rdx, [0x14029b4f0]
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rbx, rax
test rax, rax
jne 0x14001667a
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str.OpenService_failed___d__n
lea ecx, [rbx + 0xf]
call fcn.140002ae0
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x14001695c
lea rax, [rbp - 0x50]
mov r9d, 0x24
lea r8, [rbp - 0x48]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x1400166b8
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.QueryServiceStatusEx_failed___d__n
mov ecx, 0xf
mov r8d, eax
call fcn.140002ae0
jmp 0x1400166d5
mov eax, dword [rbp - 0x44]
dec eax
test eax, 0xfffffffd
je 0x1400166ec
lea rdx, str.Cannot_start_the_service_because_it_is_already_running_n
mov ecx, 0xf
call fcn.140002ae0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x14001695c
mov qword [rsp + 0x98], rsi
mov qword [rsp + 0xa0], rdi
mov qword [rsp + 0x70], r15
call qword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [rbp - 0x44], 3
mov r15d, 0x2710
mov edi, dword [rbp - 0x34]
mov esi, eax
jne 0x140016790
nop dword [rax + rax]
mov eax, 0xcccccccd
mul dword [rbp - 0x30]
shr edx, 3
cmp edx, 0x3e8
jae 0x14001673a
mov edx, 0x3e8
jmp 0x140016741
cmp edx, r15d
cmova edx, r15d
mov ecx, edx
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rax, [rbp - 0x50]
mov r9d, 0x24
lea r8, [rbp - 0x48]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x1400167cd
cmp dword [rbp - 0x34], edi
jbe 0x14001677d
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [rbp - 0x34]
mov esi, eax
jmp 0x14001678a
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, esi
cmp eax, dword [rbp - 0x30]
ja 0x1400167b7
cmp dword [rbp - 0x44], 3
je 0x140016720
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
jne 0x1400167e2
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str.StartService_failed___d__n
jmp 0x14001692b
lea rdx, str.Timeout_waiting_for_service_to_stop_n
mov ecx, 0xf
call fcn.140002ae0
jmp 0x140016935
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str.QueryServiceStatusEx_failed___d__n
jmp 0x14001692b
lea rdx, str.Service_start_pending..._n
mov ecx, 0xf
call fcn.140002ae0
lea rax, [rbp - 0x50]
mov r9d, 0x24
lea r8, [rbp - 0x48]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x1400167cd
call qword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [rbp - 0x44], 2
mov esi, eax
mov edi, dword [rbp - 0x34]
jne 0x1400168bc
nop word [rax + rax]
mov eax, 0xcccccccd
mul dword [rbp - 0x30]
shr edx, 3
cmp edx, 0x3e8
jae 0x14001684a
mov edx, 0x3e8
jmp 0x140016851
cmp edx, r15d
cmova edx, r15d
mov ecx, edx
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rax, [rbp - 0x50]
mov r9d, 0x24
lea r8, [rbp - 0x48]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x1400168a2
cmp dword [rbp - 0x34], edi
jbe 0x14001688d
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [rbp - 0x34]
mov esi, eax
jmp 0x14001689a
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, esi
cmp eax, dword [rbp - 0x30]
ja 0x1400168bc
cmp dword [rbp - 0x44], 2
je 0x140016830
jmp 0x1400168bc
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.QueryServiceStatusEx_failed___d__n
mov ecx, 0xf
mov r8d, eax
call fcn.140002ae0
cmp dword [rbp - 0x44], 4
mov ecx, 0xf
jne 0x1400168d5
lea rdx, str.Service_started_successfully._n
call fcn.140002ae0
jmp 0x140016935
lea rdx, str.Service_not_started.__n
call fcn.140002ae0
mov r8d, dword [rbp - 0x44]
lea rdx, str.__Current_State:__d_n
mov ecx, 0xf
call fcn.140002ae0
mov r8d, dword [rbp - 0x3c]
lea rdx, str.__Exit_Code:__d_n
mov ecx, 0xf
call fcn.140002ae0
mov r8d, dword [rbp - 0x34]
lea rdx, str.__Check_Point:__d_n
mov ecx, 0xf
call fcn.140002ae0
mov r8d, dword [rbp - 0x30]
lea rdx, str.__Wait_Hint:__d_n
mov ecx, 0xf
call fcn.140002ae0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rsi, qword [rsp + 0x98]
mov rdi, qword [rsp + 0xa0]
mov r15, qword [rsp + 0x70]
mov rbx, qword [rsp + 0x90]
mov r14, qword [rsp + 0x78]
mov rcx, qword [rbp - 0x20]
xor rcx, rsp
call fcn.1401a6080
add rsp, 0x80
pop rbp
ret