//
// X509V3_EXT_d2i from 0x857684 to 0x8576fc (120 bytes)
//
// 4 xrefs:
// > sub_85132C @ 0x851420
// > X509V3_get_d2i @ 0x8577e0
// > sub_8C3B7C @ 0x8c3db8
// > ??> @ 0x6893c
//
// 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
//
int __fastcall X509V3_EXT_d2i(int a1)
{
char *v2; // r4
int data; // r5
int v4; // r0
int v5; // r3
unsigned __int8 *v7[2]; // [sp+4h] [bp-8h] BYREF
v2 = X509V3_EXT_get(a1);
if ( !v2 )
return 0;
data = X509_EXTENSION_get_data(a1);
v7[0] = (unsigned __int8 *)ASN1_STRING_get0_data(data);
v4 = ASN1_STRING_length(data);
v5 = *((_DWORD *)v2 + 2);
if ( v5 )
return ASN1_item_d2i(nullptr, v7, v4, v5);
else
return (*((int (__fastcall **)(_DWORD, unsigned __int8 **, int))v2 + 5))(0, v7, v4);
}