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

Disassembly:
mov rax, rsp
mov qword [rax + 8], rbx
mov qword [rax + 0x10], rbp
mov qword [rax + 0x18], rsi
mov qword [rax + 0x20], rdi
push r12
push r14
push r15
sub rsp, 0x30
xor r12d, r12d
mov rdi, r8
mov rbp, rdx
mov rsi, rcx
test rdx, rdx
je 0x1403785d6
test r8, r8
je 0x1403785d6
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 [rsi + 0x10]
mov qword [rsi + 0x20], r12
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
lea r15, [rsi + 0x30]
mov qword [rsi + 0x10], r12
mov rcx, qword [r15]
mov dword [rsi + 0x18], r12d
test rcx, rcx
je 0x14037848c
call qword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
mov qword [r15], r12
lea r14, [rsi + 0x38]
cmp qword [r14], r12
jne 0x1403784d2
mov r9d, reloc.OLEAUT32.dll_SafeArrayGetElement
mov dword [rsp + 0x20], 0xf0000000
lea r8, str.Microsoft_Enhanced_RSA_and_AES_Cryptographic_Provider
xor edx, edx
mov rcx, r14
call qword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x1403784d2
call qword [sym.imp.KERNEL32.dll_GetLastError]
movzx edi, ax
or edi, 0x80070000
test eax, eax
cmovle edi, eax
jmp 0x1403785db
mov rbx, qword [rsi + 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 [rsi + 0x10], r12
mov rax, r8
inc rax
cmp word [rdi + rax*2], r12w
jne 0x1403784f5
mov dword [rsi + 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 [rsi + 0x10], rax
mov rcx, rax
test rax, rax
jne 0x14037853e
mov edi, 0x8007000e
jmp 0x1403785df
mov edx, dword [rsi + 0x18]
mov ebx, 1
add edx, ebx
mov r8, rdi
call fcn.140078718
mov edi, eax
test eax, eax
jne 0x1403785db
lea rdx, str.http:__www.w3.org_2001_04_xmlencaes128_cbc
mov rcx, rbp
call sub.msvcrt.dll_wcscmp
test eax, eax
jne 0x140378577
mov edx, 0x660e
mov dword [rsi + 0xc], ebx
jmp 0x1403785b7
lea rdx, str.http:__www.w3.org_2001_04_xmlencaes192_cbc
mov rcx, rbp
call sub.msvcrt.dll_wcscmp
test eax, eax
jne 0x140378598
mov edx, 0x660f
mov dword [rsi + 0xc], 2
jmp 0x1403785b7
lea rdx, str.http:__www.w3.org_2001_04_xmlencaes256_cbc
mov rcx, rbp
call sub.msvcrt.dll_wcscmp
test eax, eax
jne 0x1403785cf
mov edx, 0x6610
mov dword [rsi + 0xc], 3
mov rcx, qword [r14]
mov r9, r15
mov r8d, ebx
call qword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
jne 0x14037861b
jmp 0x1403784b9
mov edi, 0x80049e2e
jmp 0x1403785df
mov edi, 0x80070057
test edi, edi
jns 0x14037861b
mov rbx, qword [rsi + 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 [rsi + 0x10]
mov qword [rsi + 0x20], r12
call qword [sym.imp.KERNEL32.dll_GetProcessHeap]
mov r8, rbx
xor edx, edx
mov rcx, rax
call qword [sym.imp.KERNEL32.dll_HeapFree]
mov qword [rsi + 0x10], r12
mov dword [rsi + 0x18], r12d
mov rbx, qword [rsp + 0x50]
mov eax, edi
mov rdi, qword [rsp + 0x68]
mov rbp, qword [rsp + 0x58]
mov rsi, qword [rsp + 0x60]
add rsp, 0x30
pop r15
pop r14
pop r12
ret