//
// ASN1_STRING_set from 0xfe7698 to 0xfe7798 (256 bytes)
//
// 32 xrefs:
// > ASN1_TIME_to_generalizedtime @ 0xfe5c9c
// > ASN1_TIME_to_generalizedtime @ 0xfe5d1c
// > ASN1_UTCTIME_set_string @ 0xfe6254
// > ASN1_STRING_copy @ 0xfe77c0
// > sub_FE922C @ 0xfe99dc
// > OCSP_crlID_new @ 0x1042518
// > OCSP_url_svcloc_new @ 0x104273c
// > X509_ATTRIBUTE_set1_data @ 0x106429c
// > X509_NAME_ENTRY_set_data @ 0x106da4c
// > X509_alias_set1 @ 0x1070e58
// > X509_keyid_set1 @ 0x1070f1c
// > a2i_GENERAL_NAME @ 0x107675c
// > sub_1079F2C @ 0x107a1b0
// > sub_1079F2C @ 0x107a344
// > ASN1_BIT_STRING_set @ 0x1085db4
// > ASN1_GENERALIZEDTIME_set_string @ 0x108722c
// > c2i_ASN1_INTEGER @ 0x108807c
// > c2i_ASN1_INTEGER @ 0x10885ec
// > ASN1_INTEGER_set_int64 @ 0x1088afc
// > ASN1_INTEGER_set_uint64 @ 0x1088d98
// > BN_to_ASN1_INTEGER @ 0x1088e88
// > ASN1_ENUMERATED_set_int64 @ 0x1089224
// > BN_to_ASN1_ENUMERATED @ 0x108938c
// > ASN1_mbstring_ncopy @ 0x1089d98
// > ASN1_OCTET_STRING_set @ 0x108a000
// > sub_108B494 @ 0x108b790
// > sub_108B494 @ 0x108bbb8
// > PKCS7_add1_attrib_digest @ 0x10e453c
// > s2i_ASN1_IA5STRING @ 0x10ee474
// > PKCS5_pbe2_set_scrypt @ 0x10f0f50
// > cms_DigestedData_do_final @ 0x10f90b0
// > ??> @ 0x52888
//
// 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:40 +0000
//
__int64 __fastcall ASN1_STRING_set(__int64 a1, char *a2, int a3)
{
size_t v3; // x19
void *v6; // x22
__int64 result; // x0
__int64 v8; // x0
v3 = a3;
if ( a3 < 0 )
{
if ( !a2 )
return 0;
v3 = (int)strlen(a2);
}
v6 = *(void **)(a1 + 8);
if ( (int)v3 < *(_DWORD *)a1 && v6 )
{
*(_DWORD *)a1 = v3;
if ( a2 )
goto LABEL_5;
return 1;
}
v8 = CRYPTO_realloc(*(_QWORD *)(a1 + 8), (int)v3 + 1, "crypto/asn1/asn1_lib.c", 277);
*(_QWORD *)(a1 + 8) = v8;
if ( !v8 )
{
ERR_put_error(13, 186, 65, "crypto/asn1/asn1_lib.c", 279);
*(_QWORD *)(a1 + 8) = v6;
return 0;
}
*(_DWORD *)a1 = v3;
v6 = (void *)v8;
if ( !a2 )
return 1;
LABEL_5:
memcpy(v6, a2, v3);
result = 1;
*(_BYTE *)(*(_QWORD *)(a1 + 8) + v3) = 0;
return result;
}