//
// X509_alias_set1 from 0xa5fd34 to 0xa5fdfc (200 bytes)
//
// 3 xrefs:
// > sub_A39418 @ 0xa39560
// > PKCS12_parse @ 0xa399c8
// > ??> @ 0x7f20c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:08:33 +0000
//
char *__fastcall X509_alias_set1(int a1, const char *a2, int a3)
{
void *v5; // r5
char *result; // r0
int v7; // r3
int v8; // r0
void *v9; // r0
int v10; // [sp+4h] [bp-4h]
int v11; // [sp+4h] [bp-4h]
if ( a2 )
{
if ( a1
&& ((v5 = *(void **)(a1 + 180)) != nullptr
|| (v11 = a3, v9 = X509_CERT_AUX_new(), a3 = v11, v5 = v9, (*(_DWORD *)(a1 + 180) = v9) != 0)) )
{
result = *((char **)v5 + 2);
if ( result )
return (char *)ASN1_STRING_set((signed int *)result, a2, a3);
v10 = a3;
result = (char *)ASN1_UTF8STRING_new();
a3 = v10;
*((_DWORD *)v5 + 2) = result;
if ( result )
return (char *)ASN1_STRING_set((signed int *)result, a2, a3);
}
else
{
return nullptr;
}
}
else if ( a1 && (v7 = *(_DWORD *)(a1 + 180)) != 0 && (v8 = *(_DWORD *)(v7 + 8)) != 0 )
{
ASN1_UTF8STRING_free(v8);
*(_DWORD *)(*(_DWORD *)(a1 + 180) + 8) = 0;
return (_BYTE *)(&dword_0 + 1);
}
else
{
return (_BYTE *)(&dword_0 + 1);
}
return result;
}