Function at 0x140012260
Capabilities:
Encrypt or decrypt via wincrypt
Print debug messages

Disassembly:
push rbp
push rbx
push rdi
lea rbp, [rsp - 0x47]
sub rsp, 0xc0
mov qword [rbp - 0x41], 0xfffffffffffffffe
mov rax, qword [0x140030010]
xor rax, rsp
mov qword [rbp + 0x37], rax
mov ebx, r8d
xor dil, dil
cmp byte [rcx], dil
je 0x140012545
mov dword [rbp - 0x49], ebx
lea rax, [rbp - 0x49]
mov qword [rsp + 0x28], rax
mov qword [rsp + 0x20], rdx
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov rcx, qword [rcx + 0x10]
call qword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
setne dil
test eax, eax
je 0x14001240a
cmp dword [rbp - 0x49], ebx
sete dil
je 0x140012552
lea rcx, str.AESCryptoUtility:_Failure_occurred_in_CryptDecrypt._All_bytes_were_not_decrypted_n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea r10, [rbp + 0x31]
nop dword [rax]
sub r10, 2
mov eax, 0xcccccccd
mul r9d
shr edx, 3
movzx ecx, dx
shl cx, 2
lea r8d, [rcx + rdx]
add r8w, r8w
sub r9w, r8w
add r9w, 0x30
mov word [r10], r9w
mov r9d, edx
test edx, edx
jne 0x1400122f0
xor eax, eax
mov qword [rbp - 0x29], rax
mov qword [rbp - 0x21], 7
mov word [rbp - 0x39], ax
lea rax, [rbp + 0x31]
cmp r10, rax
je 0x140012354
lea r8, [rbp + 0x31]
sub r8, r10
sar r8, 1
mov rdx, r10
lea rcx, [rbp - 0x39]
call fcn.14000f500
nop
lea r8, [rbp - 0x39]
lea rdx, str.Error_code_:
lea rcx, [rbp - 0x19]
call fcn.14000f8a0
nop
mov rdx, qword [rbp - 0x21]
cmp rdx, 8
jb 0x1400123ac
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x39]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400123a7
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400123a7
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14001d9e0
lea rcx, [rbp - 0x19]
cmp qword [rbp - 1], 8
cmovae rcx, qword [rbp - 0x19]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov rdx, qword [rbp - 1]
cmp rdx, 8
jb 0x140012552
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x19]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14001253e
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x14001253e
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
lea rcx, str.AESCryptoUtility:_Failure_occurred_in_CryptDecrypt_n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov r9d, eax
lea r10, [rbp + 0x31]
nop dword [rax]
nop dword [rax + rax]
sub r10, 2
mov eax, 0xcccccccd
mul r9d
shr edx, 3
movzx ecx, dx
shl cx, 2
lea r8d, [rcx + rdx]
add r8w, r8w
sub r9w, r8w
add r9w, 0x30
mov word [r10], r9w
mov r9d, edx
test edx, edx
jne 0x140012430
xor eax, eax
mov qword [rbp - 0x29], rax
mov qword [rbp - 0x21], 7
mov word [rbp - 0x39], ax
lea rax, [rbp + 0x31]
cmp r10, rax
je 0x140012494
lea r8, [rbp + 0x31]
sub r8, r10
sar r8, 1
mov rdx, r10
lea rcx, [rbp - 0x39]
call fcn.14000f500
nop
lea r8, [rbp - 0x39]
lea rdx, str.Error_code_:
lea rcx, [rbp - 0x19]
call fcn.14000f8a0
nop
mov rdx, qword [rbp - 0x21]
cmp rdx, 8
jb 0x1400124ec
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x39]
mov rax, rcx
cmp rdx, 0x1000
jb 0x1400124e7
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x1400124e7
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14001d9e0
lea rcx, [rbp - 0x19]
cmp qword [rbp - 1], 8
cmovae rcx, qword [rbp - 0x19]
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
mov rdx, qword [rbp - 1]
cmp rdx, 8
jb 0x140012552
lea rdx, [rdx*2 + 2]
mov rcx, qword [rbp - 0x19]
mov rax, rcx
cmp rdx, 0x1000
jb 0x14001253e
add rdx, 0x27
mov rcx, qword [rcx - 8]
sub rax, rcx
add rax, 0xfffffffffffffff8
cmp rax, 0x1f
jbe 0x14001253e
call qword [sym.imp.api_ms_win_crt_runtime_l1_1_0.dll__invalid_parameter_noinfo_noreturn]
int3
call fcn.14001d9e0
jmp 0x140012552
lea rcx, str.AESCryptoUtility:_Decryption_failed._Key_was_not_initialized_n
call qword [sym.imp.KERNEL32.dll_OutputDebugStringW]
movzx eax, dil
mov rcx, qword [rbp + 0x37]
xor rcx, rsp
call fcn.14001d660
add rsp, 0xc0
pop rdi
pop rbx
pop rbp
ret