Function at 0x140009d48
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
mov qword [rsp + 0x20], r9
mov dword [rsp + 0x18], r8d
mov qword [rsp + 0x10], rdx
push rbp
push rbx
push rsi
push rdi
push r12
push r13
push r14
push r15
mov rbp, rsp
sub rsp, 0x78
mov ebx, dword [rcx + 0x18]
xor esi, esi
mov eax, 0x8004
mov dword [rbp - 0x28], esi
mov rdi, rcx
cmp ebx, 0x8009
cmove ebx, eax
mov ecx, ebx
mov dword [rbp - 0x24], ebx
call fcn.1400055b0
mov ecx, dword [rdi + 0x1c]
mov r13d, eax
call fcn.1400056d4
mov ecx, dword [rdi + 0x1c]
mov r14d, eax
call fcn.140005640
lea ecx, [rsi + 0x40]
lea r15d, [rax + r14]
mov edx, r15d
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov r12, rax
test rax, rax
je 0x140009fe6
mov r8d, dword [rbp + 0x58]
lea r9, [rdi + 4]
mov rdx, qword [rbp + 0x50]
mov ecx, ebx
mov dword [rsp + 0x40], 1
mov dword [rsp + 0x38], r15d
mov qword [rsp + 0x30], rax
mov eax, dword [rdi + 0x14]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], 0x10
call fcn.140004a64
test eax, eax
je 0x140009fdd
mov ecx, dword [rdi + 0x1c]
lea rax, [rbp - 0x18]
mov qword [rsp + 0x28], rax
xor r9d, r9d
lea rax, [rbp - 0x20]
mov r8d, r14d
mov rdx, r12
mov qword [rsp + 0x20], rax
call fcn.140005300
test eax, eax
je 0x140009fc9
mov rcx, qword [rbp - 0x20]
lea r8, [r12 + r14]
xor r9d, r9d
lea edx, [rsi + 1]
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x140009fa3
mov edx, dword [rdi + 0x28]
lea ecx, [rsi + 0x40]
mov dword [rbp + 0x48], edx
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rbx, rax
test rax, rax
je 0x140009fa3
mov r8d, dword [rbp + 0x48]
mov rcx, rax
mov rdx, qword [rdi + 0x20]
call fcn.1400cac20
mov rcx, qword [rbp - 0x20]
lea rax, [rbp + 0x48]
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 0x140009f9a
lea ecx, [rsi + 4]
xor eax, eax
cmp dword [rdi + 0x1c], 0x6603
mov edx, r13d
mov rsi, qword [rbp + 0x68]
mov edi, 0x40
cmove eax, ecx
mov ecx, dword [rbp + 0x48]
sub ecx, eax
sub ecx, r13d
sub ecx, 0x10
mov dword [rsi], ecx
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov r14, rax
test rax, rax
je 0x140009f97
mov r8d, dword [rbp + 0x58]
mov r9, rbx
mov rdx, qword [rbp + 0x50]
mov ecx, dword [rbp - 0x24]
mov dword [rsp + 0x30], r13d
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x10
call fcn.1400048d8
test eax, eax
je 0x140009f8e
mov edx, r13d
mov ecx, edi
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rdi, rax
test rax, rax
je 0x140009f8e
mov eax, dword [rsi]
mov r8d, r13d
mov r9d, dword [rbp + 0x48]
mov rdx, r14
mov ecx, dword [rbp - 0x24]
sub r9, rax
mov dword [rsp + 0x30], r13d
add r9, rbx
mov qword [rsp + 0x28], rdi
mov dword [rsp + 0x20], eax
call fcn.1400048d8
test eax, eax
je 0x140009f85
lea rdx, [rbx + 0x10]
mov r8d, r13d
mov rcx, rdi
call fcn.1400cb580
xor ecx, ecx
test eax, eax
sete cl
mov dword [rbp - 0x28], ecx
test eax, eax
jne 0x140009f85
mov edx, dword [rsi]
lea ecx, [rax + 0x40]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rcx, qword [rbp + 0x60]
mov qword [rcx], rax
test rax, rax
je 0x140009f85
mov r8d, dword [rsi]
mov rcx, rax
mov edx, dword [rbp + 0x48]
sub rdx, r8
add rdx, rbx
call fcn.1400cac20
mov rcx, rdi
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, r14
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov esi, dword [rbp - 0x28]
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rbp - 0x20]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rbp - 0x18]
call fcn.140004810
test eax, eax
jne 0x140009fdd
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 0x140009fd6
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.14000d9f0
mov rcx, r12
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, esi
add rsp, 0x78
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbx
pop rbp
ret