//
// X509V3_EXT_val_prn from 0xdfffdc to 0xe001c8 (492 bytes)
//
// 2 xrefs:
// > X509V3_EXT_print @ 0xe00314
// > ??> @ 0x2d3d8
//
// 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 X509V3_EXT_val_prn(__int64 result, unsigned int *a2, int a3, int a4)
{
int v4; // w19
__int64 v6; // x20
bool v8; // cc
__int64 v9; // x3
__int64 v10; // x4
__int64 v11; // x3
int i; // w19
__int64 v13; // x5
const char *v14; // x4
const char *v15; // x3
if ( a2 )
{
v4 = a4;
v6 = result;
if ( !a4 || !(unsigned int)OPENSSL_sk_num(a2) )
{
BIO_printf(v6, "%*s", a3, &byte_F288A0);
if ( !(unsigned int)OPENSSL_sk_num(a2) )
BIO_puts(v6, (__int64)"\n");
}
if ( v4 )
{
for ( i = 0; ; ++i )
{
v8 = i < (int)OPENSSL_sk_num(a2);
result = v6;
if ( !v8 )
break;
BIO_printf(v6, "%*s", a3, &byte_F288A0);
v13 = OPENSSL_sk_value((__int64)a2, i);
v14 = *(const char **)(v13 + 8);
if ( v14 )
{
v15 = *(const char **)(v13 + 16);
if ( v15 )
BIO_printf(v6, "%s:%s", v14, v15);
else
BIO_puts(v6, (__int64)v14);
}
else
{
BIO_puts(v6, *(_QWORD *)(v13 + 16));
}
BIO_puts(v6, (__int64)&byte_F1AB78);
}
}
else
{
v8 = (int)OPENSSL_sk_num(a2) > 0;
for ( result = v6; v8; result = v6 )
{
if ( v4 > 0 )
BIO_printf(result, ", ");
v9 = OPENSSL_sk_value((__int64)a2, v4);
v10 = *(_QWORD *)(v9 + 8);
if ( v10 )
{
v11 = *(_QWORD *)(v9 + 16);
++v4;
if ( v11 )
BIO_printf(v6, "%s:%s", v10, v11);
else
BIO_puts(v6, v10);
}
else
{
++v4;
BIO_puts(v6, *(_QWORD *)(v9 + 16));
}
v8 = v4 < (int)OPENSSL_sk_num(a2);
}
}
}
return result;
}