//
// ossl_statem_server_read_transition from 0xd4fd5c to 0xd4fef4 (408 bytes)
//
// 4 xrefs:
// > sub_D47644 @ 0xd479f0
// > ??> @ 0xa2288
// > sub_D47644 @ 0xd47d7c
// > ??> @ 0x122d970
//
// 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 ossl_statem_server_read_transition(__int64 a1, int a2)
{
switch ( *(_DWORD *)(a1 + 92) )
{
case 0:
case 0x15:
if ( a2 != 1 )
goto LABEL_4;
*(_DWORD *)(a1 + 92) = 20;
return 1;
case 0x1A:
if ( a2 == 16 )
{
if ( !*(_DWORD *)(*(_QWORD *)(a1 + 144) + 648LL) )
goto LABEL_18;
if ( *(_DWORD *)a1 != 768 )
goto LABEL_4;
if ( (*(_DWORD *)(a1 + 392) & 3) != 3 )
goto LABEL_18;
ssl3_send_alert(a1, 2, 0x28u);
ERR_put_error(20, 418, 199, "ssl/statem/statem_srvr.c", 117);
return 0;
}
else
{
if ( a2 != 11 || !*(_DWORD *)(*(_QWORD *)(a1 + 144) + 648LL) )
goto LABEL_4;
*(_DWORD *)(a1 + 92) = 27;
return 1;
}
case 0x1B:
if ( a2 != 16 )
goto LABEL_4;
LABEL_18:
*(_DWORD *)(a1 + 92) = 28;
return 1;
case 0x1C:
if ( !*(_QWORD *)(*(_QWORD *)(a1 + 376) + 152LL) || *(_DWORD *)(a1 + 108) )
goto LABEL_7;
if ( a2 != 15 )
goto LABEL_4;
*(_DWORD *)(a1 + 92) = 29;
return 1;
case 0x1D:
case 0x24:
LABEL_7:
if ( a2 != 257 )
goto LABEL_4;
*(_DWORD *)(a1 + 92) = 31;
return 1;
case 0x1E:
goto LABEL_9;
case 0x1F:
if ( *(_DWORD *)(*(_QWORD *)(a1 + 144) + 968LL) )
{
if ( a2 != 67 )
{
LABEL_4:
ssl3_send_alert(a1, 2, 0xAu);
ERR_put_error(20, 418, 244, "ssl/statem/statem_srvr.c", 217);
return 0;
}
*(_DWORD *)(a1 + 92) = 30;
return 1;
}
else
{
LABEL_9:
if ( a2 != 20 )
goto LABEL_4;
*(_DWORD *)(a1 + 92) = 32;
return 1;
}
default:
goto LABEL_4;
}
}