//
// CMS_set_detached from 0x109e13c to 0x109e1e0 (164 bytes)
//
// 2 xrefs:
// > cms_Data_create @ 0x109e20c
// > ??> @ 0xaba90
//
// 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:17:30 +0000
//
__int64 *__fastcall CMS_set_detached(__int64 *a1, int a2)
{
__int64 *result; // x0
__int64 *v3; // x19
__int64 v4; // x20
__int64 v5; // x0
result = (__int64 *)CMS_get0_content(a1);
v3 = result;
if ( result )
{
if ( a2 )
{
ASN1_OCTET_STRING_free(*result);
*v3 = 0;
return (_QWORD *)(dword_0 + 1);
}
else
{
v4 = *result;
if ( *result || (v5 = ASN1_OCTET_STRING_new(), *v3 = v5, (v4 = v5) != 0) )
{
*(_QWORD *)(v4 + 16) |= 0x20uLL;
return (_QWORD *)(dword_0 + 1);
}
else
{
ERR_put_error(46, 147, 65, (__int64)"crypto/cms/cms_lib.c", 280);
return nullptr;
}
}
}
return result;
}