//
// BIO_new_NDEF from 0xe727d0 to 0xe72938 (360 bytes)
//
// 3 xrefs:
// > BIO_new_CMS @ 0xe1ecfc
// > i2d_ASN1_bio_stream @ 0xe71aa0
// > ??> @ 0x32568
//
// 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 BIO_new_NDEF(__int64 a1, __int64 a2, __int64 a3)
{
__int64 v3; // x21
_QWORD *v6; // x19
__int64 v7; // x0
__int64 v8; // x0
_QWORD *v9; // x20
__int64 v10; // x23
int (__fastcall *v11)(__int64, __int64 *, __int64, __int64 *); // x4
__int64 v12; // x4
__int64 v13; // x5
__int64 v15; // [xsp+48h] [xbp+48h] BYREF
__int64 v16; // [xsp+58h] [xbp+58h] BYREF
__int64 v17; // [xsp+60h] [xbp+60h]
__int64 v18; // [xsp+68h] [xbp+68h]
v3 = *(_QWORD *)(a3 + 32);
v15 = a2;
if ( v3 && *(_QWORD *)(v3 + 24) )
{
v6 = CRYPTO_zalloc(&dword_30, (__int64)"crypto/asn1/bio_ndef.c", 63);
v7 = BIO_f_asn1();
v8 = BIO_new(v7);
v9 = (_QWORD *)v8;
if ( v8
&& v6
&& (v10 = BIO_push(v8, a1)) != 0
&& (BIO_asn1_set_prefix(v9, sub_E7269C, sub_E7253C),
BIO_asn1_set_suffix(v9, sub_E725A4, sub_E72740),
v16 = v10,
v11 = *(int (__fastcall **)(__int64, __int64 *, __int64, __int64 *))(v3 + 24),
v17 = 0,
v18 = 0,
v11(10, &v15, a3, &v16) > 0) )
{
v12 = v18;
v13 = v17;
*v6 = v15;
v6[1] = a3;
v6[2] = v13;
v6[4] = v12;
v6[3] = v10;
BIO_ctrl((__int64)v9, 0x99u, 0, (__int64)v6);
return v17;
}
else
{
BIO_free(v9);
CRYPTO_free(v6, (__int64)"crypto/asn1/bio_ndef.c", 100);
return 0;
}
}
else
{
ERR_put_error(13, 208, 202, (__int64)"crypto/asn1/bio_ndef.c", 60);
return 0;
}
}