Function at 0x140008014
Capabilities:
Create service
Persist via windows service
Set registry value

Disassembly:
mov qword [rsp + 8], rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0xab0
mov rbp, rcx
lea rcx, str.Registering_Service...
call fcn.1400065e4
lea rdx, str.:service.id
mov rcx, rbp
call fcn.140004cb4
test rax, rax
mov qword [0x14002b420], rax
jne 0x14000806b
lea rcx, str.Service_ID_not_specified
call fcn.1400069fc
mov eax, 1
jmp 0x140008404
lea rdx, str.:service.name
mov rcx, rbp
call fcn.140004cb4
test rax, rax
mov qword [rsp + 0xb00], rax
jne 0x140008090
lea rcx, str.Service_name_not_specified
jmp 0x14000805c
lea rdx, str.:service.description
mov rcx, rbp
call fcn.140004cb4
test rax, rax
mov r15, rax
jne 0x1400080b0
lea rcx, str.Service_description_not_specified
jmp 0x14000805c
lea rdx, str.:service.startup
mov rcx, rbp
mov esi, 3
call fcn.140004cb4
lea ebx, [rsi - 2]
test rax, rax
mov rdi, rax
je 0x14000817d
lea rdx, str.auto
mov rcx, rax
call fcn.14000b950
test eax, eax
jne 0x1400080f2
lea esi, [rbx + 1]
lea rcx, str.Service_startup_mode:_SERVICE_AUTO_START
jmp 0x140008167
lea rdx, str.boot
mov rcx, rdi
call fcn.14000b950
test eax, eax
jne 0x140008110
xor esi, esi
lea rcx, str.Service_startup_mode:_SERVICE_BOOT_START
jmp 0x140008167
lea rdx, str.demand
mov rcx, rdi
call fcn.14000b950
test eax, eax
jne 0x14000812c
lea rcx, str.Service_startup_mode:_SERVICE_DEMAND_START
jmp 0x140008167
lea rdx, str.disabled
mov rcx, rdi
call fcn.14000b950
test eax, eax
jne 0x14000814b
lea esi, [rax + 4]
lea rcx, str.Service_startup_mode:_SERVICE_DISABLED
jmp 0x140008167
lea rdx, str.system
mov rcx, rdi
call fcn.14000b950
test eax, eax
jne 0x14000816e
mov esi, ebx
lea rcx, str.Service_startup_mode:_SERVICE_SYSTEM_START
call fcn.1400065e4
jmp 0x14000817d
lea rcx, str.Unrecognized_service_startup_mode:__s
mov rdx, rdi
call fcn.1400069bc
and dword [rsp + 0xaf8], 0
lea r9, [rsp + 0xaf8]
lea r8, [rsp + 0x290]
lea rdx, str.:service.dependency
mov rcx, rbp
mov dword [rsp + 0x20], 0xa
call fcn.14000501c
xor edi, edi
xor r13d, r13d
xor r14d, r14d
cmp dword [rsp + 0xaf8], edi
jbe 0x1400081e3
lea r12, [rsp + 0x290]
mov rcx, qword [r12]
call fcn.14000ba10
add r14d, ebx
add r12, 8
cmp r14d, dword [rsp + 0xaf8]
lea edi, [rdi + rax + 1]
jb 0x1400081c5
add edi, ebx
test edi, edi
jle 0x140008252
movsxd rcx, edi
call fcn.14000bb10
test rax, rax
mov r13, rax
jne 0x14000820c
lea rcx, str.Could_not_create_dependency_list
call fcn.1400069fc
mov eax, ebx
jmp 0x140008404
xor r14d, r14d
mov rdi, rax
cmp dword [rsp + 0xaf8], r14d
jbe 0x14000824f
lea r12, [rsp + 0x290]
mov rdx, qword [r12]
mov rcx, rdi
call fcn.14000b880
mov rcx, qword [r12]
call fcn.14000ba10
add r14d, ebx
add r12, 8
cmp r14d, dword [rsp + 0xaf8]
lea rdi, [rdi + rax + 1]
jb 0x140008224
mov byte [rdi], 0
lea rdx, str.:service.loadordergroup
mov rcx, rbp
call fcn.140004cb4
lea rdx, str.:service.user
mov rcx, rbp
mov r12, rax
call fcn.140004cb4
lea rdx, str.:service.password
mov rcx, rbp
mov r14, rax
call fcn.140004cb4
lea rdx, [rsp + 0x70]
mov r8d, 0x104
xor ecx, ecx
mov byte [rsp + 0x180], 0x22
mov byte [rsp + 0x181], 0
mov rbp, rax
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameA]
lea rdx, [rsp + 0x70]
lea rcx, [rsp + 0x180]
call fcn.14000b7e0
lea rdx, [0x140021da8]
lea rcx, [rsp + 0x180]
call fcn.14000b7e0
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 2]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerA]
test rax, rax
mov rdi, rax
jne 0x140008302
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.Could_not_access_service_manager:__d
mov ebx, eax
mov edx, eax
call fcn.1400069fc
jmp 0x140008205
mov r8, qword [rsp + 0xb00]
mov rdx, qword [0x14002b420]
mov qword [rsp + 0x60], rbp
mov qword [rsp + 0x58], r14
mov qword [rsp + 0x50], r13
and qword [rsp + 0x48], 0
mov qword [rsp + 0x40], r12
lea rax, [rsp + 0x180]
mov r9d, 0xf01ff
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], ebx
mov rcx, rdi
mov dword [rsp + 0x28], esi
mov dword [rsp + 0x20], 0x10
call qword [sym.imp.ADVAPI32.dll_CreateServiceA]
test rax, rax
jne 0x140008388
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x431
mov ebx, eax
jne 0x14000837c
lea rcx, str.Service_already_exists
call fcn.1400069bc
jmp 0x140008205
lea rcx, str.Could_not_create_service:__d
jmp 0x1400082f6
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, str.SystemCurrentControlSetServices_
lea rcx, [rsp + 0x70]
call fcn.14000b880
mov rdx, qword [0x14002b420]
lea rcx, [rsp + 0x70]
call fcn.14000b7e0
lea r8, [rsp + 0xb08]
lea rdx, [rsp + 0x70]
mov rcx, 0xffffffff80000002
call qword [sym.imp.ADVAPI32.dll_RegOpenKeyA]
mov rcx, r15
call fcn.14000ba10
mov rcx, qword [rsp + 0xb08]
lea rdx, str.Description
mov dword [rsp + 0x28], eax
mov r9d, ebx
xor r8d, r8d
mov qword [rsp + 0x20], r15
call qword [sym.imp.ADVAPI32.dll_RegSetValueExA]
xor eax, eax
mov rbx, qword [rsp + 0xaf0]
add rsp, 0xab0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret