Function at 0x407530
Capabilities:
Create new key via cryptacquirecontext
Encrypt data using curve25519
Generate random numbers via winapi

Disassembly:
push ebp
mov ebp, esp
sub esp, 0xe4
mov eax, dword [0x429004]
xor eax, ebp
mov dword [ebp - 4], eax
push ebx
push esi
push edi
mov edi, ecx
cmp dword [edi + 0x20], 0
jne 0x407568
mov dword [edi + 0x24], 0xd
xor al, al
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a11a
mov esp, ebp
pop ebp
ret
mov esi, dword [sym.imp.KERNEL32.dll_GetProcessHeap]
push 0x20
push 0
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0xf0000000
push 0x18
push 0
mov dword [edi + 0x28], eax
lea eax, [ebp - 8]
push 0
push eax
mov dword [ebp - 8], 0
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
mov ebx, dword [sym.imp.KERNEL32.dll_HeapFree]
test eax, eax
jne 0x4075cb
push 0xf0000008
push 0x18
push 0
push 0
lea eax, [ebp - 8]
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x4075cb
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [edi + 0x24], eax
xor eax, eax
jmp 0x40763d
push 0x20
push 0
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
mov dword [ebp - 0xe4], eax
test eax, eax
jne 0x4075fa
push eax
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [edi + 0x24], eax
xor eax, eax
jmp 0x40763d
push eax
push 0x20
push dword [ebp - 8]
call dword [sym.imp.ADVAPI32.dll_CryptGenRandom]
push 0
push dword [ebp - 8]
test eax, eax
jne 0x407631
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [ebp - 0xe4]
push eax
push 0
call esi
push eax
call ebx
mov eax, dword [sym.imp.KERNEL32.dll_GetLastError]
call eax
mov dword [edi + 0x24], eax
xor eax, eax
jmp 0x40763d
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
mov eax, dword [ebp - 0xe4]
push 0x20
push 0
mov dword [edi + 0x2c], eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0x40
push 0
mov dword [edi + 0x30], eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
push 0x40
push 0
mov dword [edi + 0x34], eax
call esi
push eax
call dword [sym.imp.KERNEL32.dll_HeapAlloc]
cmp dword [edi + 0x28], 0
mov dword [edi + 0x38], eax
je 0x4077e1
mov ecx, dword [edi + 0x2c]
test ecx, ecx
je 0x4077e1
cmp dword [edi + 0x30], 0
je 0x4077e1
cmp dword [edi + 0x34], 0
je 0x4077e1
test eax, eax
je 0x4077e1
and byte [ecx], 0xf8
mov eax, dword [edi + 0x2c]
push edi
and byte [eax + 0x1f], 0x7f
mov eax, dword [edi + 0x2c]
or byte [eax + 0x1f], 0x40
mov edx, dword [edi + 0x2c]
mov ecx, dword [edi + 0x28]
call fcn.004048a0
mov edx, dword [edi + 0x2c]
add esp, 4
mov ecx, dword [edi + 0x30]
push dword [edi + 0x20]
call fcn.004048a0
movups xmm0, xmmword [0x426a30]
mov edx, dword [edi + 0x30]
lea ecx, [ebp - 0xe0]
mov esi, dword [edi + 0x34]
add esp, 4
movups xmmword [ebp - 0xe0], xmm0
mov dword [ebp - 0x20], 0
movups xmm0, xmmword [0x426a40]
push 0x20
mov dword [ebp - 0x1c], 0
movups xmmword [ebp - 0xd0], xmm0
mov dword [ebp - 0x18], 0
movups xmm0, xmmword [0x426a50]
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
movups xmmword [ebp - 0xc0], xmm0
movups xmm0, xmmword [0x426a60]
movups xmmword [ebp - 0xb0], xmm0
call fcn.00409c30
add esp, 4
lea ecx, [ebp - 0xe0]
mov edx, esi
call fcn.00409dc0
movups xmm0, xmmword [0x426a30]
mov edx, dword [edi + 0x28]
lea ecx, [ebp - 0xe0]
mov esi, dword [edi + 0x38]
movups xmmword [ebp - 0xe0], xmm0
push 0x20
movups xmm0, xmmword [0x426a40]
mov dword [ebp - 0x20], 0
mov dword [ebp - 0x1c], 0
movups xmmword [ebp - 0xd0], xmm0
mov dword [ebp - 0x18], 0
movups xmm0, xmmword [0x426a50]
mov dword [ebp - 0x14], 0
mov dword [ebp - 0x10], 0
movups xmmword [ebp - 0xc0], xmm0
movups xmm0, xmmword [0x426a60]
movups xmmword [ebp - 0xb0], xmm0
call fcn.00409c30
add esp, 4
lea ecx, [ebp - 0xe0]
mov edx, esi
call fcn.00409dc0
mov al, 1
pop edi
pop esi
pop ebx
mov ecx, dword [ebp - 4]
xor ecx, ebp
call fcn.0040a11a
mov esp, ebp
pop ebp
ret
mov eax, dword [edi + 0x20]
test eax, eax
je 0x4077f0
push eax
push 0
call esi
push eax
call ebx
mov eax, dword [edi + 0x2c]
test eax, eax
je 0x4077ff
push eax
push 0
call esi
push eax
call ebx
mov eax, dword [edi + 0x28]
test eax, eax
je 0x40780e
push eax
push 0
call esi
push eax
call ebx
mov eax, dword [edi + 0x38]
test eax, eax
je 0x40781d
push eax
push 0
call esi
push eax
call ebx
mov eax, dword [edi + 0x30]
test eax, eax
je 0x40782c
push eax
push 0
call esi
push eax
call ebx
mov eax, dword [edi + 0x34]
test eax, eax
je 0x40783b
push eax
push 0
call esi
push eax
call ebx
call dword [sym.imp.KERNEL32.dll_GetLastError]
mov ecx, dword [ebp - 4]
mov dword [edi + 0x24], eax
xor ecx, ebp
pop edi
pop esi
xor al, al
pop ebx
call fcn.0040a11a
mov esp, ebp
pop ebp
ret