//
// ssl_clear_bad_session from 0x79ea14 to 0x79ea74 (96 bytes)
//
// 4 xrefs:
// > SSL_free @ 0x799fac
// > SSL_clear @ 0x79a290
// > SSL_set_session @ 0x79ea80
// > ??> @ 0x5c42c
//
// 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 ssl_clear_bad_session(int a1)
{
if ( !*(_DWORD *)(a1 + 240) || (*(_DWORD *)(a1 + 40) & 1) != 0 )
return 0;
if ( SSL_in_init(a1) || SSL_in_before(a1) )
return 0;
SSL_CTX_remove_session(*(_DWORD **)(a1 + 444), *(_DWORD **)(a1 + 240));
return 1;
}