//
// ASN1_UNIVERSALSTRING_to_string from 0xfe2a20 to 0xfe2b40 (288 bytes)
//
// 1 xrefs:
// > ??> @ 0x44560
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 13:15:38 +0000
//
__int64 __fastcall ASN1_UNIVERSALSTRING_to_string(__int64 a1)
{
unsigned int v1; // w2
int v3; // w6
_BYTE *v4; // x4
_BYTE *v5; // x1
__int64 v6; // x2
__int64 v7; // x1
int v9; // w2
unsigned __int8 *v10; // x0
v1 = 0;
if ( *(_DWORD *)(a1 + 4) != 28 )
return v1;
v3 = *(_DWORD *)a1;
if ( (*(_DWORD *)a1 & 3) != 0 )
return v1;
v4 = *(_BYTE **)(a1 + 8);
if ( v3 > 0 )
{
if ( !*v4 && !v4[1] && !v4[2] )
{
v5 = *(_BYTE **)(a1 + 8);
while ( 1 )
{
v5 += 4;
if ( v5 == &v4[((v3 - 1) & 0xFFFFFFFC) + 4] )
break;
if ( *v5 )
return 0;
v1 = (unsigned __int8)v5[1];
if ( v5[1] )
return 0;
if ( v5[2] )
return v1;
}
if ( v3 > 3 )
{
v6 = *(_QWORD *)(a1 + 8);
v7 = 3;
while ( 1 )
{
*v4++ = *(_BYTE *)(v6 + v7);
v7 += 4;
if ( (int)v7 >= *(_DWORD *)a1 )
break;
v6 = *(_QWORD *)(a1 + 8);
}
}
goto LABEL_17;
}
return v1;
}
LABEL_17:
*v4 = 0;
v9 = *(_DWORD *)a1;
v10 = *(unsigned __int8 **)(a1 + 8);
*(_DWORD *)a1 = v9 / 4;
*(_DWORD *)(a1 + 4) = ASN1_PRINTABLE_type(v10, v9 / 4);
return 1;
}