//
// CMS_stream from 0xe1eb40 to 0xe1ebdc (156 bytes)
//
// 2 xrefs:
// > sub_E1D530 @ 0xe1d584
// > ??> @ 0x5be78
//
// 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 CMS_stream(_QWORD *a1, __int64 a2)
{
__int64 *result; // x0
__int64 *v4; // x19
__int64 v5; // x20
__int64 v6; // x0
result = (__int64 *)CMS_get0_content(a2);
v4 = result;
if ( result )
{
v5 = *result;
if ( *result || (v6 = ASN1_OCTET_STRING_new(), *v4 = v6, (v5 = v6) != 0) )
{
*(_QWORD *)(v5 + 16) = *(_QWORD *)(v5 + 16) & 0xFFFFFFFFFFFFFFCFLL | 0x10;
*a1 = v5 + 8;
return (_QWORD *)(dword_0 + 1);
}
else
{
ERR_put_error(46, 155, 65, (__int64)"crypto/cms/cms_io.c", 31);
return nullptr;
}
}
return result;
}