//
// HMAC_CTX_copy from 0xdb00b8 to 0xdb0168 (176 bytes)
//
// 4 xrefs:
// > sub_DAF960 @ 0xdaf9e0
// > PKCS5_PBKDF2_HMAC @ 0xe6243c
// > PKCS5_PBKDF2_HMAC @ 0xe62974
// > ??> @ 0xb1450
//
// 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 HMAC_CTX_copy(__int64 a1, __int64 a2)
{
int v5; // w2
if ( (unsigned int)HMAC_CTX_reset(a1)
&& (unsigned int)EVP_MD_CTX_copy_ex(*(__int64 **)(a1 + 16), *(__int64 **)(a2 + 16))
&& (unsigned int)EVP_MD_CTX_copy_ex(*(__int64 **)(a1 + 24), *(__int64 **)(a2 + 24))
&& (unsigned int)EVP_MD_CTX_copy_ex(*(__int64 **)(a1 + 8), *(__int64 **)(a2 + 8)) )
{
memcpy((void *)(a1 + 36), (const void *)(a2 + 36), 0x80u);
v5 = *(_DWORD *)(a2 + 32);
*(_QWORD *)a1 = *(_QWORD *)a2;
*(_DWORD *)(a1 + 32) = v5;
return 1;
}
else
{
EVP_MD_CTX_reset(*(__int64 **)(a1 + 16));
EVP_MD_CTX_reset(*(__int64 **)(a1 + 24));
EVP_MD_CTX_reset(*(__int64 **)(a1 + 8));
*(_QWORD *)a1 = 0;
*(_DWORD *)(a1 + 32) = 0;
OPENSSL_cleanse((_BYTE *)(a1 + 36), 0x80u);
return 0;
}
}