Function at 0x140160a50
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using aes via winapi
Encrypt or decrypt via wincrypt

Disassembly:
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
lea rbp, [rsp - 0xf]
sub rsp, 0xd8
mov rax, qword [0x140351248]
xor rax, rsp
mov qword [rbp - 1], rax
mov r15, qword [rbp + 0x77]
xor eax, eax
mov r14, qword [rbp + 0x7f]
xorps xmm0, xmm0
mov ebx, r9d
mov r12, r8
mov qword [rbp - 0x79], rcx
mov r13, rdx
mov qword [rbp - 0x71], rax
lea esi, [rax + 1]
mov qword [rbp - 0x69], rax
mov qword [rbp - 0x59], rax
movups xmmword [rbp - 0x51], xmm0
test r8, r8
jne 0x140160b85
test r15, r15
je 0x140160b85
lea r8, [rbp - 0x51]
xor edx, edx
mov rcx, r15
call fcn.1401616c0
test eax, eax
je 0x140160b7c
mov ebx, dword [rbp - 0x51]
test ebx, ebx
je 0x140160b73
mov ecx, ebx
call fcn.1401c030c
mov qword [rbp - 0x49], rax
mov rdi, rax
test rax, rax
jne 0x140160b4c
lea ecx, [rsi + 0x2f]
mov qword [rsp + 0x30], r12
mov qword [rsp + 0x40], r12
mov qword [rsp + 0x48], SafeArrayLock
call fcn.1400b88d0
movups xmm0, xmmword [str._AES256__prepareData__Not_enough_memory.]
mov qword [rsp + 0x40], 0x28
lea rcx, [rsp + 0x30]
mov qword [rsp + 0x48], 0x2f
movups xmmword [rax], xmm0
movups xmm1, xmmword [0x14027ad58]
movups xmmword [rax + 0x10], xmm1
movsd xmm0, qword [0x14027ad68]
movsd qword [rax + 0x20], xmm0
mov byte [rax + 0x28], r12b
mov qword [rsp + 0x30], rax
jmp 0x140160bf2
lea r8, [rbp - 0x51]
mov rdx, rax
mov rcx, r15
call fcn.1401616c0
mov rdi, qword [rbp - 0x49]
test eax, eax
jne 0x140160b6b
xor r12d, r12d
jmp 0x140160bf7
mov ebx, dword [rbp - 0x51]
jmp 0x140160c78
mov rdi, qword [rbp - 0x49]
jmp 0x140160c78
mov rdi, qword [rbp - 0x49]
xor r12d, r12d
jmp 0x140160bf7
mov rcx, rbx
call fcn.1401c030c
mov rdi, rax
test rax, rax
jne 0x140160c6a
xor r12d, r12d
mov qword [rbp - 0x39], SafeArrayLock
lea ecx, [rax + 0x30]
mov qword [rbp - 0x51], r12
mov qword [rbp - 0x41], r12
call fcn.1400b88d0
movups xmm0, xmmword [str._AES256__prepareData__Not_enough_memory.]
mov qword [rbp - 0x41], 0x28
lea rcx, [rbp - 0x51]
mov qword [rbp - 0x39], 0x2f
movups xmmword [rax], xmm0
movups xmm1, xmmword [0x14027ad58]
movups xmmword [rax + 0x10], xmm1
movsd xmm0, qword [0x14027ad68]
movsd qword [rax + 0x20], xmm0
mov byte [rax + 0x28], r12b
mov qword [rbp - 0x51], rax
call fcn.140162100
mov ecx, 0x30
mov qword [rsp + 0x30], r12
mov esi, r12d
mov qword [rsp + 0x40], r12
mov qword [rsp + 0x48], SafeArrayLock
call fcn.1400b88d0
movups xmm0, xmmword [str._AES256__AESDecrypt__prepareData_error]
mov qword [rsp + 0x40], 0x26
mov qword [rsp + 0x48], 0x2f
movups xmmword [rax], xmm0
movups xmm1, xmmword [0x14027ae50]
movups xmmword [rax + 0x10], xmm1
mov ecx, dword [0x14027ae60]
mov dword [rax + 0x20], ecx
movzx ecx, word [0x14027ae64]
mov word [rax + 0x24], cx
lea rcx, [rsp + 0x30]
mov byte [rax + 0x26], 0
mov qword [rsp + 0x30], rax
call fcn.140162100
jmp 0x140160ff5
mov r8, rbx
mov rdx, r12
mov rcx, rax
call fcn.1401f7750
xor r12d, r12d
lea rcx, [rbp - 0x69]
xor r8d, r8d
mov dword [rsp + 0x20], r12d
xor edx, edx
lea r9d, [r12 + 0x18]
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x140160d3f
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x80090016
jne 0x140160d3f
lea r9d, [r12 + 0x18]
mov dword [rsp + 0x20], 8
xor r8d, r8d
lea rcx, [rbp - 0x69]
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextA]
test eax, eax
jne 0x140160d3f
lea ecx, [rax + 0x40]
mov qword [rsp + 0x30], r12
mov qword [rsp + 0x40], r12
mov qword [rsp + 0x48], SafeArrayLock
call fcn.1400b88d0
movups xmm0, xmmword [str._AES256__AESDecrypt__Get_provider_context_failed_]
mov qword [rsp + 0x40], 0x31
mov qword [rsp + 0x48], 0x3f
movups xmmword [rax], xmm0
movups xmm1, xmmword [0x14027ae78]
movups xmmword [rax + 0x10], xmm1
movups xmm0, xmmword [0x14027ae88]
movups xmmword [rax + 0x20], xmm0
movzx ecx, byte [0x14027ae98]
mov byte [rax + 0x30], cl
mov byte [rax + 0x31], r12b
lea rcx, [rsp + 0x30]
mov qword [rsp + 0x30], rax
call fcn.140162100
mov esi, r12d
jmp 0x140160ff5
mov r15, qword [rbp - 0x79]
lea rax, [rbp - 0x71]
mov rcx, qword [rbp - 0x69]
lea rdx, [rbp - 0x31]
xor r9d, r9d
mov qword [rsp + 0x28], rax
mov dword [rbp - 0x31], 0x208
movups xmm0, xmmword [r15]
mov dword [rbp - 0x2d], 0x6610
movups xmm1, xmmword [r15 + 0x10]
lea r8d, [r9 + 0x2c]
mov dword [rbp - 0x29], 0x20
movups xmmword [rbp - 0x25], xmm0
mov dword [rsp + 0x20], esi
movups xmmword [rbp - 0x15], xmm1
call qword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0x140160df8
lea ecx, [rax + 0x30]
mov qword [rsp + 0x30], r12
mov qword [rsp + 0x40], r12
mov qword [rsp + 0x48], SafeArrayLock
call fcn.1400b88d0
movups xmm0, xmmword [str._AES256__AESDecrypt__Create_key_failed_]
mov qword [rsp + 0x40], 0x27
mov qword [rsp + 0x48], 0x2f
movups xmmword [rax], xmm0
movups xmm1, xmmword [0x14027aeb0]
movups xmmword [rax + 0x10], xmm1
mov ecx, dword [0x14027aec0]
mov dword [rax + 0x20], ecx
movzx ecx, word [0x14027aec4]
mov word [rax + 0x24], cx
movzx ecx, byte [0x14027aec6]
mov byte [rax + 0x26], cl
mov byte [rax + 0x27], r12b
jmp 0x140160d28
mov rcx, qword [rbp - 0x71]
xor r9d, r9d
mov edx, esi
test r13, r13
jne 0x140160e9b
mov r8, r15
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
jne 0x140160ea3
lea ecx, [rax + 0x40]
mov qword [rsp + 0x30], r12
mov qword [rsp + 0x40], r12
mov qword [rsp + 0x48], SafeArrayLock
call fcn.1400b88d0
movups xmm0, xmmword [str._AES256__AESDecrypt__Set_keys_IV_parameter_failed_]
mov qword [rsp + 0x40], 0x33
mov rdx, rax
mov qword [rsp + 0x48], 0x3f
movups xmmword [rax], xmm0
movups xmm1, xmmword [0x14027aed8]
movups xmmword [rax + 0x10], xmm1
movups xmm0, xmmword [0x14027aee8]
movups xmmword [rax + 0x20], xmm0
movzx ecx, word [0x14027aef8]
mov word [rax + 0x30], cx
lea rcx, [rsp + 0x30]
movzx eax, byte [0x14027aefa]
mov byte [rdx + 0x32], al
mov byte [rdx + 0x33], r12b
mov qword [rsp + 0x30], rdx
call fcn.140162100
mov esi, r12d
jmp 0x140160ff5
mov r8, r13
jmp 0x140160e0d
xorps xmm0, xmm0
mov rcx, rbx
movups xmmword [rbp - 0x61], xmm0
mov dword [rbp - 0x61], ebx
call fcn.1401c030c
mov r8, rbx
mov qword [rbp - 0x59], rax
mov rdx, rdi
mov rcx, rax
call fcn.1401f7750
mov rcx, qword [rbp - 0x71]
lea rax, [rbp - 0x61]
mov qword [rsp + 0x28], rax
xor r9d, r9d
mov rax, qword [rbp - 0x59]
mov r8d, esi
xor edx, edx
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
jne 0x140160f47
lea ecx, [rax + 0x30]
mov qword [rsp + 0x30], r12
mov qword [rsp + 0x40], r12
mov qword [rsp + 0x48], SafeArrayLock
call fcn.1400b88d0
movups xmm0, xmmword [str._AES256__AESDecrypt__AES_decrypt_failed_]
mov qword [rsp + 0x40], 0x28
mov qword [rsp + 0x48], 0x2f
movups xmmword [rax], xmm0
movups xmm1, xmmword [0x14027af10]
movups xmmword [rax + 0x10], xmm1
movsd xmm0, qword [0x14027af20]
movsd qword [rax + 0x20], xmm0
mov byte [rax + 0x28], r12b
jmp 0x140160d28
mov r8d, dword [rbp - 0x61]
lea rcx, [rbp - 0x51]
mov rdx, qword [rbp - 0x59]
mov qword [rbp - 0x51], r12
mov qword [rbp - 0x41], r12
mov qword [rbp - 0x39], SafeArrayLock
call fcn.1400cf610
lea rax, [rbp - 0x51]
cmp r14, rax
je 0x140160fbe
mov rdx, qword [r14 + 0x18]
cmp rdx, 0x10
jb 0x140160fab
mov rcx, qword [r14]
inc rdx
cmp rdx, 0x1000
jb 0x140160fa6
mov r8, qword [rcx - 8]
add rdx, 0x27
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x14016105a
mov rcx, r8
call fcn.1401bfb10
movups xmm0, xmmword [rbp - 0x51]
movups xmm1, xmmword [rbp - 0x41]
movups xmmword [r14], xmm0
movups xmmword [r14 + 0x10], xmm1
jmp 0x140160ff5
mov rdx, qword [rbp - 0x39]
cmp rdx, 0x10
jb 0x140160ff5
mov rcx, qword [rbp - 0x51]
inc rdx
mov rax, rcx
cmp rdx, 0x1000
jb 0x140160ff0
mov rcx, qword [rcx - 8]
add rdx, 0x27
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x14016105a
call fcn.1401bfb10
mov rcx, qword [rbp - 0x59]
test rcx, rcx
je 0x140161007
call fcn.1401c028c
mov qword [rbp - 0x59], r12
test rdi, rdi
je 0x140161014
mov rcx, rdi
call fcn.1401c028c
mov rcx, qword [rbp - 0x71]
test rcx, rcx
je 0x140161027
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov qword [rbp - 0x71], r12
mov rcx, qword [rbp - 0x69]
test rcx, rcx
je 0x140161038
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, esi
mov rcx, qword [rbp - 1]
xor rcx, rsp
call fcn.1401c0070
add rsp, 0xd8
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret
call sub.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn
int3