Function at 0x140007a98
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, 0x70
mov esi, dword [rcx + 0x18]
mov eax, 0x8004
mov rdi, rcx
xor r12d, r12d
cmp esi, 0x8009
mov r13, rdx
cmove esi, eax
mov ecx, esi
mov dword [rsp + 0x50], esi
call fcn.1400049e0
mov ecx, dword [rdi + 0x1c]
mov r15d, eax
call fcn.140004b04
mov ecx, dword [rdi + 0x1c]
mov ebx, eax
call fcn.140004a70
lea ecx, [r12 + 0x40]
lea ebp, [rax + rbx]
mov edx, ebp
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov r14, rax
test rax, rax
je 0x140007d66
mov dword [rsp + 0x40], 1
mov dword [rsp + 0x38], ebp
mov qword [rsp + 0x30], rax
mov eax, dword [rdi + 0x14]
lea r9, [rdi + 4]
lea r8d, [r12 + 0x14]
mov dword [rsp + 0x28], eax
mov rdx, r13
mov ecx, esi
mov dword [rsp + 0x20], 0x10
call fcn.140003fd4
test eax, eax
je 0x140007d5d
mov ecx, dword [rdi + 0x1c]
lea rax, [rsp + 0x60]
xor r9d, r9d
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x58]
mov r8d, ebx
mov rdx, r14
mov qword [rsp + 0x20], rax
call fcn.140004710
test eax, eax
je 0x140007d49
mov rcx, qword [rsp + 0x58]
lea r8, [r14 + rbx]
lea edx, [r12 + 1]
xor r9d, r9d
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x140007d21
mov eax, dword [rdi + 0x28]
lea ecx, [r12 + 0x40]
mov rdx, rax
mov dword [rsp + 0xb0], eax
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rbx, rax
test rax, rax
je 0x140007d21
mov r8d, dword [rsp + 0xb0]
mov rdx, qword [rdi + 0x20]
mov rcx, rax
call sub.msvcrt.dll_memcpy
mov rcx, qword [rsp + 0x58]
lea r11, [rsp + 0xb0]
mov qword [rsp + 0x28], r11
xor r9d, r9d
xor r8d, r8d
xor edx, edx
mov qword [rsp + 0x20], rbx
call qword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x140007d18
mov rsi, qword [rsp + 0xd0]
xor eax, eax
cmp dword [rdi + 0x1c], 0x6603
lea ecx, [rax + 4]
lea edi, [r12 + 0x40]
mov rdx, r15
cmove eax, ecx
mov ecx, dword [rsp + 0xb0]
sub ecx, eax
sub ecx, r15d
sub ecx, 0x10
mov dword [rsi], ecx
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rbp, rax
test rax, rax
je 0x140007d18
mov rdx, qword [rsp + 0xb8]
mov ecx, dword [rsp + 0x50]
mov dword [rsp + 0x30], r15d
mov qword [rsp + 0x28], rax
lea r8d, [r12 + 0x14]
mov r9, rbx
mov dword [rsp + 0x20], 0x10
call fcn.140003e18
test eax, eax
je 0x140007d0f
mov rdx, r15
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rdi, rax
test rax, rax
je 0x140007d0f
mov eax, dword [rsi]
mov r9d, dword [rsp + 0xb0]
mov ecx, dword [rsp + 0x50]
sub r9, rax
mov dword [rsp + 0x30], r15d
mov r8d, r15d
add r9, rbx
mov rdx, rbp
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], eax
call fcn.140003e18
test eax, eax
je 0x140007d06
lea rdx, [rbx + 0x10]
mov r8, r15
mov rcx, rdi
call sub.msvcrt.dll_memcmp
test eax, eax
sete r12b
test r12d, r12d
je 0x140007d06
mov edx, dword [rsi]
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rcx, qword [rsp + 0xc8]
mov qword [rcx], rax
test rax, rax
je 0x140007d06
mov r8d, dword [rsi]
mov edx, dword [rsp + 0xb0]
mov rcx, rax
sub rdx, r8
add rdx, rbx
call sub.msvcrt.dll_memcpy
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x58]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rsp + 0x60]
call fcn.140003d38
test eax, eax
jne 0x140007d5d
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_kull_m_dpapi_unprotect_masterkey_with_shaDerivedkey___kull_m_crypto_close_hprov_delete_container__0x_08x__n
jmp 0x140007d56
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_kull_m_dpapi_unprotect_masterkey_with_shaDerivedkey___kull_m_crypto_hkey_session__0x_08x__n
mov edx, eax
call fcn.14000a838
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, r12d
mov rbx, qword [rsp + 0xc0]
add rsp, 0x70
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret