//
// ASN1_STRING_set from 0xd69338 to 0xd69438 (256 bytes)
//
// 32 xrefs:
// > ASN1_TIME_to_generalizedtime @ 0xd6793c
// > ASN1_TIME_to_generalizedtime @ 0xd679bc
// > ASN1_UTCTIME_set_string @ 0xd67ef4
// > ASN1_STRING_copy @ 0xd69460
// > sub_D6AECC @ 0xd6b67c
// > OCSP_crlID_new @ 0xdc41b8
// > OCSP_url_svcloc_new @ 0xdc43dc
// > X509_ATTRIBUTE_set1_data @ 0xde5f5c
// > X509_NAME_ENTRY_set_data @ 0xdef70c
// > X509_alias_set1 @ 0xdf2b18
// > X509_keyid_set1 @ 0xdf2bdc
// > a2i_GENERAL_NAME @ 0xdf841c
// > sub_DFBBEC @ 0xdfbe70
// > sub_DFBBEC @ 0xdfc004
// > ASN1_BIT_STRING_set @ 0xe07ab4
// > ASN1_GENERALIZEDTIME_set_string @ 0xe08f2c
// > c2i_ASN1_INTEGER @ 0xe09d7c
// > c2i_ASN1_INTEGER @ 0xe0a2ec
// > ASN1_INTEGER_set_int64 @ 0xe0a7fc
// > ASN1_INTEGER_set_uint64 @ 0xe0aa98
// > BN_to_ASN1_INTEGER @ 0xe0ab88
// > ASN1_ENUMERATED_set_int64 @ 0xe0af24
// > BN_to_ASN1_ENUMERATED @ 0xe0b08c
// > ASN1_mbstring_ncopy @ 0xe0ba98
// > ASN1_OCTET_STRING_set @ 0xe0bd00
// > sub_E0D194 @ 0xe0d490
// > sub_E0D194 @ 0xe0d8b8
// > PKCS7_add1_attrib_digest @ 0xe6653c
// > s2i_ASN1_IA5STRING @ 0xe70474
// > PKCS5_pbe2_set_scrypt @ 0xe72f50
// > cms_DigestedData_do_final @ 0xe7b0b0
// > ??> @ 0x389e8
//
// 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
//
__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;
}