//
// X509V3_NAME_from_section from 0x85e488 to 0x85e580 (248 bytes)
//
// 4 xrefs:
// > a2i_GENERAL_NAME @ 0x850e64
// > sub_856070 @ 0x8562e8
// > sub_8566F0 @ 0x8568e8
// > ??> @ 0x688bc
//
// 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_NAME_from_section(int *a1, _DWORD *a2, int a3)
{
unsigned int v6; // r4
int v7; // r0
char *v8; // r1
int v9; // r2
bool v10; // zf
int v11; // r12
int v12; // r3
int v13; // t1
int v14; // lr
bool v15; // zf
if ( !a1 )
return 0;
v6 = 0;
if ( OPENSSL_sk_num((int)a2) <= 0 )
return 1;
while ( 1 )
{
v7 = OPENSSL_sk_value(a2, v6);
v8 = *(char **)(v7 + 4);
v9 = (unsigned __int8)*v8;
if ( *v8 )
{
v10 = v9 == 58;
if ( v9 != 58 )
v10 = (v9 & 0xFD) == 44;
v11 = *(_DWORD *)(v7 + 4);
if ( v10 )
{
LABEL_12:
if ( *(_BYTE *)(v11 + 1) )
{
v8 = (char *)(v11 + 1);
v9 = *(unsigned __int8 *)(v11 + 1);
}
}
else
{
while ( 1 )
{
v13 = *(unsigned __int8 *)++v11;
v12 = v13;
v14 = v13 & 0xFD;
if ( !v13 )
break;
v15 = v12 == 58;
if ( v12 != 58 )
v15 = v14 == 44;
if ( v15 )
goto LABEL_12;
}
}
if ( v9 == 43 )
{
++v8;
v9 = -1;
}
else
{
v9 = 0;
}
}
if ( !X509_NAME_add_entry_by_txt(a1, v8, a3, *(char **)(v7 + 8), -1, -1, v9) )
return 0;
if ( (int)++v6 >= OPENSSL_sk_num((int)a2) )
return 1;
}
}