Function at 0x1403861cc
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using aes via winapi

Disassembly:
mov qword [rsp + 8], rbx
mov qword [rsp + 0x18], rbp
mov qword [rsp + 0x20], rsi
push rdi
push r12
push r13
push r14
push r15
sub rsp, 0x30
xor r13d, r13d
mov r14d, r9d
mov r12, r8
mov r15, rdx
mov rbp, rcx
mov edi, r13d
mov esi, r13d
test rdx, rdx
je 0x140386431
cmp qword [rsp + 0x80], r13
je 0x140386431
mov rbx, qword [rcx + 0x20]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rbx, qword [rbp + 0x10]
mov qword [rbp + 0x20], r13
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
lea rbx, [rbp + 0x30]
mov qword [rbp + 0x10], r13
mov rcx, qword [rbx]
mov dword [rbp + 0x18], r13d
mov qword [rsp + 0x68], rbx
test rcx, rcx
je 0x14038626a
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov qword [rbx], r13
lea r13, [rbp + 0x38]
xor ebx, ebx
cmp qword [r13], rbx
jne 0x1403862b1
lea r9d, [rbx + 0x18]
mov dword [rsp + 0x20], 0xf0000000
lea r8, str.Microsoft_Enhanced_RSA_and_AES_Cryptographic_Provider
xor edx, edx
mov rcx, r13
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x1403862b1
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx edi, ax
or edi, 0x80070000
test eax, eax
cmovle edi, eax
jmp 0x140386436
test r12, r12
je 0x14038633d
mov rbx, qword [rbp + 0x10]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
or r8, 0xffffffffffffffff
mov qword [rbp + 0x10], rdi
mov rax, r8
inc rax
cmp word [r12 + rax*2], di
jne 0x1403862dd
mov dword [rbp + 0x18], eax
lea ecx, [rax + 1]
mov eax, 2
mul rcx
mov rbx, rax
cmovo rbx, r8
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov qword [rbp + 0x10], rax
mov rcx, rax
test rax, rax
jne 0x140386326
mov edi, 0x8007000e
jmp 0x140386436
mov edx, dword [rbp + 0x18]
mov r8, r12
inc edx
call fcn.1400797ac
mov edi, eax
test eax, eax
jne 0x140386436
lea r12d, [r14 + 0xc]
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8d, r12d
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapAlloc]
mov rsi, rax
test rax, rax
je 0x14038631c
mov dword [rax], 0x208
cmp r14d, 0x10
jne 0x140386396
lea rdx, str.http:__www.w3.org_2001_04_xmlencaes128_cbc
mov rcx, r15
call sub.msvcrt.dll_wcscmp
test eax, eax
je 0x140386386
mov edi, 0x80049e2f
jmp 0x140386436
mov dword [rsi + 4], 0x660e
mov dword [rbp + 0xc], 1
jmp 0x1403863e6
cmp r14d, 0x18
jne 0x1403863bf
lea rdx, str.http:__www.w3.org_2001_04_xmlencaes192_cbc
mov rcx, r15
call sub.msvcrt.dll_wcscmp
test eax, eax
jne 0x14038637c
mov dword [rsi + 4], 0x660f
mov dword [rbp + 0xc], 2
jmp 0x1403863e6
cmp r14d, 0x20
jne 0x14038642a
lea rdx, str.http:__www.w3.org_2001_04_xmlencaes256_cbc
mov rcx, r15
call sub.msvcrt.dll_wcscmp
test eax, eax
jne 0x14038637c
mov dword [rsi + 4], 0x6610
mov dword [rbp + 0xc], 3
mov rdx, qword [rsp + 0x80]
lea rcx, [rsi + 0xc]
mov r8, r14
mov dword [rsi + 8], r14d
call sub.msvcrt.dll_memcpy
mov rax, qword [rsp + 0x68]
xor ebx, ebx
mov rcx, qword [r13]
xor r9d, r9d
mov qword [rsp + 0x28], rax
mov r8d, r12d
mov rdx, rsi
mov dword [rsp + 0x20], ebx
call qword [sym.imp.ADVAPI32.dll_CryptImportKey]
test eax, eax
jne 0x140386436
jmp 0x140386298
mov edi, 0x80049e2e
jmp 0x140386436
mov edi, 0x80070057
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rsi
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov rbx, qword [rsp + 0x60]
mov eax, edi
mov rbp, qword [rsp + 0x70]
mov rsi, qword [rsp + 0x78]
add rsp, 0x30
pop r15
pop r14
pop r13
pop r12
pop rdi
ret