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

Disassembly:
push rbp
push rsi
push rdi
push r15
lea rbp, [rsp - 0x3f]
sub rsp, 0x88
xor edi, edi
mov qword [rsp + 0x78], r12
mov rsi, rcx
mov qword [rsp + 0x70], r14
xor r9d, r9d
mov qword [rbp + 0xf], rdi
xor r8d, r8d
mov qword [rbp + 0x17], rdi
lea rdx, [0x140019870]
mov dword [rbp + 0x7f], edi
lea rcx, [rbp + 0xf]
mov dword [rbp + 7], edi
lea r12d, [rdi + 1]
mov dword [rbp + 0x77], edi
mov r14d, edi
mov dword [rbp + 0x6f], edi
mov r15d, edi
call sub.bcrypt.dll_BCryptOpenAlgorithmProvider
test eax, eax
js 0x1400011f3
mov rcx, qword [rbp + 0xf]
lea rax, [rbp + 0x7f]
mov dword [rsp + 0x28], edi
lea r9d, [rdi + 4]
lea r8, [rbp + 0x77]
mov qword [rsp + 0x20], rax
lea rdx, str.ObjectLength
call sub.bcrypt.dll_BCryptGetProperty
test eax, eax
js 0x1400011f3
mov rcx, qword [rbp + 0xf]
lea rax, [rbp + 0x7f]
mov dword [rsp + 0x28], edi
lea r9d, [rdi + 4]
lea r8, [rbp + 7]
mov qword [rsp + 0x20], rax
lea rdx, str.BlockLength
call sub.bcrypt.dll_BCryptGetProperty
test eax, eax
js 0x1400011f3
cmp dword [rbp + 7], 0x10
jne 0x1400011f3
mov qword [rsp + 0x80], rbx
mov ebx, dword [rbp + 0x77]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, ebx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r14, rax
test rax, rax
je 0x1400011eb
mov rcx, qword [rbp + 0xf]
lea r9d, [rdi + 0x20]
lea r8, str.ChainingModeCBC
mov dword [rsp + 0x20], edi
lea rdx, str.ChainingMode
call sub.bcrypt.dll_BCryptSetProperty
test eax, eax
js 0x1400011eb
mov rax, qword [rsi + 0x20]
lea rdx, [rbp + 0x17]
mov r9d, dword [rbp + 0x77]
mov r8, r14
mov rcx, qword [rbp + 0xf]
mov dword [rsp + 0x30], edi
mov dword [rsp + 0x28], 0x20
mov qword [rsp + 0x20], rax
call sub.bcrypt.dll_BCryptGenerateSymmetricKey
test eax, eax
js 0x1400011eb
mov r8d, dword [rsi + 0x18]
lea rax, [rbp + 0x6f]
mov rdx, qword [rsi + 0x10]
xor r9d, r9d
mov rcx, qword [rbp + 0x17]
mov dword [rsp + 0x48], r12d
mov qword [rsp + 0x40], rax
mov rax, qword [rsi + 0x28]
mov dword [rsp + 0x38], edi
mov qword [rsp + 0x30], rdi
mov dword [rsp + 0x28], 0x10
mov qword [rsp + 0x20], rax
call sub.bcrypt.dll_BCryptDecrypt
test eax, eax
js 0x1400011eb
mov ebx, dword [rbp + 0x6f]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, ebx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r15, rax
test rax, rax
je 0x1400011eb
mov r8d, dword [rsi + 0x18]
lea rax, [rbp + 0x7f]
mov rdx, qword [rsi + 0x10]
xor r9d, r9d
mov rcx, qword [rbp + 0x17]
mov dword [rsp + 0x48], r12d
mov qword [rsp + 0x40], rax
mov eax, dword [rbp + 0x6f]
mov dword [rsp + 0x38], eax
mov rax, qword [rsi + 0x28]
mov qword [rsp + 0x30], r15
mov dword [rsp + 0x28], 0x10
mov qword [rsp + 0x20], rax
call sub.bcrypt.dll_BCryptDecrypt
test eax, eax
cmovs r12d, edi
mov edi, r12d
mov rbx, qword [rsp + 0x80]
mov rcx, qword [rbp + 0x17]
mov r12, qword [rsp + 0x78]
test rcx, rcx
je 0x140001206
call sub.bcrypt.dll_BCryptDestroyKey
mov rcx, qword [rbp + 0xf]
test rcx, rcx
je 0x140001216
xor edx, edx
call sub.bcrypt.dll_BCryptCloseAlgorithmProvider
test r14, r14
je 0x14000122f
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, r14
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov r14, qword [rsp + 0x70]
mov eax, edi
test r15, r15
je 0x140001248
test edi, edi
je 0x140001248
mov ecx, dword [rbp + 0x6f]
mov dword [rsi + 8], ecx
mov qword [rsi], r15
add rsp, 0x88
pop r15
pop rdi
pop rsi
pop rbp
ret