//
// X509_REQ_get_extensions from 0xad8594 to 0xad864c (184 bytes)
//
// 2 xrefs:
// > X509_REQ_get1_email @ 0xa72adc
// > ??> @ 0x8328c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:09:29 +0000
//
int __fastcall X509_REQ_get_extensions(int a1)
{
int v1; // r5
unsigned int v2; // r1
unsigned int attr_by_NID; // r1
unsigned int v5; // t1
int attr; // r0
_DWORD *v8; // r0
int *v9; // r2
unsigned __int8 *v10; // r0
int v11; // r2
unsigned __int8 *v12; // [sp+4h] [bp-14h] BYREF
if ( !a1 )
return 0;
v1 = off_D27B1C[0];
if ( !off_D27B1C[0] )
return 0;
v2 = *(_DWORD *)off_D27B1C[0];
if ( !*(_DWORD *)off_D27B1C[0] )
return 0;
while ( 1 )
{
attr_by_NID = X509_REQ_get_attr_by_NID(a1, v2, -1);
if ( attr_by_NID != -1 )
break;
v5 = *(_DWORD *)(v1 + 4);
v1 += 4;
v2 = v5;
if ( !v5 )
return 0;
}
attr = X509_REQ_get_attr(a1, attr_by_NID);
v8 = (_DWORD *)X509_ATTRIBUTE_get0_type(attr, 0);
if ( !v8 || *v8 != 16 )
return 0;
v9 = (int *)v8[1];
v10 = (unsigned __int8 *)v9[2];
v11 = *v9;
v12 = v10;
return ASN1_item_d2i(nullptr, &v12, v11, (int)X509_EXTENSIONS_it);
}