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

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0x1f]
sub rsp, 0xf8
mov rax, qword [0x140041080]
xor rax, rsp
mov qword [rbp + 7], rax
mov r14, r9
mov qword [rbp - 0x61], r9
mov rdi, r8
mov rsi, rdx
mov r15, rcx
mov qword [rbp - 0x69], rcx
mov qword [rbp - 0x49], rdx
mov qword [rbp - 0x41], r8
xor r12d, r12d
mov qword [rbp - 0x59], r12
mov qword [rbp - 0x51], r12
mov dword [rbp - 0x31], r12d
mov dword [rbp - 0x39], r12d
mov dword [rbp - 0x35], r12d
xor r9d, r9d
xor r8d, r8d
lea rdx, [0x14003a468]
lea rcx, [rbp - 0x59]
call qword [sym.imp.bcrypt.dll_BCryptOpenAlgorithmProvider]
mov ebx, eax
test eax, eax
je 0x14000245b
lea rdx, str.Error_opening_AES_algorithm_provider:
lea rcx, [0x1400426b0]
call fcn.1400049e0
mov rcx, rax
mov edx, ebx
call fcn.140002ac0
mov rcx, rax
call fcn.140004c90
nop
mov rcx, qword [rsi]
test rcx, rcx
je 0x1400023f5
mov rdx, qword [rsi + 0x10]
sub rdx, rcx
cmp rdx, 0x1000
jb 0x1400023e5
mov r8, qword [rcx - 8]
sub rcx, r8
add rdx, 0x27
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140002a3b
mov rcx, r8
call fcn.14000d4e0
mov qword [rsi], r12
mov qword [rsi + 8], r12
mov qword [rsi + 0x10], r12
mov rcx, qword [rdi]
test rcx, rcx
je 0x140002439
mov rdx, qword [rdi + 0x10]
sub rdx, rcx
cmp rdx, 0x1000
jb 0x140002429
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140002a41
mov rcx, r8
call fcn.14000d4e0
mov qword [rdi], r12
mov qword [rdi + 8], r12
mov qword [rdi + 0x10], r12
xor al, al
mov rcx, qword [rbp + 7]
xor rcx, rsp
call fcn.14000d4c0
add rsp, 0xf8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret
mov dword [rsp + 0x20], r12d
mov r9d, 0x20
lea r8, str.ChainingModeCBC
lea rdx, str.ChainingMode
mov rcx, qword [rbp - 0x59]
call qword [sym.imp.bcrypt.dll_BCryptSetProperty]
mov ebx, eax
test eax, eax
je 0x1400024ba
lea rdx, str.Error_setting_CBC_mode:
lea rcx, [0x1400426b0]
call fcn.1400049e0
mov rcx, rax
mov edx, ebx
call fcn.140002ac0
mov rcx, rax
call fcn.140004c90
xor edx, edx
mov rcx, qword [rbp - 0x59]
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
jmp 0x1400023b1
mov rcx, qword [rsi]
mov rax, qword [rsi + 8]
sub rax, rcx
mov dword [rsp + 0x30], r12d
mov dword [rsp + 0x28], eax
mov qword [rsp + 0x20], rcx
xor r9d, r9d
xor r8d, r8d
lea rdx, [rbp - 0x51]
mov rcx, qword [rbp - 0x59]
call qword [sym.imp.bcrypt.dll_BCryptGenerateSymmetricKey]
mov ebx, eax
test eax, eax
je 0x1400024f5
lea rdx, str.Error_generating_AES_key:
jmp 0x14000248b
mov dword [rsp + 0x28], r12d
lea rax, [rbp - 0x31]
mov qword [rsp + 0x20], rax
mov r9d, 4
lea r8, [rbp - 0x39]
lea rdx, str.BlockLength
mov rcx, qword [rbp - 0x59]
call qword [sym.imp.bcrypt.dll_BCryptGetProperty]
mov ebx, eax
test eax, eax
jne 0x1400029fb
mov rdx, qword [rdi + 8]
sub rdx, qword [rdi]
mov ecx, dword [rbp - 0x39]
cmp rcx, rdx
jne 0x1400029fb
mov rbx, qword [r15 + 8]
sub rbx, qword [r15]
mov r15, qword [r14 + 8]
mov rdx, qword [r14]
mov rcx, r15
sub rcx, rdx
cmp rbx, rcx
jae 0x14000255a
lea rax, [rbx + rdx]
jmp 0x140002589
jbe 0x14000258d
mov rax, qword [r14 + 0x10]
sub rax, rdx
cmp rbx, rax
jbe 0x140002575
mov rdx, rbx
mov rcx, r14
call fcn.140006250
jmp 0x14000258d
sub rbx, rcx
mov r8, rbx
xor edx, edx
mov rcx, r15
call fcn.14002d790
lea rax, [r15 + rbx]
mov qword [r14 + 8], rax
xorps xmm1, xmm1
movdqu xmmword [rbp - 0x29], xmm1
mov r15, r12
mov qword [rbp - 0x19], r12
mov rbx, qword [rdi + 8]
sub rbx, qword [rdi]
mov dword [rsp + 0x50], r12d
je 0x14000262e
movabs rax, 0x7fffffffffffffff
cmp rbx, rax
ja 0x140002a47
cmp rbx, 0x1000
jb 0x1400025f3
lea rcx, [rbx + 0x27]
cmp rcx, rbx
jbe 0x140002a4d
call fcn.14000d4e8
test rax, rax
je 0x140002a53
lea r14, [rax + 0x27]
and r14, 0xffffffffffffffe0
mov qword [r14 - 8], rax
jmp 0x1400025fe
mov rcx, rbx
call fcn.14000d4e8
mov r14, rax
mov qword [rbp - 0x29], r14
lea r15, [r14 + rbx]
mov qword [rbp - 0x19], r15
mov rbx, qword [rdi + 8]
mov rdx, qword [rdi]
sub rbx, rdx
mov r8, rbx
mov rcx, r14
call fcn.14002d0f0
lea rax, [r14 + rbx]
mov qword [rsp + 0x50], rax
mov qword [rbp - 0x21], rax
jmp 0x140002632
mov r14, qword [rbp - 0x29]
xorps xmm0, xmm0
movups xmmword [rbp - 0x11], xmm0
mov ecx, 0x10
call fcn.14000d4e8
mov rbx, rax
mov qword [rbp - 0x11], rax
lea r13, [rax + 0x10]
mov qword [rbp - 1], r13
xorps xmm0, xmm0
movups xmmword [rax], xmm0
mov qword [rbp - 9], r13
xor edx, edx
mov qword [rbp - 0x71], rdx
mov rax, qword [rbp - 0x69]
mov rcx, qword [rax + 8]
mov r8, qword [rax]
cmp rcx, r8
je 0x14000273b
sub dword [rsp + 0x50], r14d
nop dword [rax + rax]
sub rcx, r8
sub rcx, rdx
cmp rcx, 0x10
mov eax, 0x10
cmova rcx, rax
mov qword [rsp + 0x58], rcx
add rdx, r8
mov r8, rcx
mov rcx, rbx
call fcn.14002d0f0
mov rax, qword [rbp - 0x61]
mov rcx, qword [rax]
add rcx, r12
mov dword [rsp + 0x48], 0
lea rax, [rbp - 0x35]
mov qword [rsp + 0x40], rax
mov rax, qword [rsp + 0x58]
mov dword [rsp + 0x38], eax
mov qword [rsp + 0x30], rcx
mov rcx, qword [rsp + 0x50]
mov dword [rsp + 0x28], ecx
mov qword [rsp + 0x20], r14
xor r9d, r9d
mov r8d, eax
mov rdx, rbx
mov rcx, qword [rbp - 0x51]
call qword [sym.imp.bcrypt.dll_BCryptDecrypt]
mov dword [rbp - 0x79], eax
test eax, eax
jne 0x140002763
mov eax, dword [rbp - 0x35]
add r12, rax
mov rax, qword [rbp - 0x69]
mov rdx, qword [rbp - 0x71]
add rdx, qword [rax]
mov r8, qword [rsp + 0x58]
mov rcx, r14
call fcn.14002d0f0
mov rdx, qword [rbp - 0x71]
add rdx, 0x10
mov qword [rbp - 0x71], rdx
mov rax, qword [rbp - 0x69]
mov rcx, qword [rax + 8]
mov r8, qword [rax]
mov rax, rcx
sub rax, r8
cmp rdx, rax
jb 0x140002680
mov rcx, qword [rbp - 0x61]
mov r9, qword [rcx + 8]
mov qword [rsp + 0x58], r9
mov r8, qword [rcx]
mov rdx, r9
sub rdx, r8
cmp r12, rdx
jae 0x1400028a9
lea rax, [r8 + r12]
jmp 0x1400028dd
lea rdx, str.Error_during_decryption:
lea rcx, [0x1400426b0]
call fcn.1400049e0
mov rcx, rax
mov edx, dword [rbp - 0x79]
call fcn.140002ac0
mov rcx, rax
call fcn.140004c90
mov rcx, qword [rbp - 0x51]
call qword [sym.imp.bcrypt.dll_BCryptDestroyKey]
xor edx, edx
mov rcx, qword [rbp - 0x59]
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
nop
test rbx, rbx
je 0x1400027d9
sub r13, rbx
cmp r13, 0x1000
jb 0x1400027cd
add r13, 0x27
mov rcx, qword [rbx - 8]
sub rbx, rcx
lea rax, [rbx - 8]
cmp rax, 0x1f
ja 0x140002a59
mov rbx, rcx
mov rdx, r13
mov rcx, rbx
call fcn.14000d4e0
nop
test r14, r14
je 0x140002812
sub r15, r14
mov rax, r14
cmp r15, 0x1000
jb 0x140002806
add r15, 0x27
mov r14, qword [r14 - 8]
sub rax, r14
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140002a53
mov rdx, r15
mov rcx, r14
call fcn.14000d4e0
nop
mov rcx, qword [rsi]
test rcx, rcx
je 0x14000285a
mov rdx, qword [rsi + 0x10]
sub rdx, rcx
cmp rdx, 0x1000
jb 0x140002846
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140002a3b
mov rcx, r8
call fcn.14000d4e0
xor ebx, ebx
mov qword [rsi], rbx
mov qword [rsi + 8], rbx
mov qword [rsi + 0x10], rbx
jmp 0x14000285c
xor ebx, ebx
mov rcx, qword [rdi]
test rcx, rcx
je 0x140002439
mov rdx, qword [rdi + 0x10]
sub rdx, rcx
cmp rdx, 0x1000
jb 0x140002894
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140002a41
mov rcx, r8
call fcn.14000d4e0
mov qword [rdi], rbx
mov qword [rdi + 8], rbx
mov qword [rdi + 0x10], rbx
jmp 0x140002439
jbe 0x1400028e1
mov rax, qword [rcx + 0x10]
sub rax, r8
cmp r12, rax
jbe 0x1400028c1
mov rdx, r12
call fcn.140006250
jmp 0x1400028e1
sub r12, rdx
mov r8, r12
xor edx, edx
mov rcx, r9
call fcn.14002d790
mov rax, qword [rsp + 0x58]
add rax, r12
mov rcx, qword [rbp - 0x61]
mov qword [rcx + 8], rax
mov rcx, qword [rbp - 0x51]
call qword [sym.imp.bcrypt.dll_BCryptDestroyKey]
xor edx, edx
mov rcx, qword [rbp - 0x59]
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
nop
test rbx, rbx
je 0x140002931
sub r13, rbx
cmp r13, 0x1000
jb 0x140002925
add r13, 0x27
mov rcx, qword [rbx - 8]
sub rbx, rcx
lea rax, [rbx - 8]
cmp rax, 0x1f
ja 0x140002a59
mov rbx, rcx
mov rdx, r13
mov rcx, rbx
call fcn.14000d4e0
nop
test r14, r14
je 0x14000296a
sub r15, r14
mov rax, r14
cmp r15, 0x1000
jb 0x14000295e
add r15, 0x27
mov r14, qword [r14 - 8]
sub rax, r14
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140002a53
mov rdx, r15
mov rcx, r14
call fcn.14000d4e0
nop
mov rcx, qword [rsi]
test rcx, rcx
je 0x1400029b2
mov rdx, qword [rsi + 0x10]
sub rdx, rcx
cmp rdx, 0x1000
jb 0x14000299e
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140002a3b
mov rcx, r8
call fcn.14000d4e0
xor ebx, ebx
mov qword [rsi], rbx
mov qword [rsi + 8], rbx
mov qword [rsi + 0x10], rbx
jmp 0x1400029b4
xor ebx, ebx
mov rcx, qword [rdi]
test rcx, rcx
je 0x1400029f4
mov rdx, qword [rdi + 0x10]
sub rdx, rcx
cmp rdx, 0x1000
jb 0x1400029e4
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140002a41
mov rcx, r8
call fcn.14000d4e0
mov qword [rdi], rbx
mov qword [rdi + 8], rbx
mov qword [rdi + 0x10], rbx
mov al, 1
jmp 0x14000243b
lea rdx, str.Error_getting_block_length_or_block_length_mismatch:
lea rcx, [0x1400426b0]
call fcn.1400049e0
mov rcx, rax
mov edx, ebx
call fcn.140002ac0
mov rcx, rax
call fcn.140004c90
mov rcx, qword [rbp - 0x51]
call qword [sym.imp.bcrypt.dll_BCryptDestroyKey]
xor edx, edx
mov rcx, qword [rbp - 0x59]
call qword [sym.imp.bcrypt.dll_BCryptCloseAlgorithmProvider]
jmp 0x1400023b1
call fcn.140015884
nop
call fcn.140015884
nop
call fcn.1400061f0
int3
call fcn.1400013a0
int3
call fcn.140015884
nop
call fcn.140015884
int3