Function at 0x140006320
Capabilities:
Create service
Delete service
Modify service
Persist via windows service
Start service
Stop service

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], rsi
push rbp
push rdi
push r14
lea rbp, [rsp - 0x430]
sub rsp, 0x530
mov rax, qword [0x14004e010]
xor rax, rsp
mov qword [rbp + 0x420], rax
mov r14, rdx
cmp ecx, 2
jne 0x1400065d1
mov rcx, qword [r14 + 8]
lea rdx, str.install
call qword [sym.imp.SHLWAPI.dll_StrCmpW]
xor ebx, ebx
lea rdi, str.AtherosSvc
test eax, eax
jne 0x1400064c3
xor edx, edx
mov qword [rsp + 0x550], r15
xor ecx, ecx
mov r8d, 0xf003f
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov rsi, rax
test rax, rax
je 0x1400064aa
xor edx, edx
lea rcx, [rbp + 0x210]
mov r8d, 0x208
call fcn.14001c4c0
xor edx, edx
lea rcx, [rbp - 0x40]
mov r8d, 0x208
call fcn.14001c4c0
mov r8d, 0x102
lea rdx, [rbp - 0x40]
xor ecx, ecx
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
lea r8, [0x14003c968]
mov edx, 0x104
lea rcx, [rbp + 0x210]
call fcn.1400223c4
lea r8, [rbp - 0x40]
mov edx, 0x104
lea rcx, [rbp + 0x210]
call fcn.14002242c
lea r8, [0x14003c968]
mov edx, 0x104
lea rcx, [rbp + 0x210]
call fcn.14002242c
lea rdx, [rbp + 0x210]
lea rcx, str.The_szFilename_is:__s_n
call fcn.14000e530
mov qword [rsp + 0x60], rbx
lea rax, [rbp + 0x210]
mov qword [rsp + 0x58], rbx
mov r9d, 0xf01ff
mov qword [rsp + 0x50], rbx
mov r8, rdi
mov qword [rsp + 0x48], rbx
mov rdx, rdi
mov qword [rsp + 0x40], rbx
mov rcx, rsi
mov qword [rsp + 0x38], rax
mov dword [rsp + 0x30], ebx
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 0x10
call qword [sym.imp.ADVAPI32.dll_CreateServiceW]
mov r15, rax
test rax, rax
jne 0x140006575
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str.Install_service_failed_error_code___d_n
lea ecx, [rbx + 1]
call fcn.14001a030
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, str.Fail_to_nstall_atheros_agent_service__n
mov ecx, 2
call fcn.14001a030
mov r15, qword [rsp + 0x550]
mov rcx, qword [r14 + 8]
lea rdx, str.uninstall
call qword [sym.imp.SHLWAPI.dll_StrCmpW]
test eax, eax
jne 0x1400066a4
xor eax, eax
xor edx, edx
xor ecx, ecx
mov qword [rbp - 0x68], rax
mov r8d, 0xf003f
mov qword [rbp - 0x60], rax
mov qword [rbp - 0x58], rax
mov dword [rbp - 0x50], eax
call qword [sym.imp.ADVAPI32.dll_OpenSCManagerW]
mov r8d, 0x104
lea rdx, [rbp - 0x40]
xor ecx, ecx
mov rsi, rax
call qword [sym.imp.KERNEL32.dll_GetModuleFileNameW]
mov r8d, 0xf01ff
mov rdx, rdi
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_OpenServiceW]
mov rdi, rax
test rax, rax
je 0x140006552
lea r8, [rbp - 0x68]
mov edx, 1
mov rcx, rax
call qword [sym.imp.ADVAPI32.dll_ControlService]
mov rcx, rdi
call qword [sym.imp.ADVAPI32.dll_DeleteService]
mov rcx, rdi
mov ebx, eax
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov ecx, 2
test ebx, ebx
je 0x1400065c0
lea rdx, str.Uninstall_atheros_agent_service_successfully__n
call fcn.14001a030
jmp 0x1400066a4
lea rax, str.Atheros_BT_Stack_Service_Agent
mov edx, 1
lea r8, [rsp + 0x70]
mov qword [rsp + 0x70], rax
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_ChangeServiceConfig2W]
xor r8d, r8d
xor edx, edx
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_StartServiceW]
mov rcx, r15
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
mov rcx, rsi
call qword [sym.imp.ADVAPI32.dll_CloseServiceHandle]
lea rdx, str.Install_atheros_agent_service_successfully__n
jmp 0x1400064b1
lea rdx, str.Fail_to_uninstall_atheros_agent_service__n
call fcn.14001a030
jmp 0x1400066a4
lea rcx, str.SetRegInfHwId_Enter___n
call fcn.14000e530
lea rdx, [rbp - 0x40]
lea rcx, str.C:WindowsSystem32DriverStoreFileRepository_btfilter.inf_
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
lea rdx, [rbp - 0x40]
mov rbx, rax
lea rcx, str.C:WindowsSystem32DriverStoreFileRepository_atheros_bth.inf_
call qword [sym.imp.KERNEL32.dll_FindFirstFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
je 0x1400066cd
lea rcx, str.SetRegInfHwId__found_path_n
call fcn.14000e530
cmp rbx, 0xffffffffffffffff
je 0x140006636
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_FindClose]
lea rcx, str.SetRegInfHwId__close_hFind1_n
call fcn.14000e530
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_FindClose]
lea rcx, str.SetRegInfHwId__close_hFind2_n
call fcn.14000e530
lea rcx, str.SetRegInfHwId_Leave___n
call fcn.14000e530
call fcn.1400015f0
lea rax, [0x140005f20]
xor ebx, ebx
lea rdi, str.AtherosSvc
mov qword [rbp - 0x80], rax
lea rcx, [rsp + 0x78]
mov qword [rsp + 0x78], rdi
mov qword [rbp - 0x78], rbx
mov qword [rbp - 0x70], rbx
call qword [sym.imp.ADVAPI32.dll_StartServiceCtrlDispatcherW]
test eax, eax
jne 0x1400066a4
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
lea rdx, str.Fail_to_bind_atheros_service_agent_with_SCM__error___d_n
lea ecx, [rbx + 1]
call fcn.14001a030
xor eax, eax
mov rcx, qword [rbp + 0x420]
xor rcx, rsp
call fcn.14001a550
lea r11, [rsp + 0x530]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rsp, r11
pop r14
pop rdi
pop rbp
ret
lea rcx, str.SetRegInfHwId__didnt_find_path_n
call fcn.14000e530
call fcn.1400010a0
int3