//
// ssl_parse_clienthello_tlsext from 0xd5a0ec to 0xd5a20c (288 bytes)
//
// 2 xrefs:
// > tls_process_client_hello @ 0xd50e94
// > ??> @ 0x47130
//
// 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_parse_clienthello_tlsext(__int64 a1, unsigned __int8 **a2)
{
__int64 v3; // x0
__int64 v4; // x0
__int64 (__fastcall *v5)(__int64, unsigned int *, _QWORD); // x3
int v6; // w0
unsigned int v9; // [xsp+48h] [xbp+48h] BYREF
unsigned int v10; // [xsp+4Ch] [xbp+4Ch] BYREF
v3 = *(_QWORD *)(a1 + 328);
v9 = -1;
custom_ext_init((__int64 *)(v3 + 424));
if ( (int)sub_D59610(a1, a2, &v9) <= 0 )
{
ssl3_send_alert(a1, 2, v9);
return 0;
}
else
{
v4 = *(_QWORD *)(a1 + 440);
v10 = 112;
if ( !v4 || (v5 = *(__int64 (__fastcall **)(__int64, unsigned int *, _QWORD))(v4 + 448)) == nullptr )
{
v4 = *(_QWORD *)(a1 + 720);
if ( !v4 )
goto LABEL_11;
v5 = *(__int64 (__fastcall **)(__int64, unsigned int *, _QWORD))(v4 + 448);
if ( !v5 )
goto LABEL_11;
}
v6 = v5(a1, &v10, *(_QWORD *)(v4 + 456));
if ( v6 != 2 )
{
if ( v6 != 3 )
{
if ( v6 == 1 )
ssl3_send_alert(a1, 1, v10);
return 1;
}
LABEL_11:
*(_DWORD *)(a1 + 560) = 0;
return 1;
}
ssl3_send_alert(a1, 2, v10);
ERR_put_error(20, 302, 226, "ssl/t1_lib.c", 2371);
return 0;
}
}