Function at 0x140065320
Capabilities:
Encrypt or decrypt via wincrypt
Get file size
Hash data using sha1
Hash data using sha1 via wincrypt
Hash data via wincrypt
Initialize hashing via wincrypt
Read file on windows
Write file on windows

Disassembly:
mov rax, rsp
push rbp
push rdi
push r12
push r14
push r15
mov rbp, rsp
sub rsp, 0x80
mov qword [rbp - 0x18], 0xfffffffffffffffe
mov qword [rax + 0x10], rbx
mov qword [rax + 0x18], rsi
mov rdi, r8
mov r14, rdx
cmp qword [rcx + 0x18], 8
jb 0x140065355
mov rcx, qword [rcx]
xor r12d, r12d
mov qword [rsp + 0x30], r12
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
mov edx, 0x80000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r15, rax
cmp rax, 0xffffffffffffffff
jne 0x14006543d
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rax
lea rax, [rbp - 0x20]
mov qword [rbp - 8], rax
call fcn.14000d980
mov rcx, rax
test rax, rax
je 0x1400659cf
mov rax, qword [rax]
call qword [rax + 0x18]
add rax, 0x18
mov qword [rbp - 0x28], rax
lea rdx, [0x140099090]
lea rcx, [rbp - 0x28]
call fcn.14000cc80
test al, al
jne 0x1400653df
lea rdx, [0x140099090]
lea rcx, [rbp - 0x28]
call fcn.14000c480
nop
call fcn.14000d980
mov rcx, rax
test rax, rax
je 0x1400659da
mov rax, qword [rax]
call qword [rax + 0x18]
add rax, 0x18
mov qword [rbp - 0x20], rax
lea rdx, str.Failed_to_open_input_file.
lea rcx, [rbp - 0x20]
call fcn.14000cc80
test al, al
jne 0x140065423
lea rdx, str.Failed_to_open_input_file.
lea rcx, [rbp - 0x20]
call fcn.14000c480
nop
mov r8d, 0xffffffff
lea rdx, [rbp - 0x28]
lea rcx, [rbp - 0x20]
call fcn.14005c670
xor al, al
jmp 0x1400659a8
xor edx, edx
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_GetFileSize]
mov ebx, eax
mov ecx, eax
call fcn.1400699fc
mov rsi, rax
mov qword [rsp + 0x20], r12
lea r9, [rbp + 0x30]
mov r8d, ebx
mov rdx, rax
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
jne 0x140065537
lea rax, [rbp - 0x20]
mov qword [rbp - 8], rax
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rax
call fcn.14000d980
mov rcx, rax
test rax, rax
je 0x1400659e5
mov rax, qword [rax]
call qword [rax + 0x18]
add rax, 0x18
mov qword [rbp - 0x20], rax
lea rdx, [0x140099090]
lea rcx, [rbp - 0x20]
call fcn.14000cc80
test al, al
jne 0x1400654c8
lea rdx, [0x140099090]
lea rcx, [rbp - 0x20]
call fcn.14000c480
nop
call fcn.14000d980
mov rcx, rax
test rax, rax
je 0x1400659c4
mov rax, qword [rax]
call qword [rax + 0x18]
add rax, 0x18
mov qword [rbp - 0x28], rax
lea rdx, str.Failed_to_read_input_file.
lea rcx, [rbp - 0x28]
call fcn.14000cc80
test al, al
jne 0x14006550c
lea rdx, str.Failed_to_read_input_file.
lea rcx, [rbp - 0x28]
call fcn.14000c480
nop
mov r8d, 0xffffffff
lea rdx, [rbp - 0x20]
lea rcx, [rbp - 0x28]
call fcn.14005c670
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, rsi
call fcn.140069214
xor al, al
jmp 0x1400659a8
mov rcx, r15
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov dword [rsp + 0x20], 0xf0000000
mov r9d, 1
lea r8, str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
xor edx, edx
lea rcx, [rbp - 0x40]
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x140065601
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x80090016
je 0x140065583
call qword [sym.imp.KERNEL32.dll_GetLastError]
cmp eax, 0x7ff6ffea
jne 0x140065601
mov dword [rsp + 0x20], 0xf0000028
mov r9d, 1
lea r8, str.Microsoft_Enhanced_Cryptographic_Provider_v1.0
xor edx, edx
lea rcx, [rbp - 0x40]
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x140065601
lea rax, [rbp - 0x20]
mov qword [rbp - 8], rax
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rax
lea rdx, [0x140098d49]
lea rcx, [rbp - 0x20]
call fcn.14000c6f0
mov rdi, rax
lea rdx, str.CryptAcquireContext_failed.
lea rcx, [rbp - 0x28]
call fcn.14000c6f0
mov rbx, rax
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r8d, eax
mov rdx, rdi
mov rcx, rbx
call fcn.14005c670
mov rcx, rsi
call fcn.140069214
xor al, al
jmp 0x1400659a8
lea rax, [rbp - 0x38]
mov qword [rsp + 0x20], rax
xor r9d, r9d
xor r8d, r8d
mov edx, 0x8004
mov rcx, qword [rbp - 0x40]
call qword [sym.imp.ADVAPI32.dll_CryptCreateHash]
test eax, eax
jne 0x140065683
lea rax, [rbp - 0x20]
mov qword [rbp - 8], rax
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rax
lea rdx, [0x140099090]
lea rcx, [rbp - 0x20]
call fcn.14000c6f0
mov rbx, rax
lea rdx, str.CryptCreateHash_failed.
lea rcx, [rbp - 0x28]
call fcn.14000c6f0
nop
mov r8d, 0xffffffff
mov rdx, rbx
mov rcx, rax
call fcn.14005c670
xor edx, edx
mov rcx, qword [rbp - 0x40]
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov rcx, rsi
call fcn.140069214
xor al, al
jmp 0x1400659a8
mov rax, qword [rdi + 0x10]
cmp qword [rdi + 0x18], 8
jb 0x140065691
mov rdi, qword [rdi]
lea r8d, [rax + rax]
xor r9d, r9d
mov rdx, rdi
mov rcx, qword [rbp - 0x38]
call qword [sym.imp.ADVAPI32.dll_CryptHashData]
test eax, eax
jne 0x140065713
lea rax, [rbp - 0x20]
mov qword [rbp - 8], rax
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rax
lea rdx, [0x140099090]
lea rcx, [rbp - 0x20]
call fcn.14000c6f0
mov rbx, rax
lea rdx, str.CryptHashData_failed.
lea rcx, [rbp - 0x28]
call fcn.14000c6f0
nop
mov r8d, 0xffffffff
mov rdx, rbx
mov rcx, rax
call fcn.14005c670
mov rcx, qword [rbp - 0x38]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
xor edx, edx
mov rcx, qword [rbp - 0x40]
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov rcx, rsi
call fcn.140069214
xor al, al
jmp 0x1400659a8
lea rax, [rbp - 0x30]
mov qword [rsp + 0x20], rax
mov r9d, 1
mov r8, qword [rbp - 0x38]
mov edx, 0x6602
mov rcx, qword [rbp - 0x40]
call qword [sym.imp.ADVAPI32.dll_CryptDeriveKey]
test eax, eax
jne 0x140065772
lea rax, [rbp - 0x20]
mov qword [rbp - 8], rax
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rax
lea rdx, [0x140099090]
lea rcx, [rbp - 0x20]
call fcn.14000c6f0
mov rbx, rax
lea rdx, str.CryptDeriveKey_failed.
lea rcx, [rbp - 0x28]
call fcn.14000c6f0
nop
jmp 0x1400656dd
lea rax, [rbp + 0x30]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rsi
xor r9d, r9d
xor edx, edx
lea r8d, [r9 + 1]
mov rcx, qword [rbp - 0x30]
call qword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
jne 0x1400657eb
lea rax, [rbp - 0x20]
mov qword [rbp - 8], rax
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rax
lea rdx, [0x140099090]
lea rcx, [rbp - 0x20]
call fcn.14000c6f0
mov rbx, rax
lea rdx, str.CryptDecrypt_failed.
lea rcx, [rbp - 0x28]
call fcn.14000c6f0
nop
mov r8d, 0xffffffff
mov rdx, rbx
mov rcx, rax
call fcn.14005c670
mov rcx, qword [rbp - 0x30]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
jmp 0x1400656ee
mov rcx, r14
cmp qword [r14 + 0x18], 8
jb 0x1400657f8
mov rcx, qword [r14]
mov qword [rsp + 0x30], r12
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 2
xor r9d, r9d
xor r8d, r8d
mov edx, 0x40000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov rdi, rax
cmp rax, 0xffffffffffffffff
jne 0x140065860
lea rax, [rbp - 0x20]
mov qword [rbp - 8], rax
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rax
lea rdx, [0x140099090]
lea rcx, [rbp - 0x20]
call fcn.14000c6f0
mov rbx, rax
lea rdx, str.Failed_to_create_output_file.
lea rcx, [rbp - 0x28]
call fcn.14000c6f0
nop
jmp 0x1400657cb
mov ebx, r12d
mov r8d, dword [rbp + 0x30]
test r8d, r8d
je 0x14006588b
nop dword [rax]
mov eax, ebx
movzx ecx, byte [rax + rsi]
call qword [sym.imp.api_ms_win_crt_string_l1_1_0.dll_isprint]
mov r8d, dword [rbp + 0x30]
test eax, eax
jne 0x14006588b
inc ebx
cmp ebx, r8d
jb 0x140065870
sub r8d, ebx
mov edx, ebx
add rdx, rsi
mov qword [rsp + 0x20], r12
lea r9, [rbp + 0x48]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
jne 0x140065906
lea rax, [rbp - 0x20]
mov qword [rbp - 8], rax
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rax
lea rdx, [0x140099090]
lea rcx, [rbp - 0x20]
call fcn.14000c6f0
mov rbx, rax
lea rdx, str.Failed_to_write_to_output_file.
lea rcx, [rbp - 0x28]
call fcn.14000c6f0
nop
mov r8d, 0xffffffff
mov rdx, rbx
mov rcx, rax
call fcn.14005c670
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x30]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
jmp 0x1400656ee
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_CloseHandle]
mov rcx, qword [rbp - 0x30]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rbp - 0x38]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyHash]
xor edx, edx
mov rcx, qword [rbp - 0x40]
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov rcx, rsi
call fcn.140069214
mov rdx, r14
mov rcx, r14
call fcn.140064ad0
lea rdx, [0x140099090]
lea rcx, [rbp - 0x20]
test al, al
lea rax, [rbp - 0x20]
mov qword [rbp - 8], rax
lea rax, [rbp - 0x28]
mov qword [rbp - 0x10], rax
je 0x14006597c
call fcn.14000c6f0
mov rbx, rax
lea rdx, str.File_converted_to_UTF_8_and_saved_successfully.
lea rcx, [rbp - 0x28]
call fcn.14000c6f0
nop
jmp 0x140065995
call fcn.14000c6f0
mov rbx, rax
lea rdx, str.Failed_to_convert_and_save_the_file.
lea rcx, [rbp - 0x28]
call fcn.14000c6f0
nop
mov r8d, 0xffffffff
mov rdx, rbx
mov rcx, rax
call fcn.14005c670
mov al, 1
lea r11, [rsp + 0x80]
mov rbx, qword [r11 + 0x38]
mov rsi, qword [r11 + 0x40]
mov rsp, r11
pop r15
pop r14
pop r12
pop rdi
pop rbp
ret
mov ecx, 0x80004005
call fcn.14000dd90
nop
mov ecx, 0x80004005
call fcn.14000dd90
nop
mov ecx, 0x80004005
call fcn.14000dd90
nop
mov ecx, 0x80004005
call fcn.14000dd90
int3