//
// CMS_set_detached from 0xa8a11c to 0xa8a1c4 (168 bytes)
//
// 2 xrefs:
// > cms_Data_create @ 0xa8a1ec
// > ??> @ 0x83eec
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:08:54 +0000
//
int __fastcall CMS_set_detached(int *a1, int a2)
{
int *v3; // r0
int *v4; // r4
int v5; // r5
v3 = (int *)CMS_get0_content(a1);
v4 = v3;
if ( !v3 )
return 0;
if ( a2 )
{
ASN1_OCTET_STRING_free(*v3);
*v4 = 0;
return 1;
}
else
{
v5 = *v3;
if ( *v3 || (v5 = ASN1_OCTET_STRING_new(), (*v4 = v5) != 0) )
{
*(_DWORD *)(v5 + 12) |= 0x20u;
return 1;
}
else
{
ERR_put_error(46, 147, 65, (int)"crypto/cms/cms_lib.c", 280);
return 0;
}
}
}