Function at 0x1400176d4
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rbp
push rdi
push r12
push r13
push r15
mov rbp, rsp
sub rsp, 0x60
and qword [rbp - 8], 0
and qword [rbp - 0x18], 0
and qword [rbp - 0x10], 0
and dword [rbp + 0x30], 0
and dword [rbp - 0x1c], 0
and dword [rbp - 0x20], 0
and dword [rbp + 0x48], 0
mov r12, r8
mov r13, rdx
xor sil, sil
neg cl
mov r15d, 1
sbb edi, edi
lea r8, str.Microsoft_Base_Cryptographic_Provider_v1.0
lea rdx, str.Widcomm_Bluetooth_Key_Container_Name
not edi
lea rcx, [rbp - 8]
mov r9d, r15d
and edi, 0x20
mov dword [rsp + 0x20], edi
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x1400177d0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.encryptKeyValue:_CryptAcquireContext_failed._keyset0x_x__Error_d__0x_x__n
mov r9d, ebx
mov edx, edi
mov r8d, eax
call fcn.1400170a4
test edi, edi
je 0x14001777d
call fcn.140017134
call fcn.140017214
jmp 0x140017787
call fcn.1400171a4
call fcn.1400172e4
lea r8, str.Microsoft_Base_Cryptographic_Provider_v1.0
lea rdx, str.Widcomm_Bluetooth_Key_Container_Name
lea rcx, [rbp - 8]
mov r9d, r15d
mov dword [rsp + 0x20], edi
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x1400177d0
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.encryptKeyValue:_CryptAcquireContext_2_failed._Error_d__0x_x__n
mov edx, eax
mov r8d, ebx
call fcn.1400170a4
xor al, al
jmp 0x1400179af
mov rcx, qword [rbp - 8]
lea r8, [rbp - 0x10]
mov edx, r15d
call qword [sym.imp.ADVAPI32.dll_CryptGetUserKey]
test eax, eax
jne 0x140017806
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x8009000d
jne 0x140017806
mov rcx, qword [rbp - 8]
lea r9, [rbp - 0x10]
xor r8d, r8d
mov edx, r15d
call qword [sym.imp.ADVAPI32.dll_CryptGenKey]
cmp qword [rbp - 0x10], 0
je 0x14001797d
mov rcx, qword [rbp - 8]
lea r9, [rbp - 0x18]
mov r8d, r15d
mov edx, 0x6602
call qword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
je 0x14001797d
mov rdx, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x18]
lea rax, [rbp + 0x30]
mov qword [rsp + 0x28], rax
and qword [rsp + 0x20], 0
xor r9d, r9d
mov r8d, r15d
call qword [sym.imp.ADVAPI32.dll_CryptExportKey]
test eax, eax
je 0x14001797d
mov eax, dword [r12]
and dword [rsp + 0x30], 0
mov rcx, qword [rbp - 0x18]
mov dword [rbp + 0x48], eax
lea rax, [rbp + 0x48]
xor r9d, r9d
mov qword [rsp + 0x28], rax
and qword [rsp + 0x20], 0
mov r8d, r15d
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
je 0x14001797d
mov ecx, dword [rbp + 0x30]
mov eax, dword [rbp + 0x48]
lea edx, [rax + rcx + 0xc]
mov ecx, edx
mov dword [rbp - 0x20], edx
call fcn.14005c274
mov rbx, rax
test rax, rax
je 0x14001797d
lea rdx, [rbp - 0x20]
mov r8d, 4
mov rcx, rax
call fcn.14005bdf0
lea rdi, [rbx + 4]
lea rdx, [rbp + 0x30]
mov rcx, rdi
mov r8d, 4
call fcn.14005bdf0
mov rdx, qword [rbp - 0x10]
mov rcx, qword [rbp - 0x18]
lea rax, [rbp + 0x30]
add rdi, 4
xor r9d, r9d
mov qword [rsp + 0x28], rax
mov r8d, r15d
mov qword [rsp + 0x20], rdi
call qword [sym.imp.ADVAPI32.dll_CryptExportKey]
test eax, eax
je 0x140017970
mov eax, dword [rbp + 0x30]
lea rdx, [rbp + 0x48]
mov r8d, 4
add rdi, rax
mov rcx, rdi
call fcn.14005bdf0
mov r8d, dword [r12]
mov rdx, qword [r13]
add rdi, 4
mov rcx, rdi
call fcn.14005bdf0
mov eax, dword [rbp + 0x48]
mov r11d, dword [r12]
mov rcx, qword [rbp - 0x18]
mov dword [rsp + 0x30], eax
lea rax, [rbp - 0x1c]
mov qword [rsp + 0x28], rax
xor r9d, r9d
mov r8d, r15d
xor edx, edx
mov dword [rbp - 0x1c], r11d
mov qword [rsp + 0x20], rdi
call qword [sym.imp.ADVAPI32.dll_CryptEncrypt]
test eax, eax
je 0x140017970
mov eax, dword [rbp - 0x20]
mov qword [r13], rbx
mov sil, r15b
mov dword [r12], eax
xor ebx, ebx
test rbx, rbx
je 0x14001797d
mov rcx, rbx
call fcn.14005c1e4
mov rcx, qword [rbp - 0x18]
test rcx, rcx
je 0x14001798c
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rbp - 0x10]
test rcx, rcx
je 0x14001799b
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rbp - 8]
test rcx, rcx
je 0x1400179ac
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov al, sil
lea r11, [rsp + 0x60]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r13
pop r12
pop rdi
pop rbp
ret