Function at 0x140171780
Capabilities:
Create service
Modify service
Persist via windows service

Disassembly:
mov rax, rsp
push rbp
lea rbp, [rax - 0x5f]
sub rsp, 0xe0
mov qword [rbp + 0x27], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov qword [rax + 0x20], r14
mov rax, qword [0x140418a10]
xor rax, rsp
mov qword [rbp + 0x47], rax
xor dil, dil
lea rcx, [rbp - 0x19]
call fcn.140171bb0
nop
mov rcx, qword [rbp - 0x19]
test rcx, rcx
je 0x140171a65
or rax, 0xffffffffffffffff
inc rax
cmp word [rcx + rax*2], 0
jne 0x1401717d3
test rax, rax
je 0x140171a65
lea r8, [0x1403512cc]
lea rcx, [rbp - 0x19]
call fcn.140200130
mov rbx, rax
mov edx, dword [rax + 0xc]
lea rcx, [rbp - 0x19]
call fcn.1401ff260
movsxd r9, dword [rbx + 0xc]
mov eax, dword [rbp - 0x11]
inc eax
movsxd rdx, eax
mov r8, qword [rbx]
mov rcx, qword [rbp - 0x19]
call fcn.1402bd21c
mov edx, dword [rbx + 0xc]
lea rcx, [rbp - 0x19]
call fcn.140200570
lea rdx, [0x1403512cc]
lea rcx, [rbp - 0x19]
call fcn.1401fd8b0
mov rbx, rax
mov edx, dword [rax + 0xc]
lea rcx, [rbp - 0x19]
call fcn.1401ff260
movsxd r9, dword [rbx + 0xc]
mov eax, dword [rbp - 0x11]
inc eax
movsxd rdx, eax
mov r8, qword [rbx]
mov rcx, qword [rbp - 0x19]
call fcn.1402bd21c
mov edx, dword [rbx + 0xc]
lea rcx, [rbp - 0x19]
call fcn.140200570
lea rdx, str.__sophos
lea rcx, [rbp - 0x19]
call fcn.1401fd8b0
mov rbx, rax
mov edx, dword [rax + 0xc]
lea rcx, [rbp - 0x19]
call fcn.1401ff260
movsxd r9, dword [rbx + 0xc]
mov eax, dword [rbp - 0x11]
inc eax
movsxd rdx, eax
mov r8, qword [rbx]
mov rcx, qword [rbp - 0x19]
call fcn.1402bd21c
mov edx, dword [rbx + 0xc]
lea rcx, [rbp - 0x19]
call fcn.140200570
mov r8d, 0xf003f
lea rdx, [0x140352350]
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rsi, rax
test rax, rax
jne 0x1401718f0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea r8, [0x14035a7d8]
lea rdx, str._ls___failed__error__d_
lea ecx, [rsi + 2]
call fcn.140170d40
jmp 0x140171a61
xor r14d, r14d
mov qword [rsp + 0x60], r14
mov qword [rsp + 0x58], r14
mov qword [rsp + 0x50], r14
mov qword [rsp + 0x48], r14
mov qword [rsp + 0x40], r14
mov rax, qword [rbp - 0x19]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 0x10
mov r9d, 0xf01ff
lea r8, str.Sophos_Clean_Service
lea rdx, str.Sophos_Clean_Service
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov rbx, rax
test rax, rax
jne 0x1401719a0
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
jne 0x14017197a
lea r8, str.Sophos_Clean_Service
lea rdx, str._ls_already_exists
lea ecx, [rbx + 1]
call fcn.140170d40
jmp 0x140171a55
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea r8, [0x14035a8f8]
lea rdx, str._ls___failed__error__d_
mov ecx, 2
call fcn.140170d40
jmp 0x140171a58
lea r8, str.Sophos_Clean_Service
lea rdx, str.Service__ls_installed
mov ecx, 1
call fcn.140170d40
lea rax, str.Provides_Sophos_Clean_control
mov qword [rbp - 9], rax
lea r8, [rbp - 9]
mov edx, 1
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x1401719e8
lea rdx, str.Failed_to_set_service_description
lea ecx, [rax + 2]
call fcn.140170d40
mov dword [rbp + 0x2f], 1
mov dword [rbp + 0x33], 0x1d4c0
mov dword [rbp + 0x37], 1
mov qword [rbp + 0x3b], 0x1d4c0
mov dword [rbp + 0x43], r14d
mov dword [rbp + 0x17], 3
mov dword [rbp - 1], 0x15180
mov qword [rbp + 0xf], r14
mov qword [rbp + 7], r14
lea rax, [rbp + 0x2f]
mov qword [rbp + 0x1f], rax
lea r8, [rbp - 1]
mov edx, 2
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x140171a4c
lea rdx, str.Failed_to_set_service_actions
lea ecx, [rax + 2]
call fcn.140170d40
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov dil, 1
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, qword [rbp - 0x19]
cmp dword [rbp - 0x11], 0
jle 0x140171a70
call fcn.1402b9c20
movzx eax, dil
mov rcx, qword [rbp + 0x47]
xor rcx, rsp
call fcn.1402b9610
lea r11, [rsp + 0xe0]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x18]
mov rdi, qword [r11 + 0x20]
mov r14, qword [r11 + 0x28]
mov rsp, r11
pop rbp
ret