//
// ssl_parse_clienthello_renegotiate_ext from 0xd5bd68 to 0xd5be7c (276 bytes)
//
// 2 xrefs:
// > sub_D59610 @ 0xd59a9c
// > ??> @ 0xc4398
//
// 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_renegotiate_ext(__int64 a1, unsigned __int8 **a2, _DWORD *a3)
{
unsigned __int8 *v3; // x3
unsigned __int64 v5; // x3
char *v6; // x4
int v7; // w6
__int64 v8; // x20
int v9; // w2
__int64 result; // x0
v3 = a2[1];
if ( v3
&& (v5 = (unsigned __int64)(v3 - 1),
v6 = (char *)(*a2 + 1),
v7 = **a2,
*a2 = (unsigned __int8 *)v6,
a2[1] = (unsigned __int8 *)v5,
(unsigned __int8)v7 <= v5) )
{
v8 = *(_QWORD *)(a1 + 144);
a2[1] = (unsigned __int8 *)(v5 - (unsigned __int8)v7);
*a2 = (unsigned __int8 *)&v6[(unsigned __int8)v7];
v9 = *(unsigned __int8 *)(v8 + 896);
if ( v9 == v7 )
{
if ( !memcmp(v6, (const void *)(v8 + 832), (unsigned __int8)v9) )
{
*(_DWORD *)(v8 + 964) = 1;
return 1;
}
else
{
ERR_put_error(20, 300, 337, "ssl/t1_reneg.c", 66);
*a3 = 40;
return 0;
}
}
else
{
ERR_put_error(20, 300, 337, "ssl/t1_reneg.c", 58);
*a3 = 40;
return 0;
}
}
else
{
ERR_put_error(20, 300, 336, "ssl/t1_reneg.c", 50);
result = 0;
*a3 = 47;
}
return result;
}