Function at 0x140006330
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 - 0x238]
sub rsp, 0x310
mov qword [rbp - 0x30], 0xfffffffffffffffe
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rsi
mov qword [rax + 0x18], rdi
mov rax, qword [0x14008f088]
xor rax, rsp
mov qword [rbp + 0x200], rax
xor r13d, r13d
mov dword [rsp + 0x70], r13d
lea rcx, str.Install_service_entry
call fcn.140010f80
lea r9, [0x140090270]
lea r8d, [r13 + 0x72]
lea rdx, str.InstallService
lea rcx, str.__hs_____d_:_____s
call fcn.140011770
xor edx, edx
xor ecx, ecx
lea r8d, [r13 + 2]
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_OpenSCManagerW]
mov qword [rbp - 0x70], rax
test rax, rax
je 0x14000681d
xor edx, edx
mov r8d, 0x20a
lea rcx, [rbp - 0x10]
call fcn.14001ead0
mov r8d, 0x105
lea rdx, [rbp - 0x10]
xor ecx, ecx
call qword [sym.imp.api_ms_win_core_libraryloader_l1_2_0.dll_GetModuleFileNameW]
test eax, eax
je 0x14000680e
call fcn.140002de0
mov rcx, rax
test rax, rax
je 0x14000688c
mov rax, qword [rax]
call qword [rax + 0x18]
add rax, 0x18
mov qword [rsp + 0x78], rax
lea rax, [rbp - 0x10]
lea r15, [r13 - 1]
cmp rax, 0x10000
jae 0x14000642a
lea rax, [rbp - 0x10]
movzx edx, ax
lea rcx, [rsp + 0x78]
call fcn.140002fb0
jmp 0x14000644d
lea rcx, [rbp - 0x10]
mov rax, r15
inc rax
cmp word [rcx + rax*2], 0
jne 0x140006431
mov r8d, eax
lea rdx, [rbp - 0x10]
lea rcx, [rsp + 0x78]
call fcn.140005cc0
nop
mov rdi, qword [rsp + 0x78]
lea rax, [rdi - 0x18]
mov qword [rbp - 0x68], rax
mov rcx, qword [rdi - 0x18]
test rcx, rcx
je 0x140006471
mov rax, qword [rcx]
call qword [rax + 0x20]
mov rcx, rax
test rax, rax
jne 0x140006482
call fcn.140002de0
mov rdx, qword [rax]
mov rcx, rax
call qword [rdx + 0x20]
mov rcx, rax
test rcx, rcx
je 0x140006897
mov rax, qword [rcx]
call qword [rax + 0x18]
lea rbx, [rax + 0x18]
mov qword [rbp - 0x78], rbx
mov dword [rsp + 0x70], 1
movsxd r12, dword [rdi - 0x10]
lea rdx, [0x14006fbe0]
mov rsi, r15
nop
inc rsi
cmp word [rdx + rsi*2], 0
jne 0x1400064b0
lea r14d, [rsi + r12]
test r14d, r14d
js 0x1400068a2
mov ecx, 1
sub ecx, dword [rbx - 8]
mov eax, dword [rbx - 0xc]
sub eax, r14d
or eax, ecx
jge 0x1400064f0
mov edx, r14d
lea rcx, [rbp - 0x78]
call fcn.140003ce0
mov rbx, qword [rbp - 0x78]
lea rdx, [0x14006fbe0]
movsxd rax, esi
lea rsi, [rax + rax]
test rsi, rsi
je 0x14000651e
test rbx, rbx
jne 0x140006513
call fcn.14002a3b0
mov dword [rax], 0x16
call fcn.14002a204
jmp 0x14000651e
mov r8, rsi
mov rcx, rbx
call fcn.14001e660
mov rdx, r12
add rdx, rdx
lea rcx, [rsi + rbx]
mov r9, rdx
mov r8, rdi
call fcn.140007fe0
cmp r14d, dword [rbx - 0xc]
jg 0x140006881
mov dword [rbx - 0x10], r14d
movsxd rax, r14d
mov word [rbx + rax*2], r13w
mov rcx, qword [rbx - 0x18]
test rcx, rcx
je 0x140006560
mov rax, qword [rcx]
call qword [rax + 0x20]
mov rcx, rax
test rax, rax
jne 0x140006571
call fcn.140002de0
mov rdx, qword [rax]
mov rcx, rax
call qword [rdx + 0x20]
mov rcx, rax
test rcx, rcx
je 0x1400068ad
mov rax, qword [rcx]
call qword [rax + 0x18]
lea rdi, [rax + 0x18]
mov qword [rbp - 0x80], rdi
mov dword [rsp + 0x70], 3
mov r14, r15
lea rax, [0x14006fbe0]
nop word [rax + rax]
inc r14
cmp word [rax + r14*2], 0
jne 0x1400065a0
movsxd rsi, dword [rbx - 0x10]
lea r12d, [rsi + r14]
test r12d, r12d
js 0x1400068b8
mov ecx, 1
sub ecx, dword [rdi - 8]
mov eax, dword [rdi - 0xc]
sub eax, r12d
or eax, ecx
jge 0x1400065de
mov edx, r12d
lea rcx, [rbp - 0x80]
call fcn.140003ce0
mov rdi, qword [rbp - 0x80]
add rsi, rsi
mov r9, rsi
mov r8, rbx
mov rdx, rsi
mov rcx, rdi
call fcn.140007fe0
lea rcx, [rsi + rdi]
movsxd r8, r14d
add r8, r8
je 0x140006621
test rcx, rcx
jne 0x140006615
call fcn.14002a3b0
mov dword [rax], 0x16
call fcn.14002a204
jmp 0x140006621
lea rdx, [0x14006fbe0]
call fcn.14001e660
cmp r12d, dword [rdi - 0xc]
jg 0x1400068c3
mov dword [rdi - 0x10], r12d
movsxd rax, r12d
xor r14d, r14d
mov word [rdi + rax*2], r14w
mov dword [rsp + 0x70], 2
mov eax, r15d
lock xadd dword [rbx - 8], eax
sub eax, 1
jg 0x14000665e
mov rcx, qword [rbx - 0x18]
mov rax, qword [rcx]
lea rdx, [rbx - 0x18]
call qword [rax + 8]
nop
mov eax, r15d
mov rdx, qword [rbp - 0x68]
lock xadd dword [rdx + 0x10], eax
sub eax, 1
jg 0x140006678
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
mov qword [rsp + 0x60], r14
mov qword [rsp + 0x58], r14
mov qword [rsp + 0x50], r14
mov qword [rsp + 0x48], r14
mov qword [rsp + 0x40], r14
mov rbx, qword [rbp - 0x80]
mov qword [rsp + 0x38], rbx
mov dword [rsp + 0x30], 1
mov dword [rsp + 0x28], 2
mov dword [rsp + 0x20], 0x10
mov r9d, 0xf01ff
mov r8, qword [str.Bluetooth_Device_Manager_Service]
mov rdx, qword [str.RtkBtManServ]
mov rsi, qword [rbp - 0x70]
mov rcx, rsi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CreateServiceW]
mov rdi, rax
test rax, rax
je 0x1400067b5
mov rcx, qword [str.Handles_installation_and_removal_of_Bluetooth_devices._n]
mov qword [rbp - 0x60], rcx
lea r8, [rbp - 0x60]
mov edx, 1
mov rcx, rax
call qword [sym.imp.api_ms_win_service_management_l2_1_0.dll_ChangeServiceConfig2W]
mov qword [rbp - 0x58], r14
mov qword [rbp - 0x40], 3
mov dword [rbp - 0x28], 1
mov dword [rbp - 0x24], 0x1388
mov dword [rbp - 0x20], 1
mov qword [rbp - 0x1c], 0x1388
mov dword [rbp - 0x14], 0x1388
mov qword [rbp - 0x50], r14
lea rax, [rbp - 0x28]
mov qword [rbp - 0x38], rax
mov qword [rbp - 0x48], r14
lea r8, [rbp - 0x58]
mov edx, 2
mov rcx, rdi
call qword [sym.imp.api_ms_win_service_management_l2_1_0.dll_ChangeServiceConfig2W]
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edx, eax
lea rcx, str.ChangeServiceConfig2_ret:__d
call fcn.140010f80
lea r9, [0x140090270]
mov r8d, 0x9c
lea rdx, str.InstallService
lea rcx, str.__hs_____d_:_____s
call fcn.140011770
xor r8d, r8d
xor edx, edx
mov rcx, rdi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_StartServiceW]
mov rcx, rdi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CloseServiceHandle]
call qword [sym.imp.api_ms_win_core_processthreads_l1_1_0.dll_GetCurrentProcessId]
mov edx, eax
lea rcx, str.CurrentProcessID_from_InstallService_is__d
call fcn.140010f80
mov r8d, 0xa2
jmp 0x1400067cf
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edx, eax
lea rcx, str.create_service_failed:_GetLastError__0x_x
call fcn.140010f80
mov r8d, 0xa7
lea r9, [0x140090270]
lea rdx, str.InstallService
lea rcx, str.__hs_____d_:_____s
call fcn.140011770
nop
lea rdx, [rbx - 0x18]
lock xadd dword [rdx + 0x10], r15d
sub r15d, 1
jg 0x140006812
mov rcx, qword [rdx]
mov rax, qword [rcx]
call qword [rax + 8]
mov rcx, rsi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CloseServiceHandle]
jmp 0x140006851
mov rsi, qword [rbp - 0x70]
mov rcx, rsi
call qword [sym.imp.api_ms_win_service_management_l1_1_0.dll_CloseServiceHandle]
jmp 0x140006851
call qword [sym.imp.api_ms_win_core_errorhandling_l1_1_0.dll_GetLastError]
mov edx, eax
lea rcx, str.OpenSCManager_failed:_GetLastError__0x_x
call fcn.140010f80
lea r9, [0x140090270]
mov r8d, 0xaf
lea rdx, str.InstallService
lea rcx, str.__hs_____d_:_____s
call fcn.140011770
mov rcx, qword [rbp + 0x200]
xor rcx, rsp
call fcn.14001c180
lea r11, [rsp + 0x310]
mov rbx, qword [r11 + 0x30]
mov rsi, qword [r11 + 0x38]
mov rdi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r13
pop r12
pop rbp
ret
mov ecx, 0x80070057
call fcn.140002520
nop
mov ecx, 0x80004005
call fcn.140002520
nop
mov ecx, 0x80004005
call fcn.140002520
int3
mov ecx, 0x80070057
call fcn.140002520
nop
mov ecx, 0x80004005
call fcn.140002520
int3
mov ecx, 0x80070057
call fcn.140002520
int3
mov ecx, 0x80070057
call fcn.140002520
int3