Function at 0x4057f0
Capabilities:
Create new key via cryptacquirecontext

Disassembly:
mov edi, edi
push ebp
mov ebp, esp
sub esp, 0x34
mov eax, dword [0x408034]
xor eax, ebp
mov dword [ebp - 4], eax
and dword [ebp - 0x18], 0
lea eax, [ebp - 0x14]
and dword [ebp - 0x24], 0
push ebx
push esi
push edi
xor ebx, ebx
mov dword [ebp - 0x2c], ecx
push eax
xor esi, esi
mov dword [ebp - 0x20], ebx
xor edi, edi
call dword [sym.imp.ole32.dll_CoCreateGuid]
test eax, eax
jne 0x40587c
push 0x42
call sub.msvcrt.dll_malloc
mov esi, eax
pop ecx
test esi, esi
jne 0x40584f
mov eax, dword [0x40a224]
test eax, eax
je 0x40584b
push 0x1b6c
push eax
call fcn.00406261
pop ecx
pop ecx
test esi, esi
je 0x40587c
push esi
lea edx, [ebp - 0x14]
call fcn.00405272
push 8
push dword [0x408040]
lea eax, [ebp - 0x18]
push dword [0x40a244]
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test eax, eax
jne 0x4058fc
and dword [ebp - 0x18], ebx
push dword [0x40a24c]
push 0x1b69
push dword [0x40a224]
call fcn.00406261
add esp, 0xc
test ebx, ebx
je 0x4058a0
push ebx
call sub.msvcrt.dll_free
pop ecx
xor ebx, ebx
and dword [ebp - 0x28], ebx
cmp dword [ebp - 0x18], 0
je 0x4058cf
push 0
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_CryptReleaseContext]
push 0x10
push dword [0x408040]
lea eax, [ebp - 0x18]
push dword [0x40a244]
push esi
push eax
call dword [sym.imp.ADVAPI32.dll_CryptAcquireContextW]
test esi, esi
je 0x4058da
push esi
call sub.msvcrt.dll_free
pop ecx
test edi, edi
je 0x4058e5
push edi
call sub.msvcrt.dll_free
pop ecx
mov eax, dword [ebp - 0x2c]
mov ecx, dword [ebp - 4]
pop edi
pop esi
mov dword [eax], ebx
xor ecx, ebp
mov eax, dword [ebp - 0x28]
pop ebx
call fcn.00406d00
leave
ret
cmp dword [0x40a1f8], ebx
je 0x40590d
mov eax, dword [0x40a268]
test eax, eax
jne 0x405917
mov eax, 0x200
mov dword [0x40a268], eax
lea ecx, [ebp - 0x24]
shl eax, 0x10
push ecx
xor ecx, ecx
inc ecx
or eax, ecx
mov dword [ebp - 0x28], ecx
push eax
push 2
push dword [ebp - 0x18]
call dword [sym.imp.ADVAPI32.dll_CryptGenKey]
test eax, eax
je 0x40587c
push dword [ebp - 0x24]
call dword [sym.imp.ADVAPI32.dll_CryptDestroyKey]
and dword [ebp - 0x1c], ebx
lea eax, [ebp - 0x1c]
push eax
push 0
xor ebx, ebx
inc ebx
push ebx
push 2
push dword [ebp - 0x18]
call dword [sym.imp.CRYPT32.dll_CryptExportPublicKeyInfo]
cmp dword [ebp - 0x1c], edi
jne 0x40596f
mov ecx, 0x1b70
call fcn.004019ec
jmp 0x4058a0
push dword [ebp - 0x1c]
call sub.msvcrt.dll_malloc
mov edi, eax
pop ecx
test edi, edi
jne 0x40599c
mov eax, dword [0x40a224]
test eax, eax
je 0x405994
push 0x1b6c
push eax
call fcn.00406261
pop ecx
pop ecx
test edi, edi
je 0x4058a0
lea eax, [ebp - 0x1c]
push eax
push edi
push ebx
push 2
push dword [ebp - 0x18]
call dword [sym.imp.CRYPT32.dll_CryptExportPublicKeyInfo]
test eax, eax
je 0x405960
mov edx, dword [edi + 8]
lea eax, [ebp - 0x30]
push eax
lea eax, [ebp - 0x20]
push eax
push dword [edi + 4]
push 0x27
pop ecx
call fcn.00405693
mov ebx, dword [ebp - 0x20]
test eax, eax
je 0x40587c
cmp dword [ebx + 8], 0x15
ja 0x4058a5
push dword [ebx + 8]
push dword [ebx + 0xc]
push 0x40a1b0
call sub.msvcrt.dll_memcpy
mov eax, dword [ebx + 8]
add esp, 0xc
mov dword [0x40a200], eax
mov dword [0x40a204], 0x40a1b0
jmp 0x4058a5