Function at 0x4660a0
Capabilities:
Check for time delay via gettickcount
Link many functions at runtime

Disassembly:
mov dword [rsp + 0x18], r8d
sub rsp, 0x298
mov qword [rsp + 0x290], rbx
mov qword [rsp + 0x288], rbp
mov qword [rsp + 0x280], rsi
mov qword [rsp + 0x278], rdi
mov qword [rsp + 0x270], r12
mov qword [rsp + 0x268], r13
mov qword [rsp + 0x260], r14
mov edi, r8d
mov r12, rdx
mov qword [rsp + 0x258], r15
call fcn.004545a0
test eax, eax
je 0x466178
lea rdx, str.CService_::_StopAService_n
lea rcx, [rsp + 0x50]
xor r8d, r8d
call fcn.00486850
movabs rdx, 0x203a5952544e45
xor eax, eax
mov qword [rsp + 0x150], rdx
lea rdi, [rsp + 0x150]
mov rcx, 0xffffffffffffffff
repne scasb al, byte [rdi]
xor ecx, ecx
lea rdx, [rsp + 0x50]
nop
nop
movzx eax, byte [rdx + rcx]
inc rcx
test al, al
mov byte [rdi + rcx - 2], al
jne 0x466140
call fcn.004546e0
mov rcx, rax
call fcn.004545b0
call fcn.004546e0
lea rdx, [rsp + 0x150]
mov rcx, rax
call fcn.004548a0
mov edi, dword [rsp + 0x2b0]
call fcn.004545a0
test eax, eax
je 0x4661aa
lea rdx, str.lpszServiceName___s__bDoDeleteService___d_n
lea rcx, [rsp + 0x50]
mov r9d, edi
mov r8, r12
call fcn.00486850
call fcn.004546e0
lea rdx, [rsp + 0x50]
mov rcx, rax
call fcn.004548a0
lea rcx, str.Advapi32.dll
xor r13d, r13d
call qword [sym.imp.KERNEL32.dll_LoadLibraryA]
test rax, rax
mov rdi, rax
je 0x466368
lea rdx, str.OpenSCManagerA
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
mov rbx, rax
je 0x46632a
lea rdx, str.OpenServiceA
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
mov rsi, rax
je 0x466304
lea rdx, str.QueryServiceStatus
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
mov r14, rax
je 0x4662de
lea rdx, str.ControlService
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
mov rbp, rax
je 0x4662b8
lea rdx, str.DeleteService
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
mov qword [rsp + 0x48], rax
je 0x466292
lea rdx, str.CloseServiceHandle
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_GetProcAddress]
test rax, rax
mov r15, rax
jne 0x46638e
call fcn.004545a0
test eax, eax
je 0x4664e2
call fcn.004546e0
lea rdx, str.Failed_to_load_export_CloseServiceHandle_n
mov rcx, rax
call fcn.004548a0
jmp 0x4664e2
call fcn.004545a0
test eax, eax
je 0x4664e2
call fcn.004546e0
lea rdx, str.Failed_to_load_export_DeleteService_n
mov rcx, rax
call fcn.004548a0
jmp 0x4664e2
call fcn.004545a0
test eax, eax
je 0x4664e2
call fcn.004546e0
lea rdx, str.Failed_to_load_export_ControlService_n
mov rcx, rax
call fcn.004548a0
jmp 0x4664e2
call fcn.004545a0
test eax, eax
je 0x4664e2
call fcn.004546e0
lea rdx, str.Failed_to_load_export_QueryServiceStatus_n
mov rcx, rax
call fcn.004548a0
jmp 0x4664e2
call fcn.004545a0
test eax, eax
je 0x4664e2
call fcn.004546e0
lea rdx, str.Failed_to_load_export_OpenServiceA_n
mov rcx, rax
call fcn.004548a0
jmp 0x4664e2
call fcn.004545a0
test eax, eax
je 0x4664e2
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.Failed_to_load_export_OpenSCManagerA_:_GetLastError_____d_n
lea rcx, [rsp + 0x50]
mov r8d, eax
call fcn.00486850
call fcn.004546e0
lea rdx, [rsp + 0x50]
mov rcx, rax
call fcn.004548a0
jmp 0x4664e2
call fcn.004545a0
test eax, eax
je 0x46650a
call fcn.004546e0
lea rdx, str.Failed_to_load_Advapi32.dll_file_n
mov rcx, rax
call fcn.004548a0
jmp 0x46650a
lea rdx, str.ServicesActive
mov r8d, 0xf003f
xor ecx, ecx
call rbx
test rax, rax
mov rdi, rax
mov qword [rsp + 0x20], rax
je 0x4664e2
mov r8d, 0xf01ff
mov rdx, r12
mov rcx, rax
call rsi
test rax, rax
mov rbx, rax
je 0x4664dc
lea rdx, [rsp + 0x28]
mov rcx, rax
call r14
test eax, eax
je 0x4664d6
cmp dword [rsp + 0x2c], 4
jne 0x4665f3
lea r8, [rsp + 0x28]
mov edx, 1
mov rcx, rbx
call rbp
test eax, eax
je 0x4665cd
call qword [sym.imp.KERNEL32.dll_GetTickCount]
cmp dword [rsp + 0x2c], 1
mov edi, eax
je 0x466447
nop
mov ecx, 0x3e8
call qword [sym.imp.KERNEL32.dll_Sleep]
lea rdx, [rsp + 0x28]
mov rcx, rbx
call r14
test eax, eax
je 0x466468
cmp dword [rsp + 0x2c], 1
je 0x466447
call qword [sym.imp.KERNEL32.dll_GetTickCount]
sub eax, edi
cmp eax, 0x1388
ja 0x466483
cmp dword [rsp + 0x2c], 1
jne 0x466410
cmp dword [rsp + 0x2b0], r13d
je 0x466460
mov rcx, rbx
call qword [rsp + 0x48]
test eax, eax
je 0x4665ac
mov r13d, 1
jmp 0x4664d1
call fcn.004545a0
test eax, eax
je 0x4664b4
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rdx, str.ERROR:_QueryServiceStatus_:_GetLastError_____d_n
mov r8d, eax
jmp 0x466498
call fcn.004545a0
test eax, eax
je 0x4664b4
mov r8d, dword [rsp + 0x2c]
lea rdx, str.ERROR:_TimeOut_:_dwCurrentState_d_n
lea rcx, [rsp + 0x50]
call fcn.00486850
call fcn.004546e0
lea rdx, [rsp + 0x50]
mov rcx, rax
call fcn.004548a0
call fcn.004545a0
test eax, eax
je 0x4664d1
call fcn.004546e0
lea rdx, str.ERROR:_Failed_to_completely_stop_service_n
mov rcx, rax
call fcn.004548a0
mov rdi, qword [rsp + 0x20]
mov rcx, rbx
call r15
mov rcx, rdi
call r15
mov r15, qword [rsp + 0x258]
mov r14, qword [rsp + 0x260]
mov rsi, qword [rsp + 0x280]
mov rbp, qword [rsp + 0x288]
mov rbx, qword [rsp + 0x290]
call fcn.004545a0
mov r12, qword [rsp + 0x270]
test eax, eax
je 0x466591
lea rdx, str.CService_::_StopAService_:_bRetVal___d_n
lea rcx, [rsp + 0x50]
mov r8d, r13d
call fcn.00486850
xor eax, eax
movabs rdx, 0x20203a54495845
mov qword [rsp + 0x150], rdx
lea rdi, [rsp + 0x150]
mov rcx, 0xffffffffffffffff
repne scasb al, byte [rdi]
lea rax, [rsp + 0x50]
xor edx, edx
nop
nop
movzx ecx, byte [rax + rdx]
inc rdx
test cl, cl
mov byte [rdi + rdx - 2], cl
jne 0x466560
call fcn.004546e0
lea rdx, [rsp + 0x150]
mov rcx, rax
call fcn.004548a0
call fcn.004546e0
mov rcx, rax
call fcn.004545c0
mov eax, r13d
mov r13, qword [rsp + 0x268]
mov rdi, qword [rsp + 0x278]
add rsp, 0x298
ret
call fcn.004545a0
test eax, eax
je 0x4664d1
call fcn.004546e0
lea rdx, str.FAILED_to_stop_service____Setting_for_Reboot_n
mov rcx, rax
jmp 0x4664cc
call fcn.004545a0
test eax, eax
je 0x4664d6
call fcn.004546e0
lea rdx, str.FAILED_to_stop_service____Setting_for_Reboot_n
mov rcx, rax
call fcn.004548a0
jmp 0x4664d6
call fcn.004545a0
test eax, eax
je 0x4664d6
call fcn.004546e0
lea rdx, str.FAILED_ControlService_:_Service_Not_Running_n
mov rcx, rax
call fcn.004548a0
jmp 0x4664d6