Function at 0x140009054
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, 0x60
mov r14d, dword [rcx + 0x18]
mov eax, 0x8004
mov rbx, rcx
xor ebp, ebp
cmp r14d, 0x8009
cmove r14d, eax
mov ecx, r14d
call fcn.1400049d0
mov ecx, dword [rbx + 0x1c]
mov esi, eax
call fcn.140004af4
mov ecx, dword [rbx + 0x1c]
mov r13d, eax
call fcn.140004a60
mov r15d, dword [rsp + 0xc0]
mov r12d, eax
mov eax, esi
xor edx, edx
div r12d
lea rdi, [rbx + 0x28]
lea ecx, [rbp + 0x40]
add esi, edx
lea eax, [rsi + r15 + 0x10]
mov dword [rdi], eax
lea edx, [r12 + rax]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov qword [rbx + 0x20], rax
test rax, rax
je 0x1400092c2
lea edx, [rbp + 0x10]
mov rcx, rax
call sub.cryptdll.dll_CDGenerateRandomBits
mov r9, qword [rbx + 0x20]
mov rdx, qword [rsp + 0xa8]
lea rax, [r9 + 0x10]
mov dword [rsp + 0x30], esi
lea r8d, [rbp + 0x14]
mov qword [rsp + 0x28], rax
mov ecx, r14d
mov dword [rsp + 0x20], 0x10
call fcn.140003e0c
test eax, eax
je 0x1400092b1
mov rdx, qword [rbx + 0x20]
mov r9, qword [rsp + 0xb8]
mov dword [rsp + 0x30], esi
add rdx, 0x10
mov r8d, esi
mov ecx, r14d
mov qword [rsp + 0x28], rdx
mov dword [rsp + 0x20], r15d
call fcn.140003e0c
test eax, eax
je 0x1400092b1
mov rax, qword [rbx + 0x20]
mov rdx, qword [rsp + 0xb8]
mov r8, r15
lea rcx, [rsi + rax + 0x10]
call sub.msvcrt.dll_memcpy
lea r15d, [r12 + r13]
lea ecx, [rbp + 0x40]
mov edx, r15d
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rsi, rax
test rax, rax
je 0x1400092b1
mov rdx, qword [rsp + 0xa8]
mov dword [rsp + 0x40], 1
mov dword [rsp + 0x38], r15d
mov qword [rsp + 0x30], rax
mov eax, dword [rbx + 0x14]
lea r9, [rbx + 4]
mov dword [rsp + 0x28], eax
lea r8d, [rbp + 0x14]
mov ecx, r14d
mov dword [rsp + 0x20], 0x10
call fcn.140003fc8
test eax, eax
je 0x1400092a4
mov ecx, dword [rbx + 0x1c]
lea rax, [rsp + 0x50]
xor r9d, r9d
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0xa0]
mov r8d, r13d
mov rdx, rsi
mov qword [rsp + 0x20], rax
call fcn.140004704
test eax, eax
je 0x140009290
mov rcx, qword [rsp + 0xa0]
lea r8, [rsi + r13]
lea r13d, [rbp + 1]
mov edx, r13d
xor r9d, r9d
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x140009265
mov eax, dword [rdi]
xor r9d, r9d
mov r8d, r13d
lea ecx, [r12 + rax]
mov rax, qword [rbx + 0x20]
xor edx, edx
mov dword [rsp + 0x30], ecx
mov rcx, qword [rsp + 0xa0]
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_CryptEncrypt]
mov ebp, eax
test eax, eax
je 0x140009251
sub dword [rdi], r12d
jmp 0x140009265
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_kull_m_dpapi_protect_masterkey_with_shaDerivedkey___CryptEncrypt__0x_08x__n
mov edx, eax
call fcn.14000c020
mov rcx, qword [rsp + 0xa0]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rsp + 0x50]
call fcn.140003d2c
test eax, eax
jne 0x1400092a4
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_kull_m_dpapi_protect_masterkey_with_shaDerivedkey___kull_m_crypto_close_hprov_delete_container__0x_08x__n
jmp 0x14000929d
call qword [sym.imp.KERNEL32.dll_GetLastError]
lea rcx, str.ERROR_kull_m_dpapi_protect_masterkey_with_shaDerivedkey___kull_m_crypto_hkey_session__0x_08x__n
mov edx, eax
call fcn.14000c020
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LocalFree]
test ebp, ebp
jne 0x1400092c2
mov rcx, qword [rbx + 0x20]
call qword [sym.imp.KERNEL32.dll_LocalFree]
and dword [rdi], 0
mov qword [rbx + 0x20], rax
mov eax, ebp
mov rbx, qword [rsp + 0xb0]
add rsp, 0x60
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
ret