Function at 0x180016d50
Capabilities:
Create service
Delete service
Modify service
Persist via run registry key
Persist via windows service
Query or enumerate registry value
Query service configuration
Set registry value

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x708]
sub rsp, 0x7e0
mov qword [rsp + 0x78], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov rax, qword [0x1801003f0]
xor rax, rsp
mov qword [rbp + 0x6d0], rax
call fcn.18002c330
xor r15d, r15d
lea esi, [r15 + 1]
test eax, eax
je 0x180016e24
xor edx, edx
xor ecx, ecx
mov r8d, 0x20000000
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov rbx, rax
test rax, rax
je 0x180016e73
mov r8d, 0x20010000
lea rdx, str.Winhlpsvr
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov rdi, rax
test rax, rax
je 0x180016e19
xor eax, eax
mov qword [rbp - 0x80], r15
mov qword [rbp - 0x78], rax
mov qword [rbp - 0x70], rax
mov dword [rbp - 0x68], eax
lea r8, [rbp - 0x80]
mov edx, esi
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x180016e07
cmp dword [rbp - 0x7c], esi
jne 0x180016e10
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_DeleteService]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
jmp 0x180016e73
lea rcx, [rbp - 0x80]
call fcn.180029050
nop
mov r9d, 0x2001f
mov r8, qword [str.SoftwareMicrosoftWindowsCurrentVersionRunServices]
mov rdx, 0xffffffff80000002
lea rcx, [rbp - 0x80]
call fcn.180028a50
test rax, rax
je 0x180016e6a
lea rdx, str.Winhlpsvr
lea rcx, [rbp - 0x80]
call fcn.180027900
lea rcx, [rbp - 0x80]
call fcn.1800276e0
nop
lea rcx, [rbp - 0x80]
call fcn.1800289d0
cmp dword [0x1801161a0], 0
je 0x180016e9b
lea r9, str.CMonitorThread::CheckService_1
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x1801160e8]
call fcn.180011c50
mov byte [rbp - 0x60], 0
xor edx, edx
mov r8d, 0x103
lea rcx, [rbp - 0x5f]
call fcn.1800369b0
call fcn.180002770
mov r8, rax
lea r9, [0x1800c6508]
lea rdx, [0x1800c1ec8]
lea rcx, [rbp - 0x60]
call fcn.18003756c
lea r8, [rbp - 0x60]
lea rdx, str.__s_
lea rcx, [rbp + 0xb0]
call fcn.18003756c
call fcn.18002c330
test eax, eax
je 0x1800172fa
mov r14d, r15d
lea rdi, str..OcularServices
nop dword [rax]
mov r12d, esi
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov r13, rax
test rax, rax
je 0x1800172c9
mov r8d, 0xf01ff
lea rdx, str..Winhlpsvr
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov rbx, rax
test rax, rax
jne 0x180016fd0
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x50], r15
mov qword [rsp + 0x48], r15
mov qword [rsp + 0x40], rdi
lea rax, [rbp + 0xb0]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], esi
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 0x110
mov r9d, 0xf01ff
lea r8, str.Windows_Helper_Service
lea rdx, str..Winhlpsvr
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov rbx, rax
cmp dword [0x1801161a0], 0
je 0x1800172a4
mov qword [rsp + 0x20], rax
lea r9, str.CMonitorThread::CheckService_3__0x_lx_
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x1801160e8]
call fcn.180011c50
jmp 0x1800172a4
mov byte [rbp + 0x2d0], 0
xor edx, edx
mov r8d, 0x3ff
lea rcx, [rbp + 0x2d1]
call fcn.1800369b0
mov dword [rsp + 0x70], r15d
lea r9, [rsp + 0x70]
mov r8d, 0x400
lea rdx, [rbp + 0x2d0]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
test eax, eax
je 0x1800171c9
mov rdi, qword [rbp + 0x300]
test rdi, rdi
je 0x18001703c
lea rdx, str.LocalSystem
mov rcx, rdi
call fcn.180038078
mov rdi, qword [rbp + 0x300]
test eax, eax
jne 0x18001703c
mov esi, r15d
cmp dword [0x1801161a0], 0
je 0x1800170c3
lea rdx, [0x1800c3310]
mov rax, qword [rbp + 0x2e8]
test rax, rax
cmovne rdx, rax
lea rcx, [0x1800c3310]
mov rax, qword [rbp + 0x2e0]
test rax, rax
cmovne rcx, rax
lea rax, [0x1800c3310]
test rdi, rdi
cmovne rax, rdi
mov qword [rsp + 0x48], rdx
mov qword [rsp + 0x40], rcx
mov qword [rsp + 0x38], rax
mov eax, dword [rbp + 0x2d0]
mov dword [rsp + 0x30], eax
mov eax, dword [rbp + 0x2d4]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], esi
lea r9, str.CMonitorThread::CheckService_5___lu___lu___lu____S_____S_____S__
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x1801160e8]
call fcn.180011c50
cmp dword [rbp + 0x2d4], 2
jne 0x180017118
mov rcx, qword [rbp + 0x2e0]
test rcx, rcx
je 0x180017118
lea rdx, [rbp + 0xb0]
call fcn.180038078
test eax, eax
jne 0x180017118
mov rcx, qword [rbp + 0x2e8]
test rcx, rcx
je 0x180017118
lea rdx, str..OcularServices
call fcn.180038078
test eax, eax
jne 0x180017118
cmp dword [rbp + 0x2d0], 0x110
jne 0x180017118
test esi, esi
je 0x180017298
mov qword [rsp + 0x50], r15
mov qword [rsp + 0x48], r15
mov qword [rsp + 0x40], r15
mov qword [rsp + 0x38], r15
mov qword [rsp + 0x30], r15
lea rax, str..OcularServices
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0xb0]
mov qword [rsp + 0x20], rax
or r9d, 0xffffffff
mov edx, 0x110
mov r8d, 2
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfigA]
mov ecx, dword [0x1801161a0]
test ecx, ecx
je 0x180017194
mov dword [rsp + 0x20], eax
lea r9, str.CMonitorThread::CheckService_6___lu_
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x1801160e8]
call fcn.180011c50
mov ecx, dword [0x1801161a0]
test esi, esi
je 0x180017298
test ecx, ecx
je 0x1800171bf
lea r9, str.CMonitorThread::CheckService_7
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x1801160e8]
call fcn.180011c50
call fcn.1800168d0
jmp 0x180017298
cmp dword [0x1801161a0], 0
je 0x1800171f1
lea r9, str.CMonitorThread::CheckService_4
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x1801160e8]
call fcn.180011c50
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x45b
je 0x180017288
xor eax, eax
mov qword [rbp - 0x80], r15
mov qword [rbp - 0x78], rax
mov qword [rbp - 0x70], rax
mov dword [rbp - 0x68], eax
lea r8, [rbp - 0x80]
mov edx, esi
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ControlService]
cmp dword [0x1801161a0], 0
je 0x18001724e
mov dword [rsp + 0x20], eax
lea r9, str.CMonitorThread::CheckService_5.1___lu_
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x1801160e8]
call fcn.180011c50
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_DeleteService]
cmp dword [0x1801161a0], 0
je 0x180017283
mov dword [rsp + 0x20], eax
lea r9, str.CMonitorThread::CheckService_5.2___lu_
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x1801160e8]
call fcn.180011c50
call fcn.1800168d0
mov r12d, r15d
inc r14d
cmp r14d, 2
cmova r12d, esi
jmp 0x1800172a4
mov esi, 1
lea rdi, str..OcularServices
test rbx, rbx
je 0x1800172b2
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test r12d, r12d
jne 0x1800173d2
jmp 0x180016f00
cmp dword [0x1801161a0], 0
je 0x1800173d2
lea r9, str.CMonitorThread::CheckService_2
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x1801160e8]
call fcn.180011c50
jmp 0x1800173d2
mov qword [rbp - 0x80], r15
lea r8, [rbp - 0x80]
mov rdx, qword [str.SoftwareMicrosoftWindowsCurrentVersionRunServices]
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
test eax, eax
jne 0x1800173d2
mov byte [rbp + 0x1c0], al
xor edx, edx
mov r8d, 0x103
lea rcx, [rbp + 0x1c1]
call fcn.1800369b0
mov dword [rsp + 0x74], 0x208
mov dword [rsp + 0x70], r15d
lea rax, [rsp + 0x74]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x1c0]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x70]
xor r8d, r8d
lea rdx, str..Winhlpsvr
mov rcx, qword [rbp - 0x80]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x180017393
cmp dword [rsp + 0x70], 1
jne 0x180017393
lea rdx, [rbp - 0x60]
lea rcx, [rbp + 0x1c0]
call fcn.180038078
test eax, eax
je 0x1800173c8
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rbp - 0x60]
repne scasb al, byte [rdi]
not rcx
and ecx, ecx
mov dword [rsp + 0x28], ecx
lea rax, [rbp - 0x60]
mov qword [rsp + 0x20], rax
mov r9d, esi
xor r8d, r8d
lea rdx, str..Winhlpsvr
mov rcx, qword [rbp - 0x80]
call qword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov rcx, qword [rbp - 0x80]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov rcx, qword [rbp + 0x6d0]
xor rcx, rsp
call fcn.180036980
lea r11, [rsp + 0x7e0]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rdi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret