Function at 0x4019be
Capabilities:
Create new key via cryptacquirecontext
Write file on windows

Disassembly:
push ebp
mov ebp, esp
sub esp, 0x48
mov dword [esp + 0x10], 0xf0000008
mov dword [esp + 0xc], 0x18
mov dword [esp + 8], 0
mov dword [esp + 4], 0
lea eax, [ebp - 0x18]
mov dword [esp], eax
call sym._CryptAcquireContextA_20
sub esp, 0x14
test eax, eax
jne 0x401aa8
call sym._GetLastError_0
cmp eax, 0x8009000f
jne 0x401a70
mov dword [esp + 0x10], 0xf0000000
mov dword [esp + 0xc], 0x18
mov dword [esp + 8], 0
mov dword [esp + 4], 0
lea eax, [ebp - 0x18]
mov dword [esp], eax
call sym._CryptAcquireContextA_20
sub esp, 0x14
test eax, eax
jne 0x401aa8
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.Error
mov dword [esp + 4], str.Failed_to_acquire_cryptographic_context.
mov dword [esp], 0
call sym._MessageBoxA_16
sub esp, 0x10
mov dword [esp], str.Failed_to_acquire_cryptographic_context.
call sym._LogToFile
jmp 0x401efb
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.Error
mov dword [esp + 4], str.Failed_to_acquire_cryptographic_context.
mov dword [esp], 0
call sym._MessageBoxA_16
sub esp, 0x10
mov dword [esp], str.Failed_to_acquire_cryptographic_context.
call sym._LogToFile
jmp 0x401efb
mov eax, dword [ebp - 0x18]
lea edx, [ebp - 0x1c]
mov dword [esp + 0xc], edx
mov dword [esp + 8], 0x8000001
mov dword [esp + 4], 1
mov dword [esp], eax
call sym._CryptGenKey_16
sub esp, 0x10
test eax, eax
jne 0x401b1f
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.Error
mov dword [esp + 4], str.Failed_to_generate_RSA_key_pair.
mov dword [esp], 0
call sym._MessageBoxA_16
sub esp, 0x10
mov dword [esp], str.Failed_to_generate_RSA_key_pair.
call sym._LogToFile
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
jmp 0x401efb
mov eax, dword [ebp - 0x1c]
lea edx, [ebp - 0x20]
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptExportKey_24
sub esp, 0x18
test eax, eax
jne 0x401bb4
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.Error
mov dword [esp + 4], str.Failed_to_export_public_key.
mov dword [esp], 0
call sym._MessageBoxA_16
sub esp, 0x10
mov dword [esp], str.Failed_to_export_public_key.
call sym._LogToFile
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
jmp 0x401efb
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._malloc
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x401c00
mov eax, dword [ebp - 0x1c]
lea edx, [ebp - 0x20]
mov dword [esp + 0x14], edx
mov edx, dword [ebp - 0xc]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptExportKey_24
sub esp, 0x18
test eax, eax
jne 0x401c67
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.Error
mov dword [esp + 4], str.Failed_to_export_public_key.
mov dword [esp], 0
call sym._MessageBoxA_16
sub esp, 0x10
mov dword [esp], str.Failed_to_export_public_key.
call sym._LogToFile
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
jmp 0x401efb
mov dword [esp + 4], 0x40d1da
mov eax, dword [ebp + 8]
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0x10], eax
cmp dword [ebp - 0x10], 0
je 0x401cbd
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x10]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._fwrite
mov eax, dword [ebp - 0x10]
mov dword [esp], eax
call sym._fclose
mov dword [esp], str.Public_key_exported_successfully.
call sym._LogToFile
jmp 0x401cf0
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.Error
mov dword [esp + 4], str.Failed_to_write_public_key_to_file.
mov dword [esp], 0
call sym._MessageBoxA_16
sub esp, 0x10
mov dword [esp], str.Failed_to_write_public_key_to_file.
call sym._LogToFile
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x1c]
lea edx, [ebp - 0x20]
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 7
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptExportKey_24
sub esp, 0x18
test eax, eax
jne 0x401d90
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.Error
mov dword [esp + 4], str.Failed_to_export_private_key.
mov dword [esp], 0
call sym._MessageBoxA_16
sub esp, 0x10
mov dword [esp], str.Failed_to_export_private_key.
call sym._LogToFile
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
jmp 0x401efb
mov eax, dword [ebp - 0x20]
mov dword [esp], eax
call sym._malloc
mov dword [ebp - 0xc], eax
cmp dword [ebp - 0xc], 0
je 0x401ddc
mov eax, dword [ebp - 0x1c]
lea edx, [ebp - 0x20]
mov dword [esp + 0x14], edx
mov edx, dword [ebp - 0xc]
mov dword [esp + 0x10], edx
mov dword [esp + 0xc], 0
mov dword [esp + 8], 7
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptExportKey_24
sub esp, 0x18
test eax, eax
jne 0x401e43
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.Error
mov dword [esp + 4], str.Failed_to_export_private_key.
mov dword [esp], 0
call sym._MessageBoxA_16
sub esp, 0x10
mov dword [esp], str.Failed_to_export_private_key.
call sym._LogToFile
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
jmp 0x401efb
mov dword [esp + 4], 0x40d1da
mov eax, dword [ebp + 0xc]
mov dword [esp], eax
call sym._fopen
mov dword [ebp - 0x14], eax
cmp dword [ebp - 0x14], 0
je 0x401e99
mov eax, dword [ebp - 0x20]
mov edx, dword [ebp - 0x14]
mov dword [esp + 0xc], edx
mov dword [esp + 8], eax
mov dword [esp + 4], 1
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._fwrite
mov eax, dword [ebp - 0x14]
mov dword [esp], eax
call sym._fclose
mov dword [esp], str.Private_key_exported_successfully.
call sym._LogToFile
jmp 0x401ecc
mov dword [esp + 0xc], 0x10
mov dword [esp + 8], str.Error
mov dword [esp + 4], str.Failed_to_write_private_key_to_file.
mov dword [esp], 0
call sym._MessageBoxA_16
sub esp, 0x10
mov dword [esp], str.Failed_to_write_private_key_to_file.
call sym._LogToFile
mov eax, dword [ebp - 0xc]
mov dword [esp], eax
call sym._free
mov eax, dword [ebp - 0x1c]
mov dword [esp], eax
call sym._CryptDestroyKey_4
sub esp, 4
mov eax, dword [ebp - 0x18]
mov dword [esp + 4], 0
mov dword [esp], eax
call sym._CryptReleaseContext_8
sub esp, 8
leave
ret