Function at 0x140008ac8
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
mov qword [rsp + 0x18], rbx
mov qword [rsp + 0x20], r9
mov qword [rsp + 0x10], rdx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x50
mov r15d, dword [rcx + 0x18]
mov eax, 0x8004
mov rbx, rcx
xor ebp, ebp
cmp r15d, 0x8009
cmove r15d, eax
mov ecx, r15d
call fcn.140004670
mov ecx, dword [rbx + 0x1c]
mov esi, eax
call fcn.140004794
mov ecx, dword [rbx + 0x1c]
mov r12d, eax
call fcn.140004700
mov r13d, dword [rsp + 0xb0]
lea rdi, [rbx + 0x28]
mov r14d, eax
lea ecx, [rbp + 0x40]
mov eax, esi
xor edx, edx
div r14d
lea eax, [r13 + 0x10]
add esi, edx
add eax, esi
mov dword [rdi], eax
lea edx, [r14 + rax]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rbx + 0x20], rax
test rax, rax
je 0x140008d22
lea edx, [rbp + 0x10]
mov rcx, rax
call qword [sym.imp.cryptdll.dll_CDGenerateRandomBits]
mov r9, qword [rbx + 0x20]
lea r8d, [rbp + 0x14]
mov rdx, qword [rsp + 0x98]
mov ecx, r15d
mov dword [rsp + 0x30], esi
lea rax, [r9 + 0x10]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x10
call fcn.140003b84
test eax, eax
je 0x140008d11
mov rdx, qword [rbx + 0x20]
mov r8d, esi
mov r9, qword [rsp + 0xa8]
add rdx, 0x10
mov dword [rsp + 0x30], esi
mov ecx, r15d
mov qword [rsp + 0x28], rdx
mov dword [rsp + 0x20], r13d
call fcn.140003b84
test eax, eax
je 0x140008d11
mov rcx, qword [rbx + 0x20]
mov r8d, r13d
add rcx, 0x10
mov edx, esi
add rcx, rdx
mov rdx, qword [rsp + 0xa8]
call fcn.1400c2660
lea r13d, [r14 + r12]
mov edx, r13d
lea ecx, [rbp + 0x40]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rsi, rax
test rax, rax
je 0x140008d11
mov rdx, qword [rsp + 0x98]
lea r9, [rbx + 4]
mov dword [rsp + 0x40], 1
lea r8d, [rbp + 0x14]
mov dword [rsp + 0x38], r13d
mov ecx, r15d
mov qword [rsp + 0x30], rax
mov eax, dword [rbx + 0x14]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], 0x10
call fcn.140003d10
test eax, eax
je 0x140008d04
mov ecx, dword [rbx + 0x1c]
lea rax, [rsp + 0xb8]
mov qword [rsp + 0x28], rax
xor r9d, r9d
lea rax, [rsp + 0x90]
mov r8d, r12d
mov rdx, rsi
mov qword [rsp + 0x20], rax
call fcn.1400043c0
test eax, eax
je 0x140008cf8
mov rcx, qword [rsp + 0x90]
lea r15d, [rbp + 1]
mov edx, r15d
lea r8, [rsi + r12]
xor r9d, r9d
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x140008cd9
mov ecx, dword [rdi]
xor r9d, r9d
mov rax, qword [rbx + 0x20]
add ecx, r14d
mov dword [rsp + 0x30], ecx
mov r8d, r15d
mov rcx, qword [rsp + 0x90]
xor edx, edx
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_CryptEncrypt]
mov ebp, eax
test eax, eax
je 0x140008ccd
sub dword [rdi], r14d
jmp 0x140008cd9
lea rcx, str.ERROR_idwcflvcdpapi_protect_masTerKeY_with_shaDerivedkey___ERROR
call fcn.14000b8b0
mov rcx, qword [rsp + 0x90]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rsp + 0xb8]
call fcn.140003ac4
test eax, eax
jne 0x140008d04
lea rcx, str.ERROR_idwcflvcdpapi_protect_masTerKeY_with_shaDerivedkey___ERROR
call fcn.14000b8b0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LocalFree]
test ebp, ebp
jne 0x140008d22
mov rcx, qword [rbx + 0x20]
call qword [sym.imp.KERNEL32.dll_LocalFree]
and dword [rdi], 0
mov qword [rbx + 0x20], rax
mov rbx, qword [rsp + 0xa0]
mov eax, ebp
add rsp, 0x50
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret