Function at 0x1400037f8
Capabilities:
Create service
Modify service

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov qword [rax + 0x20], r14
push rbp
lea rbp, [rax - 0x5f]
sub rsp, 0xb0
mov rax, qword [0x14001f080]
xor rax, rsp
mov qword [rbp + 0x4f], rax
call fcn.140003a18
xor edx, edx
xor ecx, ecx
lea r8d, [rdx + 2]
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rdi, rax
mov qword [rbp + 0x47], rax
test rax, rax
jne 0x14000385d
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
jmp 0x1400039de
xor eax, eax
mov qword [rbp + 0x3f], rax
xorps xmm1, xmm1
movdqu xmmword [rbp + 0x2f], xmm1
and qword [rbp + 0x3f], rax
lea rdx, [rbp + 0x2f]
xor ecx, ecx
call fcn.14000bc18
mov esi, eax
mov r14, qword [rbp + 0x2f]
test eax, eax
js 0x14000399a
and qword [rsp + 0x60], 0
and qword [rsp + 0x58], 0
and qword [rsp + 0x50], 0
and qword [rsp + 0x48], 0
and qword [rsp + 0x40], 0
mov qword [rsp + 0x38], r14
and dword [rsp + 0x30], 0
mov dword [rsp + 0x28], 3
mov dword [rsp + 0x20], 0x10
mov r9d, 0xf01ff
lea r8, str.Visual_Studio_Standard_Collector_Service
lea rdx, str.VsStandardCollectorService170
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov rbx, rax
test rax, rax
je 0x14000396e
and dword [rbp + 0x27], 0
and dword [rbp + 0x2b], 0
lea rax, [rbp + 0x2b]
mov qword [rsp + 0x20], rax
mov r9d, 4
lea r8, [rbp + 0x27]
lea edx, [r9 + 1]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_QueryServiceConfig2W]
test eax, eax
je 0x14000396e
mov esi, 1
mov dword [rbp + 0x27], esi
lea r8, [rbp + 0x27]
lea edx, [rsi + 4]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
je 0x14000396e
lea rax, str.SeImpersonatePrivilege
mov qword [rbp + 0x17], rax
lea r8, [rbp + 0x17]
lea edx, [rsi + 5]
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
je 0x14000396e
lea rax, str.Visual_Studio_Data_Collection_Service._When_running__this_service_collects_real_time_ETW_events_and_processes_them.
mov qword [rbp + 0x1f], rax
lea r8, [rbp + 0x1f]
mov edx, esi
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
test eax, eax
jne 0x140003989
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx esi, ax
or esi, 0x80070000
test eax, eax
cmovle esi, eax
test rbx, rbx
je 0x14000399a
jmp 0x140003990
call fcn.140003b08
xor esi, esi
mov rcx, rbx
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
nop
test r14, r14
je 0x1400039de
mov rax, qword [rbp + 0x3f]
sub rax, r14
sar rax, 1
lea rdx, [rax + rax]
mov rax, r14
cmp rdx, 0x1000
jb 0x1400039d5
add rdx, 0x27
mov r14, qword [r14 - 8]
sub rax, r14
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400039d5
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
mov rcx, r14
call fcn.14001269c
nop
test rdi, rdi
je 0x1400039ec
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov eax, esi
mov rcx, qword [rbp + 0x4f]
xor rcx, rsp
call fcn.140012650
lea r11, [rsp + 0xb0]
mov rbx, qword [r11 + 0x10]
mov rsi, qword [r11 + 0x18]
mov rdi, qword [r11 + 0x20]
mov r14, qword [r11 + 0x28]
mov rsp, r11
pop rbp
ret