//
// ASN1_STRING_to_UTF8 from 0x7c0d10 to 0x7c0dac (156 bytes)
//
// 7 xrefs:
// > sub_642BAC @ 0x643468
// > sub_824818 @ 0x82494c
// > PKCS12_parse @ 0x824db4
// > sub_849870 @ 0x8499c0
// > NAME_CONSTRAINTS_check_CN @ 0x858414
// > sub_85C3A0 @ 0x85c5fc
// > ??> @ 0x5501c
//
// 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 ASN1_STRING_to_UTF8(_DWORD *a1, int *a2)
{
unsigned int v2; // r2
int v3; // r3
int v6; // r1
int v7; // r2
int result; // r0
int *v9; // [sp+Ch] [bp-14h] BYREF
int v10; // [sp+10h] [bp-10h] BYREF
int v11; // [sp+18h] [bp-8h]
int v12; // [sp+1Ch] [bp-4h]
v9 = &v10;
if ( !a2 )
return -1;
v2 = a2[1];
if ( v2 > 0x1E )
return -1;
v3 = *((char *)&word_A0CF7C[128] + v2);
if ( v3 == -1 )
return -1;
v6 = a2[2];
v7 = *a2;
v11 = 0;
v10 = 0;
v12 = 0;
result = ASN1_mbstring_copy(&v9, v6, v7, v3 | 0x1000, 0x2000);
if ( result >= 0 )
{
result = v10;
*a1 = v11;
}
return result;
}