Function at 0x404050
Capabilities:
Access peb ldr_data
Get process heap flags
Reference public rsa key

Disassembly:
push ebp
mov ebp, esp
push edi
push esi
lea eax, [ebp - 0x818]
push ebx
sub esp, 0x850
mov dword [ebp - 0x824], 0x54
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x54
mov dword [esp + 4], 0x414a80
mov eax, dword [0x42b014]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptImportKey]
mov dword [ebp - 0x834], eax
call eax
sub esp, 0x18
mov ebx, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa63
mov dword [esp], ebx
lea ebx, [ebp - 0x820]
mov dword [esp + 4], str.failed_to_import_the_public_key_n
call fcn.00401ac0
lea eax, [ebp - 0x810]
mov dword [ebp - 0x820], 4
mov esi, dword [sym.imp.advapi32.dll_CryptGetKeyParam]
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], 7
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
call esi
sub esp, 0x14
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa67
mov dword [esp + 4], str.failed_to_get_the_KP_ALGID_from_the_imported_public_key_n
mov dword [esp], edi
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa68
mov eax, dword [ebp - 0x810]
mov dword [esp + 4], str.Expected_CALG_RSA_KEYX__got__x_n
cmp eax, 0xa400
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401ac0
lea eax, [ebp - 0x81c]
mov dword [ebp - 0x81c], 0xdeadbeef
mov dword [ebp - 0x820], 4
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], 6
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
call esi
sub esp, 0x14
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa6d
mov eax, dword fs:[0x18]
mov eax, dword [eax + 0x34]
mov dword [esp + 4], str._08lx_n
mov dword [esp], esi
mov dword [esp + 8], eax
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov edx, dword [ebp - 0x81c]
mov dword [eax + 4], 0xa6e
mov eax, 1
cmp edx, 0x3b
je 0x404210
mov eax, dword [0x42b050]
test eax, eax
sete cl
xor eax, eax
cmp edx, 0xffffffff
sete al
and eax, ecx
mov dword [esp + 8], edx
lea esi, [ebp - 0x80c]
mov dword [esp], eax
mov dword [esp + 4], str.expected_CRYPT_MACCRYPT_WRITECRYPT_READCRYPT_DECRYPTCRYPT_ENCRYPT__got__08lx_n
call fcn.00401ac0
lea eax, [ebp - 0x824]
mov dword [esp + 0x10], esi
mov dword [esp + 0x14], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [sym.imp.advapi32.dll_CryptExportKey]
mov dword [ebp - 0x828], eax
call eax
sub esp, 0x18
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa74
mov dword [esp], edi
mov dword [esp + 4], str.failed_to_export_the_fresh_imported_public_key_n
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa75
mov eax, dword [ebp - 0x824]
mov dword [esp + 4], str.Expected_exported_key_to_be_84_bytes_long_but_got__ld_bytes._n
cmp eax, 0x54
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa76
mov eax, dword [ebp - 0x824]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], 0x414a80
call sub.msvcrt.dll_memcmp
mov dword [esp + 4], str.exported_key_is_different_from_the_imported_key_n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
mov edi, dword fs:[0x18]
call fcn.00401ac0
mov ecx, dword [sym.imp.advapi32.dll_CryptDestroyKey]
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov dword [ebp - 0x82c], ecx
call ecx
lea edx, [ebp - 0x814]
sub esp, 4
mov dword [esp + 0x14], edx
mov dword [esp + 0x10], 1
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x254
mov dword [esp + 4], 0x414820
mov eax, dword [0x42b014]
mov dword [esp], eax
mov edx, dword [ebp - 0x834]
call edx
sub esp, 0x18
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa7d
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptImportKey_failed:__08lx_n
call fcn.00401ac0
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 7
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov eax, dword [ebp - 0x828]
call eax
sub esp, 0x18
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa80
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptExportKey_failed:__08lx_n
call fcn.00401ac0
mov eax, dword [ebp - 0x820]
mov dword [esp + 4], 0
mov edx, dword [sym.imp.kernel32.dll_HeapAlloc]
mov dword [esp + 8], eax
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov dword [ebp - 0x838], edx
call edx
sub esp, 0xc
mov esi, eax
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 7
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov eax, dword [ebp - 0x828]
call eax
sub esp, 0x18
mov dword [ebp - 0x830], eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa84
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.CryptExportKey_failed:__08lx_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x830]
mov dword [esp], edx
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa86
mov eax, dword [ebp - 0x820]
mov dword [esp + 4], str.unexpected_size__ld_n
cmp eax, 0x254
mov dword [esp + 8], eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401ac0
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa88
mov eax, dword [ebp - 0x820]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], 0x418be0
call sub.msvcrt.dll_memcmp
mov dword [esp + 4], str.unexpected_value_n
test eax, eax
sete al
movzx eax, al
mov dword [esp], eax
call fcn.00401ac0
mov dword [esp + 8], esi
mov esi, dword [sym.imp.kernel32.dll_HeapFree]
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov dword [ebp - 0x83c], esi
call esi
mov eax, dword [ebp - 0x814]
lea esi, [ebp - 0x814]
sub esp, 0xc
mov dword [esp], eax
mov ecx, dword [ebp - 0x82c]
call ecx
sub esp, 4
mov dword [esp + 0x14], esi
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x254
mov dword [esp + 4], 0x414cc0
mov eax, dword [0x42b014]
mov dword [esp], eax
mov esi, dword [ebp - 0x834]
call esi
sub esp, 0x18
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa92
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptImportKey_failed:__08lx_n
call fcn.00401ac0
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov eax, dword [ebp - 0x828]
call eax
sub esp, 0x18
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa95
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptExportKey_failed:__08lx_n
call fcn.00401ac0
mov eax, dword [ebp - 0x820]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov edx, dword [ebp - 0x838]
call edx
sub esp, 0xc
mov dword [esp + 0x14], ebx
mov dword [ebp - 0x830], eax
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov eax, dword [ebp - 0x828]
call eax
sub esp, 0x18
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa99
mov eax, dword [edi + 0x34]
mov dword [esp], esi
lea esi, [ebp - 0x814]
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptExportKey_failed:__08lx_n
call fcn.00401ac0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov ecx, dword [ebp - 0x82c]
call ecx
sub esp, 4
mov dword [esp + 8], esi
mov esi, dword [sym.imp.advapi32.dll_CryptGetUserKey]
mov dword [esp + 4], 1
mov eax, dword [0x42b014]
mov dword [esp], eax
mov dword [ebp - 0x840], esi
call esi
sub esp, 0xc
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xa9e
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptGetUserKey_failed:__08lx_n
call fcn.00401ac0
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov eax, dword [ebp - 0x828]
call eax
sub esp, 0x18
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xaa0
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptExportKey_failed:__08lx_n
call fcn.00401ac0
mov eax, dword [ebp - 0x820]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov edx, dword [ebp - 0x838]
call edx
sub esp, 0xc
mov esi, eax
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov eax, dword [ebp - 0x828]
call eax
sub esp, 0x18
mov dword [ebp - 0x844], eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xaa4
mov eax, dword [edi + 0x34]
mov dword [esp + 4], str.CryptExportKey_failed:__08lx_n
mov dword [esp + 8], eax
mov edx, dword [ebp - 0x844]
mov dword [esp], edx
call fcn.00401ac0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov ecx, dword [ebp - 0x82c]
call ecx
mov eax, dword [ebp - 0x820]
sub esp, 4
mov dword [esp + 8], eax
mov dword [esp + 4], esi
mov eax, dword [ebp - 0x830]
mov dword [esp], eax
call sub.msvcrt.dll_memcmp
mov edi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xaa8
xor eax, eax
test edi, edi
sete al
mov dword [esp + 4], str.unexpected_value_n
mov dword [esp], eax
call fcn.00401ac0
test edi, edi
je 0x40485e
cmp dword [0x414f28], 1
jg 0x404b50
mov edi, dword fs:[0x18]
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov eax, dword [ebp - 0x83c]
call eax
lea eax, [ebp - 0x818]
sub esp, 0xc
mov dword [esp + 0x14], eax
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 0x54
mov dword [esp + 4], 0x414a80
mov eax, dword [0x42b014]
mov dword [esp], eax
mov eax, dword [ebp - 0x834]
call eax
sub esp, 0x18
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xab4
mov dword [esp], esi
mov dword [esp + 4], str.failed_to_import_the_public_key_n
call fcn.00401ac0
mov eax, dword [ebp - 0x818]
mov dword [esp], eax
mov eax, dword [ebp - 0x82c]
call eax
lea ecx, [ebp - 0x814]
sub esp, 4
mov dword [esp + 8], ecx
mov dword [esp + 4], 1
mov eax, dword [0x42b014]
mov dword [esp], eax
mov ecx, dword [ebp - 0x840]
call ecx
sub esp, 0xc
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xab9
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptGetUserKey_failed:__08lx_n
call fcn.00401ac0
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], 0
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov ecx, dword [ebp - 0x828]
call ecx
sub esp, 0x18
mov esi, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xabb
mov eax, dword [edi + 0x34]
mov dword [esp], esi
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptExportKey_failed:__08lx_n
call fcn.00401ac0
mov eax, dword [ebp - 0x820]
mov dword [esp + 4], 0
mov dword [esp + 8], eax
mov eax, dword [edi + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov edx, dword [ebp - 0x838]
call edx
sub esp, 0xc
mov esi, eax
mov dword [esp + 0x14], ebx
mov dword [esp + 0x10], eax
mov dword [esp + 0xc], 0
mov dword [esp + 8], 6
mov dword [esp + 4], 0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov ecx, dword [ebp - 0x828]
call ecx
sub esp, 0x18
mov ebx, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xabf
mov eax, dword [edi + 0x34]
mov dword [esp], ebx
mov dword [esp + 8], eax
mov dword [esp + 4], str.CryptExportKey_failed:__08lx_n
call fcn.00401ac0
mov eax, dword [ebp - 0x814]
mov dword [esp], eax
mov eax, dword [ebp - 0x82c]
call eax
mov eax, dword [ebp - 0x820]
sub esp, 4
mov dword [esp + 8], eax
mov dword [esp + 4], esi
mov edi, dword [ebp - 0x830]
mov dword [esp], edi
call sub.msvcrt.dll_memcmp
mov ebx, eax
call fcn.00412e10
mov dword [eax], 0x41605d
mov dword [eax + 4], 0xac3
xor eax, eax
test ebx, ebx
sete al
mov dword [esp + 4], str.unexpected_value_n
mov dword [esp], eax
call fcn.00401ac0
test ebx, ebx
je 0x404a9c
cmp dword [0x414f28], 1
jg 0x404af0
mov eax, dword [ebp - 0x830]
mov dword [esp + 4], 0
mov ebx, dword fs:[0x18]
mov dword [esp + 8], eax
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
mov edi, dword [ebp - 0x83c]
call edi
sub esp, 0xc
mov dword [esp + 8], esi
mov dword [esp + 4], 0
mov eax, dword [ebx + 0x30]
mov eax, dword [eax + 0x18]
mov dword [esp], eax
call edi
sub esp, 0xc
lea esp, [ebp - 0xc]
pop ebx
pop esi
pop edi
pop ebp
ret
mov eax, 0xac5
call fcn.00401310
mov eax, dword [ebp - 0x820]
mov dword [esp], str.Expected_public_key___lu_:_n
mov dword [esp + 4], eax
call fcn.00401440
mov edx, dword [ebp - 0x820]
mov eax, edi
call fcn.00401510
mov eax, 0xac7
call fcn.00401310
mov eax, dword [ebp - 0x820]
mov dword [esp], str.AT_KEYEXCHANGE_public_key___lu_:_n
mov dword [esp + 4], eax
call fcn.00401440
mov edx, dword [ebp - 0x820]
mov eax, esi
call fcn.00401510
jmp 0x404a9c
mov eax, 0xaaa
call fcn.00401310
mov eax, dword [ebp - 0x820]
mov dword [esp], str.Expected_public_key___lu_:_n
mov dword [esp + 4], eax
call fcn.00401440
mov edx, dword [ebp - 0x820]
mov eax, dword [ebp - 0x830]
call fcn.00401510
mov eax, 0xaac
call fcn.00401310
mov eax, dword [ebp - 0x820]
mov dword [esp], str.AT_KEYEXCHANGE_public_key___lu_:_n
mov dword [esp + 4], eax
call fcn.00401440
mov edx, dword [ebp - 0x820]
mov eax, esi
call fcn.00401510
jmp 0x40485e