Function at 0x180049d3c
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, 0x68
mov r15d, dword [rcx + 0x18]
mov eax, 0x8004
mov rbx, rcx
xor ebp, ebp
cmp r15d, 0x8009
cmove r15d, eax
mov ecx, r15d
call fcn.180044a6c
mov ecx, dword [rbx + 0x1c]
mov esi, eax
call fcn.180044b98
mov ecx, dword [rbx + 0x1c]
mov r12d, eax
call fcn.180044b00
mov r13d, dword [rsp + 0xd0]
mov r14d, eax
mov eax, esi
xor edx, edx
div r14d
lea eax, [r13 + 0x10]
lea rdi, [rbx + 0x28]
add esi, edx
lea ecx, [rbp + 0x40]
add eax, esi
mov dword [rdi], eax
lea edx, [r14 + rax]
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rcx, rax
mov qword [rbx + 0x20], rax
test rax, rax
je 0x180049fd1
mov rax, qword [rsp + 0xd8]
test rax, rax
je 0x180049de4
movups xmm0, xmmword [rax]
movdqu xmmword [rcx], xmm0
jmp 0x180049dee
mov edx, 0x10
call sub.cryptdll.dll_CDGenerateRandomBits
mov r9, qword [rbx + 0x20]
mov r8d, dword [rsp + 0xc0]
mov rdx, qword [rsp + 0xb8]
lea rax, [r9 + 0x10]
mov dword [rsp + 0x30], esi
mov ecx, r15d
mov qword [rsp + 0x28], rax
mov dword [rsp + 0x20], 0x10
call fcn.180043f74
test eax, eax
je 0x180049fc0
mov rdx, qword [rbx + 0x20]
mov r9, qword [rsp + 0xc8]
mov dword [rsp + 0x30], esi
add rdx, 0x10
mov r8d, esi
mov ecx, r15d
mov qword [rsp + 0x28], rdx
mov dword [rsp + 0x20], r13d
call fcn.180043f74
test eax, eax
je 0x180049fc0
mov rcx, qword [rbx + 0x20]
mov edx, esi
mov r8, r13
add rcx, 0x10
add rcx, rdx
mov rdx, qword [rsp + 0xc8]
call fcn.1800ca790
lea r13d, [r14 + r12]
mov ecx, 0x40
mov edx, r13d
call qword [sym.imp.KERNEL32.dll_LocalAlloc]
mov rsi, rax
test rax, rax
je 0x180049fc0
mov r8d, dword [rsp + 0xc0]
mov rdx, qword [rsp + 0xb8]
mov dword [rsp + 0x40], 1
mov dword [rsp + 0x38], r13d
mov qword [rsp + 0x30], rax
mov eax, dword [rbx + 0x14]
mov dword [rsp + 0x28], eax
lea r9, [rbx + 4]
mov ecx, r15d
mov dword [rsp + 0x20], 0x10
call fcn.180044108
test eax, eax
je 0x180049fb3
mov ecx, dword [rbx + 0x1c]
lea rax, [rsp + 0x50]
xor r9d, r9d
mov qword [rsp + 0x28], rax
lea rax, [rsp + 0xb0]
mov r8d, r12d
mov rdx, rsi
mov qword [rsp + 0x20], rax
call fcn.1800447b4
test eax, eax
je 0x180049f9f
mov rcx, qword [rsp + 0xb0]
xor r9d, r9d
lea r8, [rsi + r12]
lea r15d, [r9 + 1]
mov edx, r15d
call qword [sym.imp.ADVAPI32.dll_CryptSetKeyParam]
test eax, eax
je 0x180049f74
mov ecx, dword [rdi]
mov rax, qword [rbx + 0x20]
xor r9d, r9d
add ecx, r14d
mov r8d, r15d
xor edx, edx
mov dword [rsp + 0x30], ecx
mov rcx, qword [rsp + 0xb0]
mov qword [rsp + 0x28], rdi
mov qword [rsp + 0x20], rax
call qword [sym.imp.ADVAPI32.dll_CryptEncrypt]
mov ebp, eax
test eax, eax
je 0x180049f60
sub dword [rdi], r14d
jmp 0x180049f74
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.18004d68c
mov rcx, qword [rsp + 0xb0]
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov rcx, qword [rsp + 0x50]
call fcn.1800446d0
test eax, eax
jne 0x180049fb3
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 0x180049fac
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.18004d68c
mov rcx, rsi
call qword [sym.imp.KERNEL32.dll_LocalFree]
test ebp, ebp
jne 0x180049fd1
mov rcx, qword [rbx + 0x20]
call qword [sym.imp.KERNEL32.dll_LocalFree]
and dword [rdi], 0
mov qword [rbx + 0x20], rax
mov eax, ebp
add rsp, 0x68
pop r15
pop r14
pop r13
pop r12
pop rdi
pop rsi
pop rbp
pop rbx
ret