Function at 0x140117e40
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 [0x140418a10]
xor rax, rsp
mov qword [rsp + 0xb0], rax
movzx edi, cl
xor bl, bl
mov r8d, 0xf003f
lea rdx, [0x140352350]
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rsi, rax
test rax, rax
je 0x140118092
test dil, dil
je 0x140117fec
lea rcx, [rsp + 0x70]
call fcn.140117c60
nop
mov r8, qword [rsp + 0x70]
lea rdx, [0x140350428]
lea rcx, [rsp + 0x90]
call fcn.1401ff700
nop
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x140117fba
or rax, 0xffffffffffffffff
inc rax
cmp word [rcx + rax*2], 0
jne 0x140117ed3
test rax, rax
je 0x140117fba
mov edx, 0x133
xor ecx, ecx
lea r8d, [rcx + 0xa]
call qword [sym.imp.KERNEL32.dll_FindResourceW]
test rax, rax
je 0x140117f09
mov rdx, rax
lea rcx, [rsp + 0x70]
call fcn.140117b60
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, [0x140352bf0]
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, [0x140352bc8]
lea rdx, [0x140352b28]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov rdi, rax
test rax, rax
jne 0x140117f8a
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
je 0x140117fb8
call qword [sym.imp.KERNEL32.dll_GetLastError]
jmp 0x140117fba
lea rax, [0x140352c50]
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 0x140117fd2
mov rcx, qword [rsp + 0x90]
call fcn.1402b9c20
nop
cmp dword [rsp + 0x78], 0
jle 0x140118089
mov rcx, qword [rsp + 0x70]
call fcn.1402b9c20
jmp 0x140118089
mov r8d, 0x10020
lea rdx, [0x140352b28]
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rdi, rax
test rax, rax
jne 0x14011801b
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x424
jne 0x14011805b
mov bl, 1
jmp 0x14011805b
lea r8, [rsp + 0x90]
mov edx, 1
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_ControlService]
test eax, eax
jne 0x14011803b
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_DeleteService]
test eax, eax
je 0x14011804c
mov bl, 1
jmp 0x140118052
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea r8, [0x140352b50]
xor edx, edx
mov ecx, 0x100002
call qword [sym.imp.KERNEL32.dll_OpenEventW]
mov rdi, rax
test rax, rax
je 0x140118089
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.1402b9610
lea r11, [rsp + 0xc0]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x18]
mov rsp, r11
pop rdi
ret