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

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x18], rsi
push rbp
push rdi
push r12
push r14
push r15
lea rbp, [rsp - 0x70]
sub rsp, 0x170
mov r15, r8
mov rdi, rdx
mov rsi, rcx
xor r12d, r12d
cmp byte [rcx + 0x50], r12b
je 0x140039134
call fcn.1400170f0
mov rbx, rax
test rax, rax
je 0x14003911d
mov rdx, qword [rax]
mov rcx, rax
call qword [rdx + htons]
cmp eax, 1
jl 0x14003911d
lea edx, [r12 + 1]
lea rcx, [rbp - 0x80]
call fcn.140002860
nop
lea rdx, str.Cipher_not_properly_initialized_for_encryption._Aborting
lea rcx, [rbp - 0x80]
call fcn.1400019a0
mov rax, qword [rbx]
lea r9, [rbp - 0x80]
mov r8, qword [str.BCryptSymmetricCipherImpl]
lea edx, [r12 + 1]
mov rcx, rbx
call qword [rax + 0x18]
nop
lea rcx, [rbp - 0x80]
call fcn.140003bc0
mov qword [rdi + 8], r12
mov qword [rdi + 0x10], r12
lea rbx, vtable.Aws::Utils::CryptoBuffer.0
mov qword [rdi], rbx
jmp 0x1400393a1
mov r14, qword [r8 + 8]
test r14, r14
jne 0x14003915d
cmp byte [rcx + 0x90], r12b
je 0x14003915d
mov qword [rdx + 8], r12
mov qword [rdx + 0x10], r12
lea rbx, vtable.Aws::Utils::CryptoBuffer.0
mov qword [rdx], rbx
jmp 0x1400393a1
test byte [rcx + 0x68], 1
je 0x14003918d
mov rax, qword [rcx]
call qword [rax + 0x38]
mov rcx, rax
xor edx, edx
mov rax, r14
div rcx
mov rbx, rdx
mov rax, qword [rsi]
mov rcx, rsi
call qword [rax + 0x38]
mov r14, rax
mov rax, qword [r15 + 8]
sub rax, rbx
add r14, rax
mov dword [rbp + 0xa0], r14d
lea rax, vtable.Aws::Utils::Array_unsigned_char_.0
mov qword [rsp + 0x50], rax
mov qword [rsp + 0x58], r14
test r14, r14
je 0x1400391f7
mov r8, qword [str.Aws::Array]
mov rdx, r14
lea rcx, [rsp + 0x70]
call fcn.140008c10
mov rcx, qword [rax]
mov qword [rax], r12
lea rax, [rbp + 0xb8]
mov qword [rax], r12
mov qword [rsp + 0x60], rcx
mov rcx, qword [rbp + 0xb8]
test rcx, rcx
je 0x1400391e5
call fcn.140015ad0
nop
mov rcx, qword [rsp + 0x70]
test rcx, rcx
je 0x1400391f5
call fcn.140015ad0
nop
jmp 0x140039214
lea rax, [rsp + 0x78]
mov qword [rax], r12
mov qword [rsp + 0x60], r12
mov rcx, qword [rsp + 0x78]
test rcx, rcx
je 0x140039214
call fcn.140015ad0
nop
lea rbx, vtable.Aws::Utils::CryptoBuffer.0
mov qword [rsp + 0x50], rbx
mov rcx, r12
mov edx, r12d
mov r9, qword [rsi + 0x88]
test r9, r9
je 0x14003923c
mov rcx, qword [rsi + 0x80]
mov edx, dword [rsi + 0x78]
mov eax, dword [rsi + 0x68]
mov dword [rsp + 0x48], eax
lea rax, [rbp + 0xa0]
mov qword [rsp + 0x40], rax
mov eax, dword [rsp + 0x58]
mov dword [rsp + 0x38], eax
mov rax, qword [rsp + 0x60]
mov qword [rsp + 0x30], rax
mov dword [rsp + 0x28], edx
mov qword [rsp + 0x20], rcx
mov r8d, dword [r15 + 8]
mov rdx, qword [r15 + 0x10]
mov rcx, qword [rsi + 0x60]
call sub.bcrypt.dll_BCryptEncrypt
mov r14d, eax
mov byte [rsi + 0x90], 1
test eax, eax
jns 0x140039326
mov byte [rsi + 0x50], 1
call fcn.1400170f0
mov rsi, rax
test rax, rax
je 0x1400392f9
mov rdx, qword [rax]
mov rcx, rax
call qword [rdx + htons]
cmp eax, 2
jl 0x1400392f9
mov edx, 1
lea rcx, [rbp - 0x80]
call fcn.140002860
nop
lea rdx, str.Failed_to_compute_encrypted_output_with_error_code
lea rcx, [rbp - 0x80]
call fcn.1400019a0
mov rcx, rax
mov edx, r14d
call fcn.1400107d0
mov rax, qword [rsi]
lea r9, [rbp - 0x80]
mov r8, qword [str.BCryptSymmetricCipherImpl]
mov edx, 2
mov rcx, rsi
call qword [rax + 0x18]
nop
lea rcx, [rbp - 0x80]
call fcn.140003bc0
mov qword [rdi + 8], r12
mov qword [rdi + 0x10], r12
mov qword [rdi], rbx
mov qword [rsp + 0x50], rbx
lea rcx, [rsp + 0x50]
call fcn.140035800
nop
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140039324
call fcn.140015ad0
nop
jmp 0x1400393a1
mov r8d, dword [rbp + 0xa0]
mov rax, qword [rsp + 0x58]
cmp r8, rax
jae 0x140039367
mov rdx, qword [rsp + 0x60]
mov rcx, rdi
call fcn.140036f90
nop
mov qword [rsp + 0x50], rbx
lea rcx, [rsp + 0x50]
call fcn.140035800
nop
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x140039365
call fcn.140015ad0
nop
jmp 0x1400393a1
mov qword [rdi + 8], rax
mov rax, qword [rsp + 0x60]
mov qword [rdi + 0x10], rax
mov qword [rsp + 0x58], r12
mov qword [rsp + 0x60], r12
mov qword [rdi], rbx
mov qword [rsp + 0x50], rbx
lea rcx, [rsp + 0x50]
call fcn.140035800
nop
mov rcx, qword [rsp + 0x60]
test rcx, rcx
je 0x1400393a1
call fcn.140015ad0
nop
mov rax, rdi
lea r11, [rsp + 0x170]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret