Function at 0x140116bc0
Capabilities:
Create service
Delete service
Modify service
Persist via windows service
Stop service

Disassembly:
mov rax, rsp
push rdi
sub rsp, 0xc0
mov qword [rax - 0x40], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov rax, qword [0x140415a10]
xor rax, rsp
mov qword [rsp + 0xb0], rax
movzx edi, cl
xor bl, bl
mov r8d, 0xf003f
lea rdx, [0x1403503b0]
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rsi, rax
test rax, rax
je 0x140116e12
test dil, dil
je 0x140116d6c
lea rcx, [rsp + 0x70]
call fcn.1401169e0
nop
mov r8, qword [rsp + 0x70]
lea rdx, [0x14034e458]
lea rcx, [rsp + 0x90]
call fcn.1401fcfe0
nop
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x140116d3a
or rax, 0xffffffffffffffff
inc rax
cmp word [rcx + rax*2], 0
jne 0x140116c53
test rax, rax
je 0x140116d3a
mov edx, 0x133
xor ecx, ecx
lea r8d, [rcx + 0xa]
call qword [sym.imp.KERNEL32.dll_FindResourceW]
test rax, rax
je 0x140116c89
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.1401168e0
xor eax, eax
mov qword [rsp + 0x60], rax
mov qword [rsp + 0x58], rax
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x48], rax
lea rax, [0x140350ba0]
mov qword [rsp + 0x40], rax
mov rax, qword [rsp + 0x90]
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, [0x140350c30]
lea rdx, [0x140350b78]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov rdi, rax
test rax, rax
jne 0x140116d0a
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
je 0x140116d38
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x140116d3a
lea rax, [0x140350bd0]
mov qword [rsp + 0x80], rax
lea r8, [rsp + 0x80]
mov edx, 1
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov bl, 1
cmp dword [rsp + 0x98], 0
jle 0x140116d52
mov rcx, qword [rsp + 0x90]
call fcn.1402b7350
nop
cmp dword [rsp + 0x78], 0
jle 0x140116e09
mov rcx, qword [rsp + 0x70]
call fcn.1402b7350
jmp 0x140116e09
mov r8d, 0x10020
lea rdx, [0x140350b78]
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rdi, rax
test rax, rax
jne 0x140116d9b
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x424
jne 0x140116ddb
mov bl, 1
jmp 0x140116ddb
lea r8, [rsp + 0x90]
mov edx, 1
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x140116dbb
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
je 0x140116dcc
mov bl, 1
jmp 0x140116dd2
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea r8, [0x140350ac0]
xor edx, edx
mov ecx, 0x100002
call qword [sym.imp.KERNEL32.dll_OpenEventW]
mov rdi, rax
test rax, rax
je 0x140116e09
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_SetEvent]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
movzx eax, bl
mov rcx, qword [rsp + 0xb0]
xor rcx, rsp
call fcn.1402b6d40
lea r11, [rsp + 0xc0]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x18]
mov rsp, r11
pop rdi
ret