//
// sub_855CA0 from 0x855ca0 to 0x855f98 (760 bytes)
//
// 1 xrefs:
// > ??> @ 0xab3d70
//
// 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 sub_855CA0(int a1, int a2, int a3, int a4)
{
signed int *v4; // r7
signed int v8; // r5
int v9; // r7
int v10; // r9
_DWORD *v11; // r5
bool v12; // zf
_DWORD *v14; // r7
_DWORD *v15; // r0
signed int v16[5]; // [sp+1Ch] [bp-18h] BYREF
v4 = *(signed int **)a2;
if ( *(_DWORD *)a2 )
{
v8 = *v4;
if ( *v4 )
{
v16[0] = v4[1];
BIO_printf(a3, "%*sRelative Name:\n%*s", a4, &byte_9B1912, a4 + 2, &byte_9B1912);
X509_NAME_print_ex(a3, (int)v16, 0, 8520479);
BIO_puts(a3, (int)"\n");
}
else
{
BIO_printf(a3, "%*sFull Name:\n", a4, &byte_9B1912);
v14 = (_DWORD *)v4[1];
while ( v8 < OPENSSL_sk_num((int)v14) )
{
BIO_printf(a3, "%*s", a4 + 2, &byte_9B1912);
v15 = (_DWORD *)OPENSSL_sk_value(v14, v8++);
GENERAL_NAME_print(a3, v15);
BIO_puts(a3, (int)"\n");
}
}
}
if ( *(int *)(a2 + 4) > 0 )
BIO_printf(a3, "%*sOnly User Certificates\n", a4, &byte_9B1912);
if ( *(int *)(a2 + 8) > 0 )
BIO_printf(a3, "%*sOnly CA Certificates\n", a4, &byte_9B1912);
if ( *(int *)(a2 + 16) > 0 )
BIO_printf(a3, "%*sIndirect CRL\n", a4, &byte_9B1912);
v9 = *(_DWORD *)(a2 + 12);
if ( v9 )
{
BIO_printf(a3, "%*s%s:\n%*s", a4, &byte_9B1912, "Only Some Reasons", a4 + 2, &byte_9B1912);
v10 = 1;
v11 = &unk_A3948C;
do
{
if ( ASN1_BIT_STRING_get_bit(v9, *(v11 - 3)) )
{
v12 = v10 == 0;
v10 = 0;
if ( v12 )
BIO_puts(a3, (int)", ");
BIO_puts(a3, *(v11 - 2));
}
v11 += 3;
}
while ( *(v11 - 2) );
if ( v10 )
BIO_puts(a3, (int)"\n");
else
BIO_puts(a3, (int)"\n");
}
if ( *(int *)(a2 + 20) > 0 )
BIO_printf(a3, "%*sOnly Attribute Certificates\n", a4, &byte_9B1912);
if ( !*(_DWORD *)a2
&& *(int *)(a2 + 4) <= 0
&& *(int *)(a2 + 8) <= 0
&& *(int *)(a2 + 16) <= 0
&& !*(_DWORD *)(a2 + 12)
&& *(int *)(a2 + 20) <= 0 )
{
BIO_printf(a3, "%*s\n", a4, &byte_9B1912);
}
return 1;
}