//
// SSL_set_session from 0xd47358 to 0xd473c0 (104 bytes)
//
// 3 xrefs:
// > sub_BB78D0 @ 0xbb8898
// > SSL_copy_session_id @ 0xd3fc60
// > ??> @ 0x98e20
//
// 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 SSL_set_session(__int64 a1, __int64 a2)
{
__int64 v4; // x1
__int64 result; // x0
ssl_clear_bad_session(a1);
v4 = **(_QWORD **)(a1 + 440);
if ( v4 == *(_QWORD *)(a1 + 8) || (result = SSL_set_ssl_method(a1, v4), (_DWORD)result) )
{
if ( a2 )
{
SSL_SESSION_up_ref(a2);
*(_QWORD *)(a1 + 456) = *(_QWORD *)(a2 + 176);
}
SSL_SESSION_free(*(_QWORD *)(a1 + 376));
*(_QWORD *)(a1 + 376) = a2;
return 1;
}
return result;
}