Function at 0x140007fd0
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
mov qword [rsp + 0x20], r9
mov dword [rsp + 0x18], r8d
mov qword [rsp + 0x10], rdx
push rbx
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x78
mov ebx, dword [rcx + 0x18]
mov eax, 0x8004
mov rsi, rcx
xor edi, edi
cmp ebx, 0x8009
mov r15d, r8d
cmove ebx, eax
mov ecx, ebx
mov dword [rsp + 0x50], ebx
call fcn.1400042b0
mov ecx, dword [rsi + 0x1c]
mov r13d, eax
call fcn.1400043f0
mov ecx, dword [rsi + 0x1c]
mov ebp, eax
call fcn.140004350
lea ecx, [rdi + 0x40]
lea r14d, [rax + rbp]
mov edx, r14d
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov r12, rax
test rax, rax
je 0x14000829f
mov rdx, qword [rsp + 0xc8]
lea r9, [rsi + 4]
mov dword [rsp + 0x40], 1
mov r8d, r15d
mov dword [rsp + 0x38], r14d
mov ecx, ebx
mov qword [rsp + 0x30], rax
mov eax, dword [rsi + 0x14]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], 0x10
call fcn.1400037e0
test eax, eax
je 0x140008296
mov ecx, dword [rsi + 0x1c]
lea rax, [rsp + 0x60]
mov qword [rsp + 0x28], rax
xor r9d, r9d
lea rax, [rsp + 0x58]
mov r8d, ebp
mov rdx, r12
mov qword [rsp + 0x20], rax
call fcn.140003fd0
test eax, eax
je 0x140008282
mov rcx, qword [rsp + 0x58]
lea r8, [r12 + rbp]
xor r9d, r9d
lea edx, [rdi + 1]
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x14000825a
mov edx, dword [rsi + 0x28]
lea ecx, [rdi + 0x40]
mov dword [rsp + 0xc0], edx
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rbx, rax
test rax, rax
je 0x14000825a
mov r8d, dword [rsp + 0xc0]
mov rcx, rax
mov rdx, qword [rsi + 0x20]
call fcn.14011b4a0
mov rcx, qword [rsp + 0x58]
lea rax, [rsp + 0xc0]
mov qword [rsp + 0x28], rax
xor r9d, r9d
xor r8d, r8d
mov qword [rsp + 0x20], rbx
xor edx, edx
call qword [sym.imp.ADVAPI32.dll_CryptDecrypt]
test eax, eax
je 0x140008251
cmp dword [rsi + 0x1c], 0x6603
mov ecx, 4
mov r14, qword [rsp + 0xe0]
mov eax, edi
cmove eax, ecx
mov edx, r13d
mov ecx, dword [rsp + 0xc0]
sub ecx, eax
sub ecx, r13d
sub ecx, 0x10
mov dword [r14], ecx
lea ecx, [rdi + 0x40]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rbp, rax
test rax, rax
je 0x140008251
mov r8d, dword [rsp + 0xd0]
mov r9, rbx
mov rdx, qword [rsp + 0xc8]
mov ecx, dword [rsp + 0x50]
mov dword [rsp + 0x30], r13d
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x10
call fcn.1400035d0
test eax, eax
je 0x140008248
mov edx, r13d
lea ecx, [rdi + 0x40]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rsi, rax
test rax, rax
je 0x140008248
mov eax, dword [r14]
mov r8d, r13d
mov r9d, dword [rsp + 0xc0]
mov rdx, rbp
mov ecx, dword [rsp + 0x50]
sub r9, rax
mov dword [rsp + 0x30], r13d
add r9, rbx
mov qword [rsp + 0x28], rsi
mov dword [rsp + 0x20], eax
call fcn.1400035d0
test eax, eax
je 0x14000823f
lea rdx, [rbx + 0x10]
mov r8d, r13d
mov rcx, rsi
call fcn.1401375b0
test eax, eax
sete dil
test edi, edi
je 0x14000823f
mov edx, dword [r14]
mov ecx, 0x40
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rcx, qword [rsp + 0xd8]
mov qword [rcx], rax
test rax, rax
je 0x14000823f
mov r8d, dword [r14]
mov rcx, rax
mov edx, dword [rsp + 0xc0]
sub rdx, r8
add rdx, rbx
call fcn.14011b4a0
mov rcx, rsi
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.140003460
test eax, eax
jne 0x140008296
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 0x14000828f
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.14000afb0
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, edi
add rsp, 0x78
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret