//
// sub_DA7B48 from 0xda7b48 to 0xda7c0c (196 bytes)
//
// 4 xrefs:
// > ??> @ 0x12227a0
// > ??> @ 0x12227f8
// > ??> @ 0x1222850
// > ??> @ 0x12228a8
//
// 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 sub_DA7B48(__int64 a1, __int64 a2, __int64 a3, int a4)
{
__int64 cipher_data; // x0
__int64 v8; // x0
__int64 v9; // x0
__int64 v10; // x0
_BYTE v11[216]; // [xsp+38h] [xbp+38h] BYREF
if ( a4
|| (v8 = EVP_CIPHER_CTX_cipher(a1), (EVP_CIPHER_flags(v8) & 0xF0007) == 4)
|| (v9 = EVP_CIPHER_CTX_cipher(a1), (EVP_CIPHER_flags(v9) & 0xF0007) == 3) )
{
cipher_data = EVP_CIPHER_CTX_get_cipher_data(a1);
IDEA_set_encrypt_key(a2, cipher_data);
return 1;
}
else
{
IDEA_set_encrypt_key(a2, v11);
v10 = EVP_CIPHER_CTX_get_cipher_data(a1);
IDEA_set_decrypt_key(v11, v10);
OPENSSL_cleanse(v11, 0xD8u);
return 1;
}
}