//
// EVP_CIPHER_asn1_to_param from 0x803788 to 0x803820 (152 bytes)
//
// 7 xrefs:
// > sub_7DF150 @ 0x7df8cc
// > sub_7E3D80 @ 0x7e45a4
// > PKCS7_dataDecode @ 0x8276f0
// > cms_RecipientInfo_pwri_crypt @ 0x876468
// > PKCS5_v2_PBE_keyivgen @ 0x8b8848
// > cms_EncryptedContent_init_bio @ 0x8cf5bc
// > ??> @ 0x609ec
//
// 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 EVP_CIPHER_asn1_to_param(int a1, int a2)
{
int (*v2)(void); // r2
int v6; // r0
int v7; // r0
int v8; // r3
v2 = *(int (**)(void))(*(_DWORD *)a1 + 40);
if ( v2 )
return v2();
if ( (*(_DWORD *)(*(_DWORD *)a1 + 16) & 0x1000) == 0 )
return -1;
v6 = EVP_CIPHER_CTX_cipher(a1);
v7 = EVP_CIPHER_flags(v6);
v8 = v7 & 0xF0007;
if ( (v7 & 0xF0007) != 0x10001 )
{
if ( (v7 & 0xF0007u) <= 0x10001 )
{
if ( (unsigned int)(v8 - 6) > 1 )
return EVP_CIPHER_get_asn1_iv(a1, a2);
}
else
{
if ( v8 == 65538 )
return 1;
if ( v8 != 65539 )
return EVP_CIPHER_get_asn1_iv(a1, a2);
}
}
return -1;
}