//
// X509_NAME_ENTRY_set_data from 0xdef6ac to 0xdef7b0 (260 bytes)
//
// 3 xrefs:
// > X509_NAME_ENTRY_create_by_OBJ @ 0xdef82c
// > X509_NAME_ENTRY_create_by_OBJ @ 0xdef878
// > ??> @ 0x61020
//
// 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 X509_NAME_ENTRY_set_data(__int64 *a1, int a2, char *a3, int a4)
{
unsigned int v9; // w0
__int64 v10; // x19
int v11; // [xsp+38h] [xbp+38h]
unsigned int v12; // [xsp+38h] [xbp+38h]
if ( !a1 || !a3 && a4 )
return 0;
if ( a2 > 0 && (a2 & 0x1000) != 0 )
{
v12 = a4;
v9 = OBJ_obj2nid(*a1);
return ASN1_STRING_set_by_NID(a1 + 1, a3, v12, (unsigned int)a2, v9) != 0;
}
if ( a4 < 0 )
a4 = strlen(a3);
v11 = a4;
if ( !(unsigned int)ASN1_STRING_set(a1[1], a3, a4) )
return 0;
if ( a2 == -1 )
return 1;
if ( a2 == -2 )
{
v10 = a1[1];
*(_DWORD *)(v10 + 4) = ASN1_PRINTABLE_type((unsigned __int8 *)a3, v11);
return 1;
}
*(_DWORD *)(a1[1] + 4) = a2;
return 1;
}