Function at 0x140022954
Capabilities:
Encrypt or decrypt data via bcrypt

Disassembly:
mov qword [rsp + 0x20], rbx
push rbp
push rsi
push rdi
push r14
push r15
sub rsp, 0x90
mov rax, qword [0x14003d0d8]
xor rax, rsp
mov qword [rsp + 0x88], rax
cmp byte [rcx + 0x29], 0
mov r15, r8
mov rsi, rdx
mov rbx, rcx
mov r14d, 0x30
jne 0x1400229d5
mov rcx, qword [rcx]
lea r8, [rbx + 0x5a]
lea edx, [r14 - 0x20]
mov rax, qword [rcx]
mov rax, qword [rax + 0x60]
call qword [0x140034e68]
mov edi, eax
test eax, eax
js 0x140022bc6
mov rcx, qword [rbx]
lea r8, [rbx + 0x2a]
mov byte [rbx + 0x29], 1
mov edx, r14d
mov rax, qword [rcx]
mov rax, qword [rax + 0x60]
call qword [0x140034e68]
mov edi, eax
test eax, eax
js 0x140022bc6
and dword [rsp + 0x50], 0
lea rbp, [rbx + 0x2a]
movups xmm0, xmmword [rbp]
lea r8, [rsi + 0x30]
mov edx, 0x1ffd0
lea r9, [rsp + 0x50]
movups xmmword [rsi], xmm0
movups xmm1, xmmword [rbp + 0x10]
movups xmmword [rsi + 0x10], xmm1
movups xmm0, xmmword [rbp + 0x20]
movups xmmword [rsi + 0x20], xmm0
mov rcx, qword [rbx]
mov rax, qword [rcx]
mov rax, qword [rax + 0x58]
call qword [0x140034e68]
mov edi, eax
test eax, eax
js 0x140022bc6
mov r8d, dword [rsp + 0x50]
test r8d, r8d
je 0x140022ad9
add r8d, r14d
mov edx, Ordinal_20
mov eax, r8d
and eax, 0xf
sub edx, eax
cmp edx, 0x10
jae 0x140022a6c
lea r14d, [rdx + r8]
cmp r14d, 0x20000
jbe 0x140022a54
mov edi, 0x8000ffff
jmp 0x140022a6c
mov rcx, qword [rbx]
add r8, rsi
mov rax, qword [rcx]
mov rax, qword [rax + 0x60]
call qword [0x140034e68]
mov edi, eax
mov r8d, r14d
mov eax, r8d
movups xmm0, xmmword [rax + rsi - 0x30]
movups xmmword [rbp], xmm0
movups xmm1, xmmword [rax + rsi - 0x20]
movups xmmword [rbp + 0x10], xmm1
movups xmm0, xmmword [rax + rsi - 0x10]
movups xmmword [rbp + 0x20], xmm0
test edi, edi
js 0x140022bc6
and dword [rsp + 0x48], 0
lea rax, [rbx + 0x5a]
mov rcx, qword [rbx + 0x10]
add r8d, 0xffffffd0
mov qword [rsp + 0x40], r15
xor r9d, r9d
mov dword [rsp + 0x38], 0x20000
mov rdx, rsi
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], Ordinal_20
mov qword [rsp + 0x20], rax
call qword [sym.imp.bcrypt.dll_BCryptDecrypt]
mov edi, eax
bts edi, 0x1c
jmp 0x140022bc6
mov r8, r14
lea rcx, [rsp + 0x58]
xor edx, edx
call sub.msvcrt.dll_memset
and dword [rsp + 0x48], 0
lea rcx, [rsp + 0x58]
mov qword [rsp + 0x40], r15
lea rax, [rbx + 0x5a]
mov dword [rsp + 0x38], r14d
xor r9d, r9d
mov qword [rsp + 0x30], rcx
mov r8d, r14d
mov rcx, qword [rbx + 0x10]
mov rdx, rbp
mov dword [rsp + 0x28], Ordinal_20
mov qword [rsp + 0x20], rax
call qword [sym.imp.bcrypt.dll_BCryptDecrypt]
movzx r8d, byte [rsp + 0x87]
mov r9d, 0x80004005
mov edi, eax
mov ebp, r8d
bts edi, 0x1c
mov ecx, r8d
cmp r8b, 0x10
cmovae edi, r9d
cmp r8d, 0x2f
jae 0x140022b6a
lea rdx, [rsp + 0x58]
add rdx, rcx
cmp byte [rdx], 0
jne 0x140022b67
inc ecx
inc rdx
cmp ecx, 0x2f
jb 0x140022b56
jmp 0x140022b6a
mov edi, r9d
test edi, edi
js 0x140022b82
movzx r8d, r8b
lea rdx, [rsp + 0x58]
mov rcx, rsi
call sub.msvcrt.dll_memcpy
mov dword [r15], ebp
mov rcx, qword [rbx + 0x10]
test rcx, rcx
je 0x140022b96
call qword [sym.imp.bcrypt.dll_BCryptDestroyKey]
and qword [rbx + 0x10], 0
lea rsi, [rbx + 8]
cmp qword [rsi], 0
je 0x140022baf
xor edx, edx
mov rcx, rsi
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
and qword [rsi], 0
mov rcx, qword [rbx + 0x20]
and qword [rbx + 0x20], 0
call qword [sym.imp.api_ms_win_core_com_l1_1_0.dll_CoTaskMemFree]
and dword [rbx + 0x18], 0
mov byte [rbx + 0x28], 1
mov eax, edi
mov rcx, qword [rsp + 0x88]
xor rcx, rsp
call fcn.1400304d0
mov rbx, qword [rsp + 0xd8]
add rsp, 0x90
pop r15
pop r14
pop rdi
pop rsi
pop rbp
ret