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

Disassembly:
mov qword [rsp + 0x18], rbx
mov byte [rsp + 0x20], r9b
mov qword [rsp + 0x10], rdx
mov qword [rsp + 8], rcx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x27]
sub rsp, 0x90
movzx ebx, r9b
mov r12, r8
mov r15, rdx
mov rdi, rcx
xor eax, eax
mov dword [rbp - 9], eax
mov qword [rbp - 1], rax
mov qword [rbp + 7], rax
mov dword [rbp - 0x19], eax
mov dword [rbp - 0x15], eax
mov r13d, eax
mov r14d, eax
mov rcx, rdx
call fcn.140014a30
mov dword [rbp - 9], 1
mov rcx, r12
call fcn.140018540
mov dword [rbp - 0xd], eax
test bl, bl
je 0x140012cd6
add eax, 0x10
mov rdi, qword [rbp + 0x67]
mov dword [rbp - 0x11], eax
mov ebx, eax
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8d, ebx
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rsi, rax
mov rcx, r12
call fcn.140018540
mov ebx, eax
mov rcx, r12
call fcn.140006720
mov rdx, rax
mov r8d, ebx
mov rcx, rsi
call fcn.140037860
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x14003b790]
lea rcx, [rbp - 1]
call sub.bcrypt.dll_BCryptOpenAlgorithmProvider
test eax, eax
js 0x140012ec6
mov dword [rsp + 0x28], 0
lea rax, [rbp - 0x19]
mov qword [rsp + 0x20], rax
mov r9d, 4
lea r8, [rbp - 0x15]
lea rdx, str.ObjectLength
mov rcx, qword [rbp - 1]
call sub.bcrypt.dll_BCryptGetProperty
test eax, eax
js 0x140012ec6
mov ebx, dword [rbp - 0x15]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, ebx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r13, rax
test rax, rax
je 0x140012ec6
mov dword [rsp + 0x20], 0
mov r9d, 0x20
lea r8, str.ChainingModeCBC
lea rdx, str.ChainingMode
mov rcx, qword [rbp - 1]
call sub.bcrypt.dll_BCryptSetProperty
test eax, eax
js 0x140012ec6
lea rbx, [rdi + 0x20]
mov rcx, rbx
call fcn.140018540
mov edi, eax
mov rcx, rbx
call fcn.140006720
xor ebx, ebx
mov dword [rsp + 0x30], ebx
mov dword [rsp + 0x28], edi
mov qword [rsp + 0x20], rax
mov r9d, dword [rbp - 0x15]
mov r8, r13
lea rdx, [rbp + 7]
mov rcx, qword [rbp - 1]
call sub.bcrypt.dll_BCryptGenerateSymmetricKey
test eax, eax
js 0x140012ec6
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
xor edx, edx
mov r8d, 0x10
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov r14, rax
test rax, rax
je 0x140012ec6
mov rdi, qword [rbp + 0x67]
movups xmm0, xmmword [rdi]
movups xmmword [rax], xmm0
lea rax, [rbp - 0x19]
xor r9d, r9d
mov r8d, dword [rbp - 0xd]
mov rdx, rsi
mov rcx, qword [rbp + 7]
cmp byte [rbp + 0x7f], bl
je 0x140012e42
mov dword [rsp + 0x48], 1
jmp 0x140012e46
mov dword [rsp + 0x48], ebx
mov qword [rsp + 0x40], rax
mov eax, dword [rbp - 0x11]
mov dword [rsp + 0x38], eax
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], 0x10
mov qword [rsp + 0x20], r14
call sub.bcrypt.dll_BCryptDecrypt
test eax, eax
js 0x140012e7c
mov r8d, dword [rbp - 0x19]
mov rdx, rsi
mov rcx, r15
call fcn.140018d00
mov rcx, r12
call fcn.140018540
cmp eax, 0x10
jb 0x140012ec6
mov rcx, r12
call fcn.140018540
mov ebx, eax
mov rcx, r12
call fcn.140018540
lea r8d, [rax - 0x10]
mov r9d, ebx
lea rdx, [rbp + 0xf]
mov rcx, r12
call fcn.140018d90
nop
mov rcx, rax
call fcn.140006720
movups xmm0, xmmword [rax]
movups xmmword [rdi], xmm0
lea rcx, [rbp + 0xf]
call fcn.140015200
test rsi, rsi
je 0x140012edf
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, rsi
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
test r14, r14
je 0x140012ef8
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, r14
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [rbp + 7]
test rcx, rcx
je 0x140012f06
call sub.bcrypt.dll_BCryptDestroyKey
test r13, r13
je 0x140012f1f
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov rcx, rax
mov r8, r13
xor edx, edx
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rcx, qword [rbp - 1]
test rcx, rcx
je 0x140012f2f
xor edx, edx
call sub.bcrypt.dll_BCryptCloseAlgorithmProvider
mov rax, r15
mov rbx, qword [rsp + 0xe0]
add rsp, 0x90
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret