Function at 0x140004e50
Capabilities:
Create new key via cryptacquirecontext
Encrypt or decrypt via wincrypt
Read file on windows
Write file on windows

Disassembly:
push rbp
push r15
push r14
push r12
push rsi
push rdi
push rbx
sub rsp, 0xe0
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x58], 0xfffffffffffffffe
mov qword [rbp - 0x10], r9
mov qword [rbp + 0x18], r8
mov qword [rbp - 0x18], rdx
mov qword [rbp + 0x10], rcx
mov qword [rbp - 0x20], 0
mov qword [rbp - 0x28], 0
mov dword [rsp + 0x20], 0xf0000000
lea rcx, [rbp - 0x28]
xor edx, edx
xor r8d, r8d
mov r9d, 0x18
call sub.ADVAPI32.dll_CryptAcquireContextA
test eax, eax
je 0x1400050f6
lea rax, str.A_cryptographic_provider_has_been_acquired._n
mov qword [rbp + 0x20], rax
mov qword [rbp + 0x28], 1
lea r12, str.Utf8Errorvalid_up_to
mov qword [rbp + 0x30], r12
xorps xmm0, xmm0
movups xmmword [rbp + 0x38], xmm0
lea rcx, [rbp + 0x20]
call fcn.14000b7f0
mov rcx, qword [rbp - 0x28]
lea rsi, [rbp - 0x20]
mov qword [rsp + 0x28], rsi
mov dword [rsp + 0x20], 0
lea rdx, [0x140021a48]
mov r8d, 0x24
xor r9d, r9d
call sub.ADVAPI32.dll_CryptImportKey
test eax, eax
je 0x140005147
mov qword [rbp - 8], rsi
lea rax, [fcn.14001e7a0]
mov qword [rbp], rax
lea rax, str.Import_sucessful._Key_is_0x
mov qword [rbp + 0x20], rax
mov qword [rbp + 0x28], 2
mov qword [rbp + 0x40], 0
lea rax, [rbp - 8]
mov qword [rbp + 0x30], rax
mov qword [rbp + 0x38], 1
lea rcx, [rbp + 0x20]
call fcn.14000b7f0
mov qword [rbp - 8], 0
mov qword [rbp], 1
mov qword [rbp + 8], 0
lea rcx, [rbp - 8]
mov r8d, 0x3c0
xor edx, edx
call fcn.14001fd50
mov rsi, qword [rbp]
mov rdi, qword [rbp + 8]
lea rcx, [rsi + rdi]
mov r8d, 0x3bf
xor edx, edx
call sub.VCRUNTIME140.dll_memset
mov byte [rsi + rdi + 0x3bf], 0
lea rax, str.Memory_has_been_allocated_for_the_buffer._n
mov qword [rbp + 0x20], rax
mov qword [rbp + 0x28], 1
mov qword [rbp + 0x30], r12
xorps xmm0, xmm0
movups xmmword [rbp + 0x38], xmm0
lea rcx, [rbp + 0x20]
call fcn.14000b7f0
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
mov rcx, qword [rbp + 0x10]
mov edx, 1
mov r8d, 1
xor r9d, r9d
call sub.KERNEL32.dll_CreateFileA
mov rdi, rax
mov qword [rsp + 0x30], 0
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 4
xor r15d, r15d
mov rcx, qword [rbp + 0x18]
mov edx, 0x10002
mov r8d, 1
xor r9d, r9d
call sub.KERNEL32.dll_CreateFileA
mov rbx, rax
mov dword [rbp + 0x54], 0
lea r14, [rbp + 0x54]
nop dword [rax]
test r15d, r15d
jne 0x14000525f
mov qword [rsp + 0x20], 0
mov rcx, rdi
mov rdx, rsi
mov r8d, 0x3c0
mov r9, r14
call sub.KERNEL32.dll_ReadFile
test eax, eax
je 0x1400051e7
xor r15d, r15d
cmp dword [rbp + 0x54], 0x3c0
setb r15b
mov rcx, qword [rbp - 0x20]
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], rsi
mov dword [rsp + 0x30], 0x3c0
xor edx, edx
mov r8d, r15d
xor r9d, r9d
call sub.ADVAPI32.dll_CryptEncrypt
test eax, eax
je 0x140005210
mov r8d, dword [rbp + 0x54]
mov qword [rsp + 0x20], 0
mov rcx, rbx
mov rdx, rsi
mov r9, r14
call sub.KERNEL32.dll_WriteFile
test eax, eax
jne 0x140005040
lea rax, str.Fail_to_write_n
mov qword [rbp + 0x20], rax
mov qword [rbp + 0x28], 1
mov qword [rbp + 0x30], r12
xorps xmm0, xmm0
movups xmmword [rbp + 0x38], xmm0
lea rcx, [rbp + 0x20]
call fcn.14000b7f0
jmp 0x14000525f
call sub.KERNEL32.dll_GetLastError
mov dword [rbp - 0x40], eax
lea rax, [rbp - 0x40]
mov qword [rbp - 8], rax
lea rax, [0x14001ecf0]
mov qword [rbp], rax
lea rax, str.Error_during_CryptAcquireContext__Errror_code:__n
mov qword [rbp + 0x20], rax
mov qword [rbp + 0x28], 2
mov qword [rbp + 0x40], 0
lea rax, [rbp - 8]
mov qword [rbp + 0x30], rax
mov qword [rbp + 0x38], 1
lea rcx, [rbp + 0x20]
call fcn.14000b7f0
jmp 0x140005196
call sub.KERNEL32.dll_GetLastError
mov dword [rbp - 0x40], eax
lea rax, [rbp - 0x40]
mov qword [rbp - 8], rax
lea rax, [0x140004bb0]
mov qword [rbp], rax
lea rax, str.Import_fail
mov qword [rbp + 0x20], rax
mov qword [rbp + 0x28], 2
mov qword [rbp + 0x40], 0
lea rax, [rbp - 8]
mov qword [rbp + 0x30], rax
mov qword [rbp + 0x38], 1
lea rcx, [rbp + 0x20]
call fcn.14000b7f0
mov rcx, qword [rbp + 0x18]
mov byte [rcx], 0
mov rdx, qword [rbp - 0x10]
test rdx, rdx
je 0x1400051b1
mov r8d, 1
call fcn.140007c10
mov rcx, qword [rbp + 0x10]
mov byte [rcx], 0
xor esi, esi
mov eax, 0
mov rdx, qword [rbp - 0x18]
test rdx, rdx
je 0x1400051d5
mov r8d, 1
call fcn.140007c10
mov eax, esi
add rsp, 0xe0
pop rbx
pop rdi
pop rsi
pop r12
pop r14
pop r15
pop rbp
ret
lea rax, str.Error_reading_n
mov qword [rbp + 0x20], rax
mov qword [rbp + 0x28], 1
mov qword [rbp + 0x30], r12
xorps xmm0, xmm0
movups xmmword [rbp + 0x38], xmm0
lea rcx, [rbp + 0x20]
call fcn.14000b7f0
jmp 0x14000525f
call sub.KERNEL32.dll_GetLastError
mov dword [rbp - 0x2c], eax
lea rax, [rbp - 0x2c]
mov qword [rbp - 0x40], rax
lea rax, [0x14001e660]
mov qword [rbp - 0x38], rax
lea rax, str.Fail_to_encrypt_0x
mov qword [rbp + 0x20], rax
mov qword [rbp + 0x28], 2
mov qword [rbp + 0x40], 0
lea rax, [rbp - 0x40]
mov qword [rbp + 0x30], rax
mov qword [rbp + 0x38], 1
lea rcx, [rbp + 0x20]
call fcn.14000b7f0
mov rcx, rdi
call sub.KERNEL32.dll_CloseHandle
mov rcx, rbx
call sub.KERNEL32.dll_CloseHandle
mov rcx, qword [rbp - 0x20]
call sub.ADVAPI32.dll_CryptDestroyKey
mov rcx, qword [rbp - 0x28]
xor edx, edx
call sub.ADVAPI32.dll_CryptReleaseContext
mov rdx, qword [rbp - 8]
test rdx, rdx
je 0x14000529a
mov r8d, 1
mov rcx, rsi
call fcn.140007c10
mov rcx, qword [rbp + 0x18]
mov byte [rcx], 0
mov rdx, qword [rbp - 0x10]
test rdx, rdx
je 0x1400052b5
mov r8d, 1
call fcn.140007c10
mov rcx, qword [rbp + 0x10]
mov byte [rcx], 0
mov sil, 1
mov al, 1
mov rdx, qword [rbp - 0x18]
test rdx, rdx
jne 0x1400051c8
jmp 0x1400051d5