//
// sub_D55028 from 0xd55028 to 0xd55110 (232 bytes)
//
// 2 xrefs:
// > tls1_set_curves_list @ 0xd55e54
// > tls1_set_curves_list @ 0xd55e7c
//
// 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
//
const void *__fastcall sub_D55028(const void *result, int a2, __int64 *a3)
{
__int64 v4; // x19
int v5; // w5
__int64 v6; // x0
int *v7; // x3
__int64 v8; // x1
int v9; // t1
__int64 v10; // x2
char v11[24]; // [xsp+38h] [xbp+38h] BYREF
if ( result )
{
if ( a2 > 19 )
return nullptr;
if ( *a3 == 28 )
return nullptr;
v4 = a2;
memcpy(v11, result, a2);
v11[v4] = 0;
v5 = EC_curve_nist2nid(v11);
if ( !v5 )
{
v5 = OBJ_sn2nid(v11);
if ( !v5 )
{
v5 = OBJ_ln2nid(v11);
if ( !v5 )
return nullptr;
}
}
v6 = *a3;
if ( *a3 )
{
if ( v5 == *((_DWORD *)a3 + 2) )
return nullptr;
v7 = (int *)a3 + 3;
v8 = 0;
while ( ++v8 != v6 )
{
v9 = *v7++;
if ( v5 == v9 )
return nullptr;
}
v10 = v6 + 1;
}
else
{
v10 = 1;
}
*a3 = v10;
*((_DWORD *)a3 + v6 + 2) = v5;
return dword_0 + 1;
}
return result;
}