//
// ASN1_STRING_print from 0xd647e0 to 0xd6490c (300 bytes)
//
// 5 xrefs:
// > sub_BB5664 @ 0xbb5d98
// > X509V3_extensions_print @ 0xe005e0
// > sub_E01F64 @ 0xe02020
// > sub_E63F08 @ 0xe63f58
// > ??> @ 0x2cd48
//
// 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
//
bool __fastcall ASN1_STRING_print(__int64 a1, __int64 a2)
{
int v2; // w4
unsigned __int8 *v3; // x19
__int64 v4; // x2
int v7; // w20
unsigned int v8; // w3
int v9; // w0
_BYTE v11[80]; // [xsp+40h] [xbp+40h] BYREF
if ( !a2 )
return 0;
v2 = *(_DWORD *)a2;
v3 = *(unsigned __int8 **)(a2 + 8);
if ( *(int *)a2 <= 0 )
return 1;
LODWORD(v4) = 0;
v7 = 0;
do
{
while ( 1 )
{
v8 = *v3;
if ( v8 <= 0x7E )
break;
v11[(int)v4] = 46;
v4 = (unsigned int)(v4 + 1);
++v7;
++v3;
if ( (int)v4 > 79 )
goto LABEL_12;
LABEL_9:
if ( v7 >= v2 )
goto LABEL_14;
}
if ( v8 != 10 && v8 <= 0x1F )
{
if ( v8 == 13 )
LOBYTE(v8) = 13;
else
LOBYTE(v8) = 46;
}
v11[(int)v4] = v8;
v4 = (unsigned int)(v4 + 1);
++v7;
++v3;
if ( (int)v4 <= 79 )
goto LABEL_9;
LABEL_12:
v9 = BIO_write(a1, v11, v4);
v4 = 0;
if ( v9 <= 0 )
return 0;
v2 = *(_DWORD *)a2;
}
while ( v7 < *(_DWORD *)a2 );
LABEL_14:
if ( (_DWORD)v4 )
return (int)BIO_write(a1, v11, v4) > 0;
return 1;
}