//
// X509_REQ_get_extensions from 0x8c3594 to 0x8c364c (184 bytes)
//
// 2 xrefs:
// > X509_REQ_get1_email @ 0x85dedc
// > ??> @ 0x6980c
//
// 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 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_AC2944[0];
if ( !off_AC2944[0] )
return 0;
v2 = *(_DWORD *)off_AC2944[0];
if ( !*(_DWORD *)off_AC2944[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);
}