//
// custom_ext_parse from 0x7acff4 to 0x7ad0d0 (220 bytes)
//
// 3 xrefs:
// > ssl_parse_serverhello_tlsext @ 0x7aff00
// > sub_7B2438 @ 0x7b2de4
// > ??> @ 0x5d7bc
//
// 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 custom_ext_parse(int a1, int a2, int a3, int a4, int a5, _DWORD *a6)
{
int v6; // r12
unsigned __int16 **v7; // r12
unsigned __int16 *v8; // r5
unsigned __int16 *v9; // r12
unsigned __int16 *v10; // lr
int v12; // lr
int (__fastcall *v13)(int, int); // r4
v6 = *(_DWORD *)(a1 + 200);
if ( a2 )
v7 = (unsigned __int16 **)(v6 + 216);
else
v7 = (unsigned __int16 **)(v6 + 208);
v8 = v7[1];
v9 = *v7;
if ( !v8 )
return 1;
if ( a3 != *v9 )
{
v10 = nullptr;
do
{
v10 = (unsigned __int16 *)((char *)v10 + 1);
v9 += 14;
if ( v10 == v8 )
return 1;
}
while ( a3 != *v9 );
}
if ( a2 )
{
v12 = *((_DWORD *)v9 + 1);
}
else
{
v12 = *((_DWORD *)v9 + 1);
if ( (v12 & 2) == 0 )
{
*a6 = 110;
return 0;
}
}
if ( (v12 & 1) == 0 )
{
v13 = *((int (__fastcall **)(int, int))v9 + 5);
*((_DWORD *)v9 + 1) = v12 | 1;
if ( v13 )
return v13(a1, a3);
return 1;
}
*a6 = 50;
return 0;
}