//
// ASN1_TYPE_get_octetstring from 0x8669c0 to 0x866a4c (140 bytes)
//
// 2 xrefs:
// > EVP_CIPHER_get_asn1_iv @ 0x803728
// > ??> @ 0x635ec
//
// 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
//
int __fastcall ASN1_TYPE_get_octetstring(_DWORD *a1, void *a2, signed int a3)
{
int v4; // r0
const void *v7; // r7
int v8; // r4
size_t v9; // r2
if ( *a1 == 4 && (v4 = a1[1]) != 0 )
{
v7 = (const void *)ASN1_STRING_get0_data(v4);
v8 = ASN1_STRING_length(a1[1]);
if ( v8 >= a3 )
v9 = a3;
else
v9 = v8;
memcpy(a2, v7, v9);
return v8;
}
else
{
ERR_put_error(13, 135, 109, (int)"crypto/asn1/evp_asn1.c", 36);
return -1;
}
}