Function at 0x18004a648
Capabilities:
Encrypt or decrypt via wincrypt

Disassembly:
mov qword [rsp + 0x10], rbx
mov qword [rsp + 0x20], r9
push rbp
push rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x60
mov r14d, dword [rcx + 0x1c]
mov eax, 0x8004
mov rdi, rcx
xor esi, esi
cmp r14d, 0x8009
mov r12d, r8d
cmove r14d, eax
mov r13, rdx
mov ecx, r14d
call fcn.180044a6c
mov ecx, dword [rdi + 0x28]
call fcn.180044b98
mov ecx, dword [rdi + 0x28]
mov ebx, eax
call fcn.180044b00
lea ecx, [rsi + 0x40]
lea r15d, [rax + rbx]
mov edx, r15d
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rbp, rax
test rax, rax
je 0x18004a85d
mov dword [rsp + 0x40], 1
mov dword [rsp + 0x38], r15d
mov qword [rsp + 0x30], rax
mov eax, dword [rdi + 0x20]
lea r15d, [rsi + 0x10]
lea r9, [rdi + 0x34]
mov dword [rsp + 0x28], eax
mov r8d, r12d
mov rdx, r13
mov ecx, r14d
mov dword [rsp + 0x20], r15d
call fcn.180044108
test eax, eax
je 0x18004a854
mov ecx, dword [rdi + 0x28]
lea rax, [rsp + 0x58]
xor r9d, r9d
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0x50]
mov r8d, ebx
mov rdx, rbp
mov qword [rsp + 0x20], rax
call fcn.1800447b4
test eax, eax
je 0x18004a840
mov rcx, qword [rsp + 0x50]
lea r14d, [rsi + 1]
lea r8, [rbx + rbp]
mov edx, r14d
xor r9d, r9d
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x18004a818
mov eax, dword [rdi + 0x54]
lea ecx, [rsi + 0x40]
mov edx, eax
mov dword [rsp + 0xa0], eax
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rbx, rax
test rax, rax
je 0x18004a818
mov r8d, dword [rsp + 0xa0]
mov rdx, qword [rdi + 0x4c]
mov rcx, rax
call fcn.1800ca790
mov rcx, qword [rsp + 0x50]
lea rax, [rsp + 0xa0]
mov qword [rsp + 0x28], rax
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 0x18004a80f
mov rcx, qword [rsp + 0xc0]
lea eax, [rsi + 0x14]
mov rdx, rbx
cmp dword [rdi + 0x2c], eax
cmovb eax, dword [rdi + 0x2c]
mov r8d, eax
call fcn.1800ca790
cmp dword [rdi + 0x30], r15d
mov edx, dword [rdi + 0x2c]
cmovb r15d, dword [rdi + 0x30]
mov rcx, qword [rsp + 0xb8]
add rdx, rbx
mov r8d, r15d
call fcn.1800ca790
mov r9d, dword [rdi + 0x30]
mov esi, r14d
add r9d, 0xfffffff0
je 0x18004a80f
xor r8d, r8d
test r9d, r9d
je 0x18004a80f
test esi, esi
je 0x18004a80f
mov edx, dword [rdi + 0x2c]
xor eax, eax
mov ecx, r8d
add rcx, rbx
cmp byte [rdx + rcx + 0x10], al
sete al
add r8d, r14d
and esi, eax
cmp r8d, r9d
jb 0x18004a7ef
mov rcx, rbx
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov rcx, qword [rsp + 0x50]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rsp + 0x58]
call fcn.1800446d0
test eax, eax
jne 0x18004a854
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_kull_m_dpapi_unprotect_credhist_entry_with_shaDerivedkey___kull_m_crypto_close_hprov_delete_container__0x_08x__n
jmp 0x18004a84d
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_kull_m_dpapi_unprotect_credhist_entry_with_shaDerivedkey___kull_m_crypto_hkey_session__0x_08x__n
mov edx, eax
call fcn.18004d68c
mov rcx, rbp
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov eax, esi
mov rbx, qword [rsp + 0xa8]
add rsp, 0x60
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret