//
// d2i_DHxparams from 0xd8761c to 0xd8770c (240 bytes)
//
// 5 xrefs:
// > sub_D85BB0 @ 0xd85d18
// > sub_D85D44 @ 0xd85da0
// > sub_D85F34 @ 0xd860c8
// > PEM_read_bio_DHparams @ 0xdc941c
// > ??> @ 0x8b260
//
// This function is hookable on this platform!
//
// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings
//
__int64 __fastcall d2i_DHxparams(__int64 *a1, char **a2, __int64 a3)
{
__int64 result; // x0
__int64 v5; // x19
_QWORD *v6; // x20
__int64 v7; // x3
__int64 v8; // x2
__int64 v9; // x1
__int64 *v10; // x0
__int64 v11; // x1
__int64 v12; // x0
__int64 v13; // x4
result = DH_new();
v5 = result;
if ( result )
{
v6 = (_QWORD *)d2i_int_dhx(nullptr, a2, a3);
if ( v6 )
{
if ( a1 )
{
DH_free(*a1);
*a1 = v5;
}
v7 = v6[1];
v8 = v6[2];
v9 = v6[3];
v10 = (__int64 *)v6[4];
*(_QWORD *)(v5 + 8) = *v6;
*(_QWORD *)(v5 + 64) = v7;
*(_QWORD *)(v5 + 16) = v8;
*(_QWORD *)(v5 + 72) = v9;
if ( v10 )
{
v11 = v10[1];
v12 = *v10;
v13 = *(_QWORD *)(v12 + 8);
*(_DWORD *)(v5 + 88) = *(_DWORD *)v12;
*(_QWORD *)(v5 + 80) = v13;
*(_QWORD *)(v5 + 96) = v11;
*(_QWORD *)(v12 + 8) = 0;
ASN1_BIT_STRING_free(v12);
CRYPTO_free(v6[4], "crypto/dh/dh_asn1.c", 110);
v6[4] = 0;
}
CRYPTO_free(v6, "crypto/dh/dh_asn1.c", 114);
return v5;
}
else
{
DH_free(v5);
return 0;
}
}
return result;
}