//
// PKCS7_ctrl from 0x104c760 to 0x104c8bc (348 bytes)
//
// 5 xrefs:
// > PKCS7_dataInit @ 0x104aed8
// > PKCS7_dataDecode @ 0x104b55c
// > PKCS7_dataDecode @ 0x104b5d8
// > PKCS7_dataFinal @ 0x104bf6c
// > ??> @ 0xec128
//
// 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:16:36 +0000
//
__int64 __fastcall PKCS7_ctrl(__int64 a1, int a2, int a3)
{
__int64 v4; // x19
int v5; // w0
__int64 v7; // x0
__int64 v8; // x19
LODWORD(v4) = a3;
v5 = OBJ_obj2nid(*(_QWORD *)(a1 + 24));
if ( a2 == 1 )
{
if ( v5 == 22 )
{
*(_DWORD *)(a1 + 20) = v4;
v4 = (int)v4;
if ( (_DWORD)v4 && (unsigned int)OBJ_obj2nid(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 40LL) + 24LL)) == 21 )
{
ASN1_OCTET_STRING_free(*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 40LL) + 32LL));
*(_QWORD *)(*(_QWORD *)(*(_QWORD *)(a1 + 32) + 40LL) + 32LL) = 0;
}
return v4;
}
ERR_put_error(33, 104, 104, (__int64)"crypto/pkcs7/pk7_lib.c", 37);
return 0;
}
else
{
if ( a2 != 2 )
{
v4 = 0;
ERR_put_error(33, 104, 110, (__int64)"crypto/pkcs7/pk7_lib.c", 57);
return v4;
}
if ( v5 == 22 )
{
v7 = *(_QWORD *)(a1 + 32);
if ( v7 )
{
LODWORD(v8) = *(_QWORD *)(*(_QWORD *)(v7 + 40) + 32LL) == 0;
*(_DWORD *)(a1 + 20) = v8;
return (unsigned __int8)v8;
}
else
{
v8 = 1;
*(_DWORD *)(a1 + 20) = 1;
}
return v8;
}
else
{
ERR_put_error(33, 104, 104, (__int64)"crypto/pkcs7/pk7_lib.c", 51);
return 0;
}
}
}