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

Disassembly:
push r14
push r13
push r12
push rbp
push rdi
push rsi
push rbx
sub rsp, 0x90
mov rbx, qword [rdx + 8]
sub rbx, qword [rdx]
mov rsi, rcx
mov rdi, rdx
mov r12, r8
mov r13, r9
js 0x140015ee1
pxor xmm0, xmm0
movups xmmword [rsp + 0x78], xmm0
je 0x140015a80
mov rcx, rbx
call fcn.1400b08e0
cmp rbx, 1
lea r14, [rax + rbx]
mov qword [rsp + 0x70], rax
mov qword [rsp + 0x80], r14
lea rbp, [rax + 1]
mov byte [rax], 0
jne 0x140015958
mov rbx, qword [0x1400bdaf0]
mov r8d, 0x1d
mov qword [rsp + 0x78], rbp
lea rdx, str.Opening_algorithm_provider...
mov rcx, rbx
call fcn.1400ab600
mov rax, qword [rbx]
mov rax, qword [rax - 0x18]
mov r14, qword [rax + rbx + 0xf0]
test r14, r14
je 0x140015edc
cmp byte [r14 + 0x38], 0
je 0x140015920
movsx edx, byte [r14 + 0x43]
mov rcx, rbx
call fcn.14006f940
mov rcx, rax
call fcn.14006fb20
lea rcx, [rsp + 0x60]
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x1400b7170]
call sub.bcrypt.dll_BCryptOpenAlgorithmProvider
test eax, eax
mov r14d, eax
je 0x140015970
mov rbx, qword [0x1400bdad0]
mov r8d, 0x30
lea rdx, str.BCryptOpenAlgorithmProvider_failed_with_status:
mov rcx, rbx
call fcn.1400ab600
mov rcx, rbx
mov edx, r14d
call fcn.140070ac0
mov rbx, rax
mov rax, qword [rax]
mov rax, qword [rax - 0x18]
mov rdi, qword [rbx + rax + 0xf0]
test rdi, rdi
je 0x140015edc
cmp byte [rdi + 0x38], 0
je 0x140015b90
movsx edx, byte [rdi + 0x43]
mov rcx, rbx
call fcn.14006f940
mov rcx, rax
call fcn.14006fb20
mov r12, qword [rsp + 0x70]
mov qword [rsi], 0
mov qword [rsi + 8], 0
mov qword [rsi + 0x10], 0
test r12, r12
je 0x140015902
mov rdx, qword [rsp + 0x80]
mov rcx, r12
sub rdx, r12
call fcn.1400b08a0
mov rax, rsi
add rsp, 0x90
pop rbx
pop rsi
pop rdi
pop rbp
pop r12
pop r13
pop r14
ret
mov rcx, r14
call fcn.140022710
mov rax, qword [r14]
mov edx, 0xa
lea rcx, [0x140022dc0]
mov rax, qword [rax + 0x30]
cmp rax, rcx
je 0x14001583c
mov rcx, r14
call rax
movsx edx, al
jmp 0x14001583c
lea r8, [rbx - 1]
mov rcx, rbp
xor edx, edx
call sub.api_ms_win_crt_string_l1_1_0.dll_memset
mov rbp, r14
jmp 0x1400157f3
lea rdx, str.Setting_chaining_mode...
mov r8d, 0x18
mov rcx, rbx
call fcn.1400ab600
mov rax, qword [rbx]
mov rax, qword [rax - 0x18]
mov r14, qword [rax + rbx + 0xf0]
test r14, r14
je 0x140015edc
cmp byte [r14 + 0x38], 0
je 0x140015b58
movsx edx, byte [r14 + 0x43]
mov rcx, rbx
call fcn.14006f940
mov rcx, rax
call fcn.14006fb20
mov rcx, qword [rsp + 0x60]
mov dword [rsp + 0x20], 0
mov r9d, 0x20
lea r8, str.ChainingModeCBC
lea rdx, str.ChainingMode
call sub.bcrypt.dll_BCryptSetProperty
test eax, eax
mov r14d, eax
je 0x140015aa0
mov rbx, qword [0x1400bdad0]
lea rdx, str.BCryptSetProperty_failed_with_status:
mov r8d, 0x26
mov rcx, rbx
call fcn.1400ab600
mov edx, r14d
mov rcx, rbx
call fcn.140070ac0
mov rbx, rax
mov rax, qword [rax]
mov rax, qword [rax - 0x18]
mov rdi, qword [rbx + rax + 0xf0]
test rdi, rdi
je 0x140015edc
cmp byte [rdi + 0x38], 0
je 0x140015bc8
movsx edx, byte [rdi + 0x43]
mov rcx, rbx
call fcn.14006f940
mov rcx, rax
call fcn.14006fb20
mov rcx, qword [rsp + 0x60]
xor edx, edx
call sub.bcrypt.dll_BCryptCloseAlgorithmProvider
mov r12, qword [rsp + 0x70]
mov qword [rsi], 0
mov qword [rsi + 8], 0
mov qword [rsi + 0x10], 0
jmp 0x1400158ea
mov qword [rsp + 0x70], 0
xor ebp, ebp
mov qword [rsp + 0x80], 0
jmp 0x1400157f3
lea rdx, str.Generating_symmetric_key...
mov r8d, 0x1b
mov rcx, rbx
call fcn.1400ab600
mov rax, qword [rbx]
mov rax, qword [rax - 0x18]
mov r14, qword [rax + rbx + 0xf0]
test r14, r14
je 0x140015edc
cmp byte [r14 + 0x38], 0
je 0x140015c00
movsx edx, byte [r14 + 0x43]
mov rcx, rbx
call fcn.14006f940
mov rcx, rax
call fcn.14006fb20
mov rdx, qword [r12]
xor r9d, r9d
xor r8d, r8d
mov dword [rsp + 0x30], 0
mov rax, qword [r12 + 8]
lea rcx, [rsp + 0x68]
mov qword [rsp + 0x20], rdx
sub rax, rdx
mov rdx, rcx
mov rcx, qword [rsp + 0x60]
mov dword [rsp + 0x28], eax
call sub.bcrypt.dll_BCryptGenerateSymmetricKey
test eax, eax
mov r12d, eax
je 0x140015c38
mov rbx, qword [0x1400bdad0]
lea rdx, str.BCryptGenerateSymmetricKey_failed_with_status:
mov r8d, 0x2f
mov rcx, rbx
call fcn.1400ab600
mov edx, r12d
jmp 0x140015a0d
mov rcx, r14
call fcn.140022710
mov rax, qword [r14]
mov edx, 0xa
lea rcx, [0x140022dc0]
mov rax, qword [rax + 0x30]
cmp rax, rcx
je 0x1400159ad
mov rcx, r14
call rax
movsx edx, al
jmp 0x1400159ad
mov rcx, rdi
call fcn.140022710
mov rax, qword [rdi]
mov edx, 0xa
lea rcx, [0x140022dc0]
mov rax, qword [rax + 0x30]
cmp rax, rcx
je 0x1400158be
mov rcx, rdi
call rax
movsx edx, al
jmp 0x1400158be
mov rcx, rdi
call fcn.140022710
mov rax, qword [rdi]
mov edx, 0xa
lea rcx, [0x140022dc0]
mov rax, qword [rax + 0x30]
cmp rax, rcx
je 0x140015a3e
mov rcx, rdi
call rax
movsx edx, al
jmp 0x140015a3e
mov rcx, r14
call fcn.140022710
mov rax, qword [r14]
mov edx, 0xa
lea rcx, [0x140022dc0]
mov rax, qword [rax + 0x30]
cmp rax, rcx
je 0x140015add
mov rcx, r14
call rax
movsx edx, al
jmp 0x140015add
lea rdx, str.Decrypting_data...
mov r8d, 0x12
mov rcx, rbx
call fcn.1400ab600
mov rax, qword [rbx]
mov rax, qword [rax - 0x18]
mov r12, qword [rax + rbx + 0xf0]
test r12, r12
je 0x140015edc
cmp byte [r12 + 0x38], 0
je 0x140015e18
movsx edx, byte [r12 + 0x43]
mov rcx, rbx
mov r14, rbp
call fcn.14006f940
mov rcx, rax
call fcn.14006fb20
lea rax, [rsp + 0x5c]
mov rdx, qword [rdi]
xor r9d, r9d
mov r12, qword [rsp + 0x70]
mov rcx, qword [r13]
mov r8, qword [rdi + 8]
mov dword [rsp + 0x48], 0
mov qword [rsp + 0x40], rax
sub r14, r12
mov qword [rsp + 0x30], r12
mov dword [rsp + 0x38], r14d
mov rax, qword [r13 + 8]
mov qword [rsp + 0x20], rcx
sub r8d, edx
sub rax, rcx
mov rcx, qword [rsp + 0x68]
mov dword [rsp + 0x28], eax
call sub.bcrypt.dll_BCryptDecrypt
test eax, eax
mov edi, eax
je 0x140015d78
mov rbx, qword [0x1400bdad0]
mov r8d, 0x22
lea rdx, str.BCryptDecrypt_failed_with_status:
mov rcx, rbx
call fcn.1400ab600
mov edx, edi
mov rcx, rbx
call fcn.140070ac0
mov rbx, rax
mov rax, qword [rax]
mov rax, qword [rax - 0x18]
mov rdi, qword [rbx + rax + 0xf0]
test rdi, rdi
je 0x140015edc
cmp byte [rdi + 0x38], 0
je 0x140015e50
movsx edx, byte [rdi + 0x43]
mov rcx, rbx
call fcn.14006f940
mov rcx, rax
call fcn.14006fb20
mov rcx, qword [rsp + 0x68]
call sub.bcrypt.dll_BCryptDestroyKey
mov rcx, qword [rsp + 0x60]
xor edx, edx
call sub.bcrypt.dll_BCryptCloseAlgorithmProvider
mov qword [rsi], 0
mov qword [rsi + 8], 0
mov qword [rsi + 0x10], 0
jmp 0x1400158ea
lea rdx, str.Cleaning_up...
mov r8d, 0xe
mov rcx, rbx
call fcn.1400ab600
mov rax, qword [rbx]
mov rax, qword [rax - 0x18]
mov rdi, qword [rax + rbx + 0xf0]
test rdi, rdi
je 0x140015edc
cmp byte [rdi + 0x38], 0
je 0x140015e88
movsx edx, byte [rdi + 0x43]
mov rcx, rbx
call fcn.14006f940
mov rcx, rax
call fcn.14006fb20
mov rcx, qword [rsp + 0x68]
call sub.bcrypt.dll_BCryptDestroyKey
mov rcx, qword [rsp + 0x60]
xor edx, edx
call sub.bcrypt.dll_BCryptCloseAlgorithmProvider
mov edx, dword [rsp + 0x5c]
cmp r14, rdx
jb 0x140015ec0
lea rax, [r12 + rdx]
cmp rdx, r14
cmovb rbp, rax
mov rax, qword [rsp + 0x80]
movq xmm0, r12
movq xmm1, rbp
punpcklqdq xmm0, xmm1
movups xmmword [rsi], xmm0
mov qword [rsi + 0x10], rax
jmp 0x140015902
mov rcx, r12
call fcn.140022710
mov rax, qword [r12]
mov edx, 0xa
lea rcx, [0x140022dc0]
mov rax, qword [rax + 0x30]
cmp rax, rcx
je 0x140015c77
mov rcx, r12
call rax
movsx edx, al
jmp 0x140015c77
mov rcx, rdi
call fcn.140022710
mov rax, qword [rdi]
mov edx, 0xa
lea rcx, [0x140022dc0]
mov rax, qword [rax + 0x30]
cmp rax, rcx
je 0x140015d32
mov rcx, rdi
call rax
movsx edx, al
jmp 0x140015d32
mov rcx, rdi
call fcn.140022710
mov rax, qword [rdi]
mov edx, 0xa
lea rcx, [0x140022dc0]
mov rax, qword [rax + 0x30]
cmp rax, rcx
je 0x140015db3
mov rcx, rdi
call rax
movsx edx, al
jmp 0x140015db3
lea rcx, [rsp + 0x70]
sub rdx, r14
call fcn.140099db0
mov r12, qword [rsp + 0x70]
mov rbp, qword [rsp + 0x78]
jmp 0x140015df1
call fcn.1400b1e10
lea rcx, str.cannot_create_std::vector_larger_than_max_size__
call fcn.1400b1f80
nop
nop
nop