Function at 0x140008560
Capabilities:
Create service
Persist via windows service
Start service

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r15
lea rbp, [rsp - 0x200]
sub rsp, 0x300
mov rax, qword [section..data]
xor rax, rsp
mov qword [rbp + 0x1f0], rax
mov rsi, r8
mov r15, rdx
mov rdi, rcx
xor edx, edx
mov r8d, 0x208
lea rcx, [rbp - 0x20]
call sub.VCRUNTIME140.dll_memset
xor r9d, r9d
lea r8, [rbp - 0x20]
mov edx, 0x104
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_GetFullPathNameW]
test eax, eax
jne 0x1400085da
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8, rsi
lea rcx, str.___Error_0x_lx_converting__s_path_to_absolute_..._n
mov edx, eax
mov ebx, eax
call fcn.140001480
mov eax, ebx
jmp 0x1400088ca
mov r8d, 3
mov qword [rsp + 0x348], r14
lea rdx, str.ServicesActive
xor ecx, ecx
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov r14, rax
test rax, rax
je 0x1400088a8
mov r8d, 0x10
mov rdx, rdi
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rsi, rax
test rax, rax
je 0x140008631
mov rdx, rdi
lea rcx, str.____s_service_already_registered_n
call fcn.140001480
jmp 0x14000881c
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x424
jne 0x140008887
mov rdx, rdi
lea rcx, str.____s_service_was_not_present_n
call fcn.140001480
xor ebx, ebx
lea rax, [rbp - 0x20]
mov qword [rsp + 0x60], rbx
mov r9d, 0x60010
mov qword [rsp + 0x58], rbx
mov r8, r15
mov qword [rsp + 0x50], rbx
mov rdx, rdi
mov qword [rsp + 0x48], rbx
mov rcx, r14
mov qword [rsp + 0x40], rbx
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 1
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov rsi, rax
test rax, rax
je 0x140008878
mov rdx, rdi
lea rcx, str.____s_service_is_successfully_registered_n
call fcn.140001480
lea rax, [rsp + 0x70]
mov dword [rbp - 0x50], ebx
xor r9d, r9d
mov qword [rsp + 0x20], rax
lea r8, [rbp - 0x48]
mov word [rbp - 0x4c], pe_nt_image_headers64
lea edx, [rbx + 4]
mov dword [rbp - 0x80], 0x201fd
mov rcx, rsi
mov qword [rbp - 0x7c], 2
mov qword [rbp - 0x70], rbx
mov qword [rbp - 0x68], rbx
mov dword [rbp - 0x60], 5
mov qword [rbp - 0x58], rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceObjectSecurity]
test eax, eax
jne 0x140008810
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7a
jne 0x140008810
mov edx, dword [rsp + 0x70]
lea ecx, [rbx + 0x40]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov r15, rax
test rax, rax
je 0x140008810
mov r9d, dword [rsp + 0x70]
lea rax, [rsp + 0x70]
mov r8, r15
mov qword [rsp + 0x20], rax
lea edx, [rbx + 4]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_QueryServiceObjectSecurity]
test eax, eax
je 0x1400087f2
lea rax, [rbp - 0x58]
xor r9d, r9d
mov qword [rsp + 0x50], rax
lea rcx, [rbp - 0x50]
mov dword [rsp + 0x48], ebx
xor r8d, r8d
mov dword [rsp + 0x40], ebx
mov dl, 1
mov dword [rsp + 0x38], ebx
mov dword [rsp + 0x30], ebx
mov dword [rsp + 0x28], ebx
mov dword [rsp + 0x20], ebx
call qword [sym.imp.ADVAPI32.dll_AllocateAndInitializeSid]
test eax, eax
je 0x1400087f2
lea rax, [rsp + 0x78]
xor edx, edx
mov qword [rsp + 0x40], rax
lea r9, [rbp - 0x80]
lea rax, [rsp + 0x70]
xor ecx, ecx
mov qword [rsp + 0x38], rax
lea r8d, [rbx + 1]
mov qword [rsp + 0x30], r15
mov qword [rsp + 0x28], rbx
mov dword [rsp + 0x20], ebx
call qword [sym.imp.ADVAPI32.dll_BuildSecurityDescriptorW]
test eax, eax
jne 0x1400087e8
mov r8, qword [rsp + 0x78]
lea edx, [rbx + 4]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_SetServiceObjectSecurity]
mov rcx, qword [rsp + 0x78]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rbp - 0x58]
call qword [sym.imp.ADVAPI32.dll_FreeSid]
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_LocalFree]
test ebx, ebx
je 0x140008810
mov rdx, rdi
lea rcx, str.____s_service_ACL_configured_to_for_Everyone_n
call fcn.140001480
jmp 0x14000881c
lea rcx, str.____ServiceAddEveryoneAccess
call sub.api_ms_win_crt_stdio_l1_1_0.dll__putws
xor r8d, r8d
xor edx, edx
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
test eax, eax
je 0x140008837
lea rcx, str.____s_service_started_n
jmp 0x14000884b
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x420
jne 0x140008869
lea rcx, str.____s_service_already_started_n
mov rdx, rdi
call fcn.140001480
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
jmp 0x1400088c2
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.____ERROR_ServiceInstall___StartService__0x_08x__n
jmp 0x1400088b5
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.____ERROR_ServiceInstall___CreateService__0x_08x__n
jmp 0x140008894
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.____ERROR_ServiceInstall___OpenService__0x_08x__n
mov edx, eax
call fcn.140001480
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
xor eax, eax
jmp 0x1400088c2
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.____ERROR_ServiceInstall___OpenSCManager_create___0x_08x__n
mov edx, eax
call fcn.140001480
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r14, qword [rsp + 0x348]
mov rcx, qword [rbp + 0x1f0]
xor rcx, rsp
call fcn.140009ae0
add rsp, 0x300
pop r15
pop rdi
pop rsi
pop rbx
pop rbp
ret