Function at 0x140012380
Capabilities:
Clear file content
Create new key via cryptacquirecontext
Encrypt data using aes via winapi
Encrypt or decrypt via wincrypt
Move file
Read file on windows
Write file on windows

Disassembly:
mov rax, rsp
mov qword [rax + 8], rcx
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x1c0
movaps xmmword [rax - 0x48], xmm6
movaps xmmword [rax - 0x58], xmm7
mov rbx, rcx
lea r8, [rcx + 0x20]
cmp qword [r8 + 0x18], 7
jbe 0x1400123b2
mov r8, qword [r8]
mov rdx, rbx
cmp qword [rcx + 0x18], 7
jbe 0x1400123bf
mov rdx, qword [rcx]
lea rcx, str.____Decrypt_file:__s_____s_n
call fcn.140001b80
mov rcx, rbx
cmp qword [rbx + 0x18], 7
jbe 0x1400123d8
mov rcx, qword [rbx]
xor esi, esi
mov qword [rsp + 0x30], rsi
mov dword [rsp + 0x28], 0x80
mov dword [rsp + 0x20], 3
xor r9d, r9d
xor r8d, r8d
mov edx, 0xc0000000
call qword [sym.imp.KERNEL32.dll_CreateFileW]
mov r12, rax
mov qword [rsp + 0x48], rax
cmp rax, 0xffffffffffffffff
je 0x140012b01
xorps xmm0, xmm0
movdqu xmmword [rsp + 0xd0], xmm0
mov qword [rsp + 0xe0], rsi
mov ecx, 0x500
call fcn.140019458
mov r14, rax
mov qword [rsp + 0xf8], rax
mov qword [rsp + 0xd0], rax
lea rdi, [rax + 0x500]
mov qword [rsp + 0xe0], rdi
xor edx, edx
mov r8d, 0x500
mov rcx, rax
call fcn.14003b810
mov qword [rsp + 0xd8], rdi
xorps xmm0, xmm0
movdqu xmmword [rsp + 0xb0], xmm0
mov qword [rsp + 0xc0], rsi
mov ecx, 0x100
call fcn.140019458
mov rdi, rax
mov qword [rsp + 0xb0], rax
lea r13, [rax + 0x100]
mov qword [rsp + 0xc0], r13
xor edx, edx
mov r8d, 0x100
mov rcx, rax
call fcn.14003b810
mov qword [rsp + 0xb8], r13
xorps xmm0, xmm0
movdqu xmmword [rsp + 0x98], xmm0
mov qword [rsp + 0xa8], rsi
mov edx, 0x614
lea rcx, [rsp + 0x98]
call fcn.140006620
xor edx, edx
mov r8d, 0x614
mov r15, qword [rsp + 0x98]
mov rcx, r15
call fcn.14003b810
add r15, 0x614
mov qword [rsp + 0xa0], r15
mov dword [rsp + 0x218], esi
mov rdx, qword [rsp + 0x98]
sub r15, rdx
mov rax, qword [rbx + 0x40]
sub rax, r15
mov qword [rbx + 0x40], rax
mov qword [rsp + 0x118], rsi
mov qword [rsp + 0x120], rsi
mov qword [rsp + 0x130], rsi
mov dword [rsp + 0x128], eax
shr rax, 0x20
mov dword [rsp + 0x12c], eax
mov dword [rsp + 0x210], esi
mov dword [rsp + 0x208], esi
lea rax, [rsp + 0x118]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x208]
mov r8d, r15d
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1400129ed
mov eax, dword [rsp + 0x208]
cmp rax, r15
jne 0x1400129ed
mov r8, qword [rsp + 0xe0]
sub r8, r14
mov r15, qword [rsp + 0x98]
mov rdx, r15
mov rcx, r14
call fcn.14003b170
mov r8, r13
sub r8, rdi
mov rdx, qword [rsp + 0xe0]
sub rdx, r14
add rdx, r15
mov rcx, rdi
call fcn.14003b170
sub r13, rdi
mov rcx, qword [rsp + 0xe0]
sub rcx, r14
add rcx, r13
mov r13, qword [rcx + r15]
mov eax, dword [rcx + r15 + 8]
mov dword [rsp + 0x58], eax
mov eax, dword [rcx + r15 + 0xc]
mov dword [rsp + 0x40], eax
mov eax, dword [rcx + r15 + 0x10]
mov dword [rsp + 0x5c], eax
lea rdx, [rsp + 0xb0]
call fcn.140010fc0
mov rdi, qword [rsp + 0xb0]
test eax, eax
je 0x1400129f5
mov rax, qword [rsp + 0xb8]
mov qword [rsp + 0xf0], rdi
sub rax, rdi
cmp rax, 0x10
jne 0x1400129f5
mov dword [rsp + 0x20], 0xf0000040
lea r9d, [rsi + 0x18]
xor r8d, r8d
xor edx, edx
lea rcx, [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
je 0x140012bdc
mov dword [rsp + 0x78], 0x208
mov dword [rsp + 0x7c], 0x660e
mov dword [rsp + 0x80], 0x10
movups xmm0, xmmword [rdi]
movups xmmword [rsp + 0x84], xmm0
lea rax, [rsp + 0x68]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], esi
xor r9d, r9d
lea r8d, [r9 + 0x1c]
lea rdx, [rsp + 0x78]
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
je 0x140012c04
mov dword [rsp + 0x50], 4
mov dword [rsp + 0x20], esi
lea r9, [rsp + 0x50]
lea r8, [rsp + 0x70]
mov edx, 8
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_CryptGetKeyParam]
test eax, eax
je 0x140012c2c
shr dword [rsp + 0x70], 3
mov dword [rsp + 0x54], 2
xor r9d, r9d
lea r8, [rsp + 0x54]
lea edx, [r9 + 4]
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x140012c54
mov eax, dword [rsp + 0x40]
mov r15, r13
cmp r13, rax
cmovg r15, rax
mov qword [rsp + 0xe8], r15
mov rdi, rsi
xorps xmm0, xmm0
movdqu xmmword [rsp + 0x100], xmm0
mov rax, rsi
mov qword [rsp + 0xc8], rax
mov qword [rsp + 0x110], rax
test r15, r15
je 0x140012791
movabs rax, 0x7fffffffffffffff
cmp r15, rax
ja 0x140012c7d
mov rdx, r15
lea rcx, [rsp + 0x100]
call fcn.140006620
mov r8, r15
xor edx, edx
mov r12, qword [rsp + 0x100]
mov rcx, r12
call fcn.14003b810
mov rax, qword [rsp + 0x110]
mov qword [rsp + 0xc8], rax
jmp 0x140012799
mov r12, qword [rsp + 0x100]
test r13, r13
je 0x14001290d
movsd xmm6, qword [0x140049ee8]
movsd xmm7, qword [0x140049ef0]
mov qword [rsp + 0x78], rsi
mov qword [rsp + 0x80], rsi
mov qword [rsp + 0x90], rsi
mov dword [rsp + 0x88], edi
mov rax, rdi
shr rax, 0x20
mov dword [rsp + 0x8c], eax
mov r14, r13
sub r14, rdi
cmp r15, r14
cmovl r14, r15
lea rax, [rsp + 0x78]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x208]
mov r8d, r14d
mov rdx, r12
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_ReadFile]
test eax, eax
je 0x1400128dc
mov r15d, dword [rsp + 0x208]
cmp r15, r14
jne 0x1400128dc
xorps xmm0, xmm0
cvtsi2sd xmm0, r15
mulsd xmm0, xmm6
call fcn.14003afec
mulsd xmm0, xmm7
cvttsd2si rax, xmm0
mov dword [rsp + 0x40], eax
test eax, eax
je 0x140012875
lea rax, [rsp + 0x40]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], r12
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x1400128dc
mov r15d, dword [rsp + 0x208]
lea rax, [rsp + 0x78]
mov qword [rsp + 0x20], rax
lea r9, [rsp + 0x210]
mov r8d, r15d
mov rdx, r12
mov rcx, qword [rsp + 0x48]
call qword [sym.imp.KERNEL32.dll_WriteFile]
test eax, eax
je 0x1400128dc
mov eax, dword [rsp + 0x208]
cmp dword [rsp + 0x210], eax
jne 0x1400128dc
add rdi, r14
cmp dword [rsp + 0x58], 1
jne 0x1400128ca
mov rcx, r13
sub rcx, rdi
mov eax, dword [rsp + 0x5c]
cmp rax, rcx
cmovge rax, rcx
add rdi, rax
cmp rdi, r13
je 0x14001290d
mov r15, qword [rsp + 0xe8]
jmp 0x1400127b2
cmp rdi, r13
je 0x14001290d
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rdx, rbx
cmp qword [rbx + 0x18], 7
jbe 0x1400128f4
mov rdx, qword [rbx]
mov qword [rsp + 0x20], r13
mov r9, rdi
mov r8d, eax
lea rcx, str.____File_not_decrypted:__s__error:_0x_X___lld____lld_n
call fcn.140001b80
jmp 0x14001297e
xor r9d, r9d
xor r8d, r8d
mov rdx, qword [rbx + 0x40]
mov rdi, qword [rsp + 0x48]
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SetFilePointerEx]
test eax, eax
je 0x14001295c
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_SetEndOfFile]
test eax, eax
je 0x14001295c
mov rdx, rbx
cmp qword [rbx + 0x18], 7
jbe 0x140012943
mov rdx, qword [rbx]
lea rcx, str.___Decrypted_file:__s_n
call fcn.140001b80
mov dword [rsp + 0x218], 1
jmp 0x14001297e
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov rdx, rbx
cmp qword [rbx + 0x18], 7
jbe 0x14001296f
mov rdx, qword [rbx]
mov r8d, eax
lea rcx, str.____File_is_not_cropped:__s__error:_0x_X_n
call fcn.140001b80
test r12, r12
je 0x1400129c0
mov rcx, qword [rsp + 0xc8]
sub rcx, r12
mov rax, r12
cmp rcx, 0x1000
jb 0x1400129b4
add rcx, 0x27
mov r12, qword [r12 - 8]
sub rax, r12
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140012c82
mov rdx, rcx
mov rcx, r12
call fcn.140019450
nop
mov rcx, qword [rsp + 0x68]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
xor edx, edx
mov rcx, qword [rsp + 0x60]
call qword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov rdi, qword [rsp + 0xf0]
mov r14, qword [rsp + 0xf8]
mov r12, qword [rsp + 0x48]
mov r15, qword [rsp + 0x98]
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_CloseHandle]
cmp dword [rsp + 0x218], 0
je 0x140012a47
lea rdx, [rbx + 0x20]
cmp qword [rdx + 0x18], 7
jbe 0x140012a16
mov rdx, qword [rdx]
mov rcx, rbx
cmp qword [rbx + 0x18], 7
jbe 0x140012a23
mov rcx, qword [rbx]
call qword [sym.imp.KERNEL32.dll_MoveFileW]
test eax, eax
jne 0x140012a47
mov rdx, rbx
cmp qword [rbx + 0x18], 7
jbe 0x140012a3a
mov rdx, qword [rbx]
lea rcx, str.____Decrypted_file_not_moved:__s_n
call fcn.140001b80
nop
test r15, r15
je 0x140012a85
mov rdx, qword [rsp + 0xa8]
sub rdx, r15
mov rax, r15
cmp rdx, 0x1000
jb 0x140012a7c
add rdx, 0x27
mov r15, qword [r15 - 8]
sub rax, r15
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140012c88
mov rcx, r15
call fcn.140019450
nop
test rdi, rdi
je 0x140012ac3
mov rdx, qword [rsp + 0xc0]
sub rdx, rdi
mov rax, rdi
cmp rdx, 0x1000
jb 0x140012aba
add rdx, 0x27
mov rdi, qword [rdi - 8]
sub rax, rdi
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
ja 0x140012c8e
mov rcx, rdi
call fcn.140019450
nop
test r14, r14
je 0x140012b01
mov rdx, qword [rsp + 0xe0]
sub rdx, r14
cmp rdx, 0x1000
jb 0x140012af8
add rdx, 0x27
mov rcx, qword [r14 - 8]
sub r14, rcx
lea rax, [r14 - 8]
cmp rax, 0x1f
ja 0x140012c94
mov r14, rcx
mov rcx, r14
call fcn.140019450
nop
jmp 0x140012b0d
mov rdx, qword [rbx + 0x38]
cmp rdx, 7
jbe 0x140012b4d
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbx + 0x20]
cmp rdx, 0x1000
jb 0x140012b48
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140012bd6
mov rcx, r8
call fcn.140019450
mov qword [rbx + 0x30], rsi
mov qword [rbx + 0x38], 7
mov word [rbx + 0x20], si
mov rdx, qword [rbx + 0x18]
cmp rdx, 7
jbe 0x140012b98
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbx]
cmp rdx, 0x1000
jb 0x140012b93
add rdx, 0x27
mov r8, qword [rcx - 8]
sub rcx, r8
lea rax, [rcx - 8]
cmp rax, 0x1f
ja 0x140012bd6
mov rcx, r8
call fcn.140019450
mov qword [rbx + 0x10], rsi
mov qword [rbx + 0x18], 7
mov word [rbx], si
mov edx, 0x48
mov rcx, rbx
movaps xmm6, xmmword [rsp + 0x1b0]
movaps xmm7, xmmword [rsp + 0x1a0]
add rsp, 0x1c0
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
jmp fcn.140019450
call fcn.14002a6d4
nop
lea rdx, str.Failed_to_acquire_cryptographic_context.
lea rcx, [rsp + 0x140]
call fcn.1400014e0
lea rdx, [0x14004f090]
lea rcx, [rsp + 0x140]
call fcn.14001b0e0
lea rdx, str.Failed_to_import_key.
lea rcx, [rsp + 0x158]
call fcn.1400014e0
lea rdx, [0x14004f090]
lea rcx, [rsp + 0x158]
call fcn.14001b0e0
lea rdx, str.Failed_to_get_block_size.
lea rcx, [rsp + 0x170]
call fcn.1400014e0
lea rdx, [0x14004f090]
lea rcx, [rsp + 0x170]
call fcn.14001b0e0
lea rdx, str._Error_setting_the_chaining_mode
lea rcx, [rsp + 0x188]
call fcn.1400014e0
lea rdx, [0x14004f090]
lea rcx, [rsp + 0x188]
call fcn.14001b0e0
nop
call fcn.140003790
call fcn.14002a6d4
nop
call fcn.14002a6d4
nop
call fcn.14002a6d4
nop
call fcn.14002a6d4
int3