Function at 0x14001643c
Capabilities:
Create service
Modify service
Persist via windows service
Start service

Disassembly:
mov rax, rsp
push rbp
push r12
push r13
push r14
push r15
lea rbp, [rax - 0x9f8]
sub rsp, 0xad0
mov qword [rsp + 0x78], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
mov rax, qword [0x14009f1b0]
xor rax, rsp
mov qword [rbp + 0x9c0], rax
mov rsi, rcx
xor r12d, r12d
mov edi, r12d
mov r14d, 0xf003f
mov r8d, r14d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
nop
mov rbx, rax
lea r13d, [r12 + 1]
test rax, rax
je 0x1400164de
mov r8d, r13d
mov rdx, rsi
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
nop
test rax, rax
je 0x1400164c8
mov edi, r13d
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
nop
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
nop
test edi, edi
je 0x1400164de
mov eax, r13d
jmp 0x1400165e4
mov ebx, 0x104
mov r8d, ebx
lea rdx, [rbp - 0x4e]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
nop
test eax, eax
je 0x1400165e2
cmp eax, ebx
je 0x1400165e2
mov r15d, 0x22
mov word [rbp - 0x50], r15w
lea ecx, [rax + 1]
mov word [rbp + rcx*2 - 0x50], r15w
lea ecx, [rax + 2]
add rcx, rcx
cmp rcx, 0x20c
jae 0x140016846
mov word [rbp + rcx - 0x50], r12w
mov r8d, r14d
xor edx, edx
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
nop
mov r14, rax
test rax, rax
jne 0x140016615
xor edx, edx
lea rcx, [0x1400a32a0]
call fcn.14002e094
nop
mov edi, r12d
mov esi, r13d
mov ebx, 0x400
test rax, rax
je 0x1400165a3
test edi, edi
jne 0x1400165e2
mov r9d, ebx
lea r8, [rbp + 0x1c0]
mov edx, 0xd80a
mov rcx, rax
call qword [sym.imp.USER32.dll_LoadStringW]
nop
mov edi, eax
mov edx, esi
add esi, r13d
lea rcx, [0x1400a32a0]
call fcn.14002e094
nop
test rax, rax
jne 0x140016569
test edi, edi
jne 0x1400165e2
lea r8, str.Could_not_open_Service_Manager
mov rdx, rbx
lea rcx, [rbp + 0x1c0]
call fcn.140059924
nop
test eax, eax
je 0x1400165e2
cmp eax, 0xc
je 0x14001686d
cmp eax, 0x16
je 0x140016862
cmp eax, r15d
je 0x140016862
cmp eax, 0x50
jne 0x140016857
xor eax, eax
mov rcx, qword [rbp + 0x9c0]
xor rcx, rsp
call fcn.14004b030
nop
lea r11, [rsp + 0xad0]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rdi, qword [r11 + 0x48]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
lea rbx, [rsi + 0x200]
mov qword [rsp + 0x60], r12
mov qword [rsp + 0x58], r12
lea rax, str.RPCSS
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x48], r12
mov qword [rsp + 0x40], r12
lea rax, [rbp - 0x50]
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], r13d
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 0x10
mov r9d, 0xf01ff
mov r8, rbx
mov rdx, rsi
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
nop
mov r15, rax
test rax, rax
jne 0x14001672f
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
nop
xor edx, edx
lea rcx, [0x1400a32a0]
call fcn.14002e094
nop
mov edi, r12d
mov esi, r13d
mov ebx, 0x400
test rax, rax
je 0x1400166e7
test edi, edi
jne 0x1400165e2
mov r9d, ebx
lea r8, [rbp + 0x1c0]
mov edx, 0xd80b
mov rcx, rax
call qword [sym.imp.USER32.dll_LoadStringW]
nop
mov edi, eax
mov edx, esi
add esi, r13d
lea rcx, [0x1400a32a0]
call fcn.14002e094
nop
test rax, rax
jne 0x1400166a5
test edi, edi
jne 0x1400165e2
lea r8, str.Could_not_start_service
mov rdx, rbx
lea rcx, [rbp + 0x1c0]
call fcn.140059924
nop
test eax, eax
je 0x1400165e2
cmp eax, 0xc
je 0x140016883
cmp eax, 0x16
je 0x140016878
cmp eax, 0x22
je 0x140016878
cmp eax, 0x50
jne 0x14001684c
jmp 0x1400165e2
mov qword [rbp - 0x78], r12
mov qword [rbp - 0x70], r12
mov qword [rbp - 0x68], r12
or rax, 0xffffffffffffffff
inc rax
cmp word [rbx + rax*2], r12w
jne 0x14001673f
add rax, 0x100
lea r8, [rsi + rax*2]
mov rdx, rbx
lea rcx, [rbp - 0x78]
call fcn.140022138
nop
mov word [rsp + 0x70], r12w
mov rbx, qword [rbp - 0x68]
mov rdx, qword [rbp - 0x70]
cmp rbx, rdx
je 0x140016779
mov word [rdx], r12w
jmp 0x14001678c
lea r8, [rsp + 0x70]
lea rcx, [rbp - 0x78]
call fcn.14001cf58
nop
mov rbx, qword [rbp - 0x68]
mov rdi, qword [rbp - 0x78]
mov qword [rbp - 0x80], rdi
lea r8, [rbp - 0x80]
mov edx, r13d
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
nop
xor r8d, r8d
xor edx, edx
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
nop
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
nop
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
nop
mov dword [rsi + 0x424], r13d
mov qword [rbp - 0x78], rsi
lea rax, [0x14001372c]
mov qword [rbp - 0x70], rax
mov qword [rbp - 0x68], r12
mov qword [rbp - 0x60], r12
lea rcx, [rbp - 0x78]
call qword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
nop
test eax, eax
jne 0x140016802
call qword [sym.imp.KERNEL32.dll_GetLastError]
nop
mov dword [rsi + 0x414], eax
test rdi, rdi
je 0x1400164d6
sub rbx, rdi
sar rbx, 1
add rbx, rbx
mov rax, rdi
cmp rbx, 0x1000
jb 0x140016835
add rbx, 0x27
mov rdi, qword [rdi - 8]
sub rax, rdi
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x14001688e
mov rdx, rbx
mov rcx, rdi
call fcn.14004b054
nop
jmp 0x1400164d6
call fcn.14004b484
nop
mov ecx, 0x80004005
call fcn.140002500
nop
mov ecx, 0x80004005
call fcn.140002500
nop
mov ecx, 0x80070057
call fcn.140002500
nop
mov ecx, 0x8007000e
call fcn.140002500
nop
mov ecx, 0x80070057
call fcn.140002500
nop
mov ecx, 0x8007000e
call fcn.140002500
nop
call fcn.14005adc4
nop