//
// X509_aux_print from 0x83d430 to 0x83d704 (724 bytes)
//
// 2 xrefs:
// > X509_print_ex @ 0x83d7f4
// > ??> @ 0x66b5c
//
// 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_aux_print(int a1, int a2, int a3)
{
_DWORD *v7; // r7
_DWORD *v8; // r6
signed int v9; // r5
int v10; // r9
int v11; // r0
bool v12; // zf
signed int v13; // r5
int v14; // r8
int v15; // r0
const char *v16; // r0
int v17; // r6
const char *v18; // r2
int v19; // r6
int v20; // r5
int v21; // t1
int v22; // [sp+14h] [bp-58h] BYREF
char v23[84]; // [sp+18h] [bp-54h] BYREF
if ( !X509_trusted(a2) )
return 1;
v7 = (_DWORD *)X509_get0_trust_objects(a2);
v8 = (_DWORD *)X509_get0_reject_objects(a2);
if ( v7 )
{
BIO_printf(a1, "%*sTrusted Uses:\n%*s", a3, &byte_9B1912, a3 + 2, &byte_9B1912);
v9 = 0;
v10 = 1;
while ( v9 < OPENSSL_sk_num((int)v7) )
{
v12 = v10 == 0;
v10 = 0;
if ( v12 )
BIO_puts(a1, (int)", ");
v11 = OPENSSL_sk_value(v7, v9++);
OBJ_obj2txt(v23, 80, v11, 0);
BIO_puts(a1, (int)v23);
}
BIO_puts(a1, (int)"\n");
}
else
{
BIO_printf(a1, "%*sNo Trusted Uses.\n", a3, &byte_9B1912);
}
if ( v8 )
{
BIO_printf(a1, "%*sRejected Uses:\n%*s", a3, &byte_9B1912, a3 + 2, &byte_9B1912);
v13 = 0;
v14 = 1;
while ( v13 < OPENSSL_sk_num((int)v8) )
{
v12 = v14 == 0;
v14 = 0;
if ( v12 )
BIO_puts(a1, (int)", ");
v15 = OPENSSL_sk_value(v8, v13++);
OBJ_obj2txt(v23, 80, v15, 0);
BIO_puts(a1, (int)v23);
}
BIO_puts(a1, (int)"\n");
}
else
{
BIO_printf(a1, "%*sNo Rejected Uses.\n", a3, &byte_9B1912);
}
v16 = (const char *)X509_alias_get0(a2, 0);
if ( v16 )
BIO_printf(a1, "%*sAlias: %s\n", a3, &byte_9B1912, v16);
v17 = X509_keyid_get0(a2, &v22);
if ( !v17 )
return 1;
BIO_printf(a1, "%*sKey Id: ", a3, &byte_9B1912);
if ( v22 > 0 )
{
v18 = &byte_9B1912;
v19 = v17 - 1;
v20 = 0;
while ( 1 )
{
v21 = *(unsigned __int8 *)++v19;
BIO_printf(a1, "%s%02X", v18, v21);
if ( ++v20 >= v22 )
break;
if ( v20 )
v18 = ":";
else
v18 = &byte_9B1912;
}
}
BIO_write(a1, (int)"\n", 1);
return 1;
}