//
// X509_NAME_ENTRY_set_data from 0x847a34 to 0x847b2c (248 bytes)
//
// 3 xrefs:
// > X509_NAME_ENTRY_create_by_OBJ @ 0x847b8c
// > X509_NAME_ENTRY_create_by_OBJ @ 0x847be4
// > ??> @ 0x67b9c
//
// 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(int a1, int a2, char *a3, signed int a4)
{
signed int v5; // r4
bool v6; // zf
_BOOL4 v7; // r3
int v10; // r3
char *v12; // r0
int v13; // r1
int v14; // r4
int v15; // r0
if ( !a1 )
return 0;
v5 = a4;
v6 = a4 == 0;
v7 = a3 == nullptr;
if ( v6 )
v7 = 0;
if ( v7 )
return 0;
if ( a2 > 0 && (a2 & 0x1000) != 0 )
{
v12 = OBJ_obj2nid(*(_DWORD *)a1);
return ASN1_STRING_set_by_NID(a1 + 4, a3, v5, a2, v12) != 0;
}
if ( v5 < 0 )
v5 = strlen(a3);
if ( !ASN1_STRING_set(*(signed int **)(a1 + 4), a3, v5) )
return 0;
if ( a2 == -1 )
return 1;
if ( a2 != -2 )
{
*(_DWORD *)(*(_DWORD *)(a1 + 4) + 4) = a2;
return 1;
}
v13 = v5;
v14 = *(_DWORD *)(a1 + 4);
v15 = ASN1_PRINTABLE_type(a3, v13);
v10 = 1;
*(_DWORD *)(v14 + 4) = v15;
return v10;
}