//
// d2i_DHxparams from 0x100597c to 0x1005a6c (240 bytes)
//
// 5 xrefs:
// > sub_1003F10 @ 0x1004078
// > sub_10040A4 @ 0x1004100
// > sub_1004294 @ 0x1004428
// > PEM_read_bio_DHparams @ 0x104777c
// > ??> @ 0xb8678
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:15:56 +0000
//
__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;
}