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

Disassembly:
push rbp
push rbx
push rdi
mov rbp, rsp
sub rsp, 0x70
mov rax, qword [0x140020008]
xor rax, rsp
mov qword [rbp - 0x10], rax
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
xor edi, edi
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov rbx, rax
test rax, rax
je 0x140001b2c
lea r8d, [rdi + 1]
mov rcx, rax
lea rdx, str.BMTGBJTXService
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
test rax, rax
je 0x1400017fe
mov rcx, rax
mov edi, 1
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test edi, edi
je 0x140001b2c
xor edx, edx
mov qword [rsp + 0x98], r14
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov r14, rax
test rax, rax
jne 0x140001848
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenSCManager_failed___d__n
call fcn.140001cc0
jmp 0x140001b24
mov r8d, 0xf01ff
lea rdx, str.BMTGBJTXService
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov rbx, rax
test rax, rax
jne 0x140001888
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenService_failed___d__n
call fcn.140001cc0
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140001b24
lea rax, [rbp - 0x40]
mov r9d, 0x24
lea r8, [rbp - 0x38]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
jne 0x1400018c0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.QueryServiceStatusEx_failed___d__n
call fcn.140001cc0
jmp 0x1400018d8
mov eax, dword [rbp - 0x34]
dec eax
test eax, 0xfffffffd
je 0x1400018ef
lea rcx, str.Cannot_start_the_service_because_it_is_already_running_n
call fcn.140001cc0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x140001b24
mov qword [rsp + 0x90], rsi
mov qword [rsp + 0xa0], r15
call qword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [rbp - 0x34], 3
mov r15d, 0x2710
mov edi, dword [rbp - 0x24]
mov esi, eax
jne 0x140001990
nop word [rax + rax]
mov eax, 0xcccccccd
mul dword [rbp - 0x20]
shr edx, 3
cmp edx, 0x3e8
jae 0x14000193a
mov edx, 0x3e8
jmp 0x140001941
cmp edx, r15d
cmova edx, r15d
mov ecx, edx
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rax, [rbp - 0x40]
mov r9d, 0x24
lea r8, [rbp - 0x38]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x1400019c7
cmp dword [rbp - 0x24], edi
jbe 0x14000197d
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [rbp - 0x24]
mov esi, eax
jmp 0x14000198a
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, esi
cmp eax, dword [rbp - 0x20]
ja 0x1400019b6
cmp dword [rbp - 0x34], 3
je 0x140001920
xor r8d, r8d
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_StartServiceA]
test eax, eax
jne 0x1400019db
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.StartService_failed___d__n
jmp 0x140001afd
lea rcx, str.Timeout_waiting_for_service_to_stop_n
call fcn.140001cc0
jmp 0x140001b02
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.QueryServiceStatusEx_failed___d__n
jmp 0x140001afd
lea rcx, str.Service_start_pending..._n
call fcn.140001cc0
lea rax, [rbp - 0x40]
mov r9d, 0x24
lea r8, [rbp - 0x38]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x1400019c7
call qword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [rbp - 0x34], 2
mov esi, eax
mov edi, dword [rbp - 0x24]
jne 0x140001aa6
nop
mov eax, 0xcccccccd
mul dword [rbp - 0x20]
shr edx, 3
cmp edx, 0x3e8
jae 0x140001a3a
mov edx, 0x3e8
jmp 0x140001a41
cmp edx, r15d
cmova edx, r15d
mov ecx, edx
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rax, [rbp - 0x40]
mov r9d, 0x24
lea r8, [rbp - 0x38]
mov qword [rsp + 0x20], rax
xor edx, edx
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x140001a92
cmp dword [rbp - 0x24], edi
jbe 0x140001a7d
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [rbp - 0x24]
mov esi, eax
jmp 0x140001a8a
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, esi
cmp eax, dword [rbp - 0x20]
ja 0x140001aa6
cmp dword [rbp - 0x34], 2
je 0x140001a20
jmp 0x140001aa6
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.QueryServiceStatusEx_failed___d__n
call fcn.140001cc0
cmp dword [rbp - 0x34], 4
jne 0x140001aba
lea rcx, str.Service_started_successfully._n
call fcn.140001cc0
jmp 0x140001b02
lea rcx, str.Service_not_started.__n
call fcn.140001cc0
mov edx, dword [rbp - 0x34]
lea rcx, str.__Current_State:__d_n
call fcn.140001cc0
mov edx, dword [rbp - 0x2c]
lea rcx, str.__Exit_Code:__d_n
call fcn.140001cc0
mov edx, dword [rbp - 0x24]
lea rcx, str.__Check_Point:__d_n
call fcn.140001cc0
mov edx, dword [rbp - 0x20]
lea rcx, str.__Wait_Hint:__d_n
call fcn.140001cc0
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rsi, qword [rsp + 0x90]
mov r15, qword [rsp + 0xa0]
mov r14, qword [rsp + 0x98]
mov rcx, qword [rbp - 0x10]
xor rcx, rsp
call fcn.140001d30
add rsp, 0x70
pop rdi
pop rbx
pop rbp
ret