Function at 0x140045280
Capabilities:
Check for time delay via gettickcount
Query service status
Stop service

Disassembly:
mov r11, rsp
mov qword [r11 + 0x18], rbx
push rsi
push rdi
push r13
push r14
push r15
sub rsp, 0x90
xor eax, eax
xor r13d, r13d
mov r14d, r8d
mov dword [r11 - 0x70], r13d
mov dword [r11 - 0x50], r13d
mov dword [rsp + 0x6c], eax
mov dword [rsp + 0x70], eax
mov dword [rsp + 0x74], eax
mov dword [rsp + 0x78], eax
mov dword [rsp + 0x7c], eax
mov rdi, rdx
lea r8d, [r13 + 1]
xor edx, edx
xor ecx, ecx
mov dword [rsp + 0x4c], eax
mov dword [rsp + 0x50], eax
mov dword [rsp + 0x54], eax
mov dword [rsp + 0x58], eax
mov dword [rsp + 0x5c], eax
mov dword [rsp + 0x60], eax
mov dword [r11 - 0x38], eax
mov dword [r11 - 0x34], eax
mov dword [r11 - 0x30], eax
mov dword [r11 + 0x20], r13d
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
test rax, rax
mov r15, rax
je 0x1400455ad
lea r8d, [r13 + 0x24]
mov rdx, rdi
mov rcx, rax
mov qword [rsp + 0xc0], rbp
mov qword [rsp + 0xc8], r12
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
test rax, rax
mov r12, rax
je 0x140045569
lea rax, [rsp + 0xd8]
lea r9d, [r13 + 0x24]
lea r8, [rsp + 0x68]
xor edx, edx
mov rcx, r12
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x14004554f
call qword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [rsp + 0x6c], 3
mov edi, dword [rsp + 0x7c]
mov ebx, eax
mov ecx, 0x2710
jne 0x140045418
mov eax, 0xcccccccd
mul dword [rsp + 0x80]
shr edx, 3
cmp edx, 0x3e8
jae 0x14004538e
mov edx, 0x3e8
jmp 0x140045393
cmp edx, ecx
cmova edx, ecx
mov ecx, edx
call qword [sym.imp.KERNEL32.dll_Sleep]
lea r11, [rsp + 0xd8]
lea r8, [rsp + 0x68]
mov r9d, 0x24
xor edx, edx
mov rcx, r12
mov qword [rsp + 0x20], r11
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x140045400
cmp dword [rsp + 0x7c], edi
jbe 0x1400453d6
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov edi, dword [rsp + 0x7c]
mov ebx, eax
jmp 0x1400453ee
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [rsp + 0x80]
mov edx, eax
add ecx, r14d
sub edx, ebx
cmp edx, ecx
ja 0x140045418
cmp dword [rsp + 0x6c], 3
mov ecx, 0x2710
je 0x140045370
jmp 0x140045418
lea rcx, str.ntsvcStopService
call fcn.140041bd0
lea rcx, str.ntsvcStopService:_QueryServiceStatusEx_call_failed
call fcn.14003e3d0
cmp dword [rsp + 0x6c], 1
je 0x140045547
lea r8, [rsp + 0x48]
mov edx, 1
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
je 0x14004552d
mov ebp, dword [rsp + 0x4c]
mov eax, 0xcccccccd
mul dword [rsp + 0x60]
mov edi, edx
shr edi, 3
call qword [sym.imp.KERNEL32.dll_GetTickCount]
cmp ebp, 1
mov ebx, dword [rsp + 0x5c]
mov esi, eax
je 0x1400454fa
cmp edi, 0x3e8
jae 0x140045474
mov edi, 0x3e8
jmp 0x14004547e
mov eax, 0x2710
cmp edi, eax
cmova edi, eax
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rdx, [rsp + 0xd8]
lea r8, [rsp + 0x68]
mov qword [rsp + 0x20], rdx
mov r9d, 0x24
mov rcx, r12
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_QueryServiceStatusEx]
test eax, eax
je 0x140045502
cmp dword [rsp + 0x7c], ebx
jbe 0x1400454c8
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ebx, dword [rsp + 0x7c]
mov ecx, dword [rsp + 0x80]
mov esi, eax
jmp 0x1400454e1
call qword [sym.imp.KERNEL32.dll_GetTickCount]
mov ecx, dword [rsp + 0x80]
mov edx, eax
lea eax, [rcx + r14]
sub edx, esi
cmp edx, eax
ja 0x14004551a
mov ebp, dword [rsp + 0x6c]
mov eax, 0xcccccccd
mul ecx
mov edi, edx
shr edi, 3
cmp ebp, 1
jne 0x140045465
mov r13d, 1
jmp 0x140045581
lea rcx, str.ntsvcStopService
call fcn.140041bd0
lea rcx, str.ntsvcStopService:_QueryServiceStatusEx_call_failed
call fcn.14003e3d0
cmp ebp, 1
je 0x1400454fa
lea rcx, str.ntsvcStopService:_dwCurrentState_is_not_SERVICE_STOPPED
call fcn.14003e3d0
jmp 0x140045581
lea rcx, str.ntsvcStopService
call fcn.140041bd0
lea rcx, str.ntsvcStopService:_ControlService_call_failed
call fcn.14003e3d0
jmp 0x140045581
mov r13d, 1
jmp 0x140045581
lea rcx, str.ntsvcStopService
call fcn.140041bd0
lea rcx, str.ntsvcStopService:_QueryServiceStatusEx_call_failed
call fcn.14003e3d0
jmp 0x140045581
lea rcx, str.ntsvcStopService
call fcn.140041bd0
lea rcx, str.ntsvcStopService:_OpenService_call_failed
call fcn.14003e3d0
test r12, r12
mov rbp, qword [rsp + 0xc0]
je 0x140045597
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov r12, qword [rsp + 0xc8]
jmp 0x14004567c
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, [rsp + 0x40]
mov qword [rsp + 0x30], r13
mov dword [rsp + 0x28], r13d
mov qword [rsp + 0x20], rcx
mov r9d, 0x400
mov ecx, 0x1100
mov r8d, eax
xor edx, edx
call qword [sym.imp.KERNEL32.dll_FormatMessageA]
mov rdx, qword [rsp + 0x40]
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, rdx
repne scasb al, byte [rdi]
not rcx
sub rcx, 1
movzx eax, byte [rdx + rcx - 1]
cmp al, 0xa
je 0x140045601
cmp al, 0xd
jne 0x140045607
sub rcx, 1
jmp 0x1400455f4
mov byte [rcx + rdx], r13b
mov rsi, qword [rsp + 0x40]
or rcx, 0xffffffffffffffff
xor eax, eax
mov rdi, rsi
repne scasb al, byte [rdi]
not rcx
lea rbx, [rcx - 1]
call fcn.140056200
test rax, rax
mov rdi, rax
je 0x14004563e
lea r8, [rbx + 1]
mov rdx, rsi
mov rcx, rax
call fcn.14004a400
mov rcx, qword [rsp + 0x40]
call qword [sym.imp.KERNEL32.dll_LocalFree]
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.ntsvcStopService
lea rcx, str._s:_Error_0x_x_____s.
mov r8d, eax
mov r9, rdi
call fcn.14003e3d0
mov rcx, rdi
call fcn.14004ad40
lea rcx, str.ntsvcStopService:_OpenSCManager_call_failed
call fcn.14003e3d0
mov eax, r13d
mov rbx, qword [rsp + 0xd0]
add rsp, 0x90
pop r15
pop r14
pop r13
pop rdi
pop rsi
ret