Function at 0x1400082c0
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 ebp, dword [rcx + 0x18]
mov eax, 0x8004
mov rbx, rcx
xor edi, edi
cmp ebp, 0x8009
cmove ebp, eax
mov ecx, ebp
call fcn.1400042b0
mov ecx, dword [rbx + 0x1c]
mov esi, eax
call fcn.1400043f0
mov ecx, dword [rbx + 0x1c]
mov r12d, eax
call fcn.140004350
mov r13d, dword [rsp + 0xb0]
lea r14, [rbx + 0x28]
mov r15d, eax
lea ecx, [rdi + 0x40]
mov eax, esi
xor edx, edx
div r15d
lea eax, [r13 + 0x10]
add esi, edx
add eax, esi
mov dword [r14], eax
lea edx, [r15 + rax]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rbx + 0x20], rax
test rax, rax
je 0x140008526
lea edx, [rdi + 0x10]
mov rcx, rax
call qword [sym.imp.cryptdll.dll_CDGenerateRandomBits]
mov r9, qword [rbx + 0x20]
lea r8d, [rdi + 0x14]
mov rdx, qword [rsp + 0x98]
mov ecx, ebp
mov dword [rsp + 0x30], esi
lea rax, [r9 + 0x10]
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x10
call fcn.1400035d0
test eax, eax
je 0x140008511
mov rdx, qword [rbx + 0x20]
mov r8d, esi
mov r9, qword [rsp + 0xa8]
add rdx, 0x10
mov dword [rsp + 0x30], esi
mov ecx, ebp
mov qword [rsp + 0x28], rdx
mov dword [rsp + 0x20], r13d
call fcn.1400035d0
test eax, eax
je 0x140008511
mov rcx, qword [rbx + 0x20]
mov r8d, r13d
add rcx, 0x10
mov edx, esi
add rcx, rdx
mov rdx, qword [rsp + 0xa8]
call fcn.14011b4a0
lea r13d, [r15 + r12]
mov edx, r13d
lea ecx, [rdi + 0x40]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rsi, rax
test rax, rax
je 0x140008511
mov rdx, qword [rsp + 0x98]
lea r9, [rbx + 4]
mov dword [rsp + 0x40], 1
lea r8d, [rdi + 0x14]
mov dword [rsp + 0x38], r13d
mov ecx, ebp
mov qword [rsp + 0x30], rax
mov eax, dword [rbx + 0x14]
mov dword [rsp + 0x28], eax
mov dword [rsp + 0x20], 0x10
call fcn.1400037e0
test eax, eax
je 0x140008504
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.140003fd0
test eax, eax
je 0x140008540
mov rcx, qword [rsp + 0x90]
lea r8, [rsi + r12]
xor r9d, r9d
lea edx, [rdi + 1]
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x1400084d1
mov ecx, dword [r14]
lea r8d, [rdi + 1]
mov rax, qword [rbx + 0x20]
add ecx, r15d
mov dword [rsp + 0x30], ecx
xor r9d, r9d
mov rcx, qword [rsp + 0x90]
xor edx, edx
mov qword [rsp + 0x28], r14
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_CryptEncrypt]
mov edi, eax
test eax, eax
je 0x1400084bd
sub dword [r14], r15d
jmp 0x1400084d1
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_kull_m_dpapi_protect_masterkey_with_shaDerivedkey___CryptEncrypt__0x_08x__n
call fcn.14000afb0
mov rcx, qword [rsp + 0x90]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rsp + 0xb8]
call fcn.140003460
test eax, eax
jne 0x140008504
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_kull_m_dpapi_protect_masterkey_with_shaDerivedkey___kull_m_crypto_close_hprov_delete_container__0x_08x__n
call fcn.14000afb0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LocalFree]
test edi, edi
jne 0x140008526
mov rcx, qword [rbx + 0x20]
call qword [sym.imp.KERNEL32.dll_LocalFree]
mov qword [rbx + 0x20], rax
mov dword [r14], 0
mov rbx, qword [rsp + 0xa0]
mov eax, edi
add rsp, 0x50
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret
call qword [sym.imp.KERNEL32.dll_GetLastError]
mov edx, eax
lea rcx, str.ERROR_kull_m_dpapi_protect_masterkey_with_shaDerivedkey___kull_m_crypto_hkey_session__0x_08x__n
call fcn.14000afb0
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LocalFree]
jmp 0x140008511