//
// ASN1_TYPE_get_int_octetstring from 0xe0eae8 to 0xe0ebf8 (272 bytes)
//
// 2 xrefs:
// > sub_DA7C88 @ 0xda7cd4
// > ??> @ 0xc5a48
//
// 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_TYPE_get_int_octetstring(__int64 a1, _QWORD *a2, void *a3, int a4)
{
__int64 v5; // x19
__int64 v7; // x0
unsigned int v8; // w20
const void *v9; // x1
unsigned int v10; // w2
if ( *(_DWORD *)a1 != 16
|| !*(_QWORD *)(a1 + 8)
|| (v7 = ASN1_TYPE_unpack_sequence((__int64)byte_1131E80, a1), (v5 = v7) == 0) )
{
v5 = 0;
LABEL_3:
ERR_put_error(13, 134, 109, (__int64)"crypto/asn1/evp_asn1.c", 111);
ASN1_item_free(v5, byte_1131E80);
return 0xFFFFFFFFLL;
}
if ( a2 )
*a2 = *(_QWORD *)v7;
v8 = ASN1_STRING_length(*(unsigned int **)(v7 + 8));
if ( a3 )
{
v9 = (const void *)ASN1_STRING_get0_data(*(_QWORD *)(v5 + 8));
if ( (int)v8 > a4 )
v10 = a4;
else
v10 = v8;
memcpy(a3, v9, (int)v10);
}
if ( v8 == -1 )
goto LABEL_3;
ASN1_item_free(v5, byte_1131E80);
return v8;
}