//
// SSL_CTX_add_server_custom_ext from 0x9c1ff0 to 0x9c2138 (328 bytes)
//
// 2 xrefs:
// > SSL_CTX_use_serverinfo @ 0x9b1bcc
// > ??> @ 0x7643c
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 12:07:04 +0000
//
int __fastcall SSL_CTX_add_server_custom_ext(int a1, unsigned int a2, int a3, int a4, int a5, int a6, int a7)
{
_BOOL4 v7; // r12
int v8; // r5
int v12; // r2
unsigned __int16 *v13; // r0
int v14; // r1
int v15; // r12
int v16; // t1
int v17; // r1
int v18; // r0
int v19; // r9
int v20; // r8
_DWORD *v21; // r10
int v22; // r3
v7 = a3 == 0;
if ( !a4 )
v7 = 0;
v8 = *(_DWORD *)(a1 + 176);
if ( v7 )
return 0;
if ( SSL_extension_supported(a2) )
{
if ( a2 != 18 )
return 0;
}
else if ( a2 >= 0x10000 )
{
return 0;
}
v12 = *(_DWORD *)(v8 + 220);
v13 = *(unsigned __int16 **)(v8 + 216);
if ( v12 )
{
if ( a2 != *v13 )
{
v14 = *(_DWORD *)(v8 + 216);
v15 = 0;
while ( ++v15 != v12 )
{
v16 = *(unsigned __int16 *)(v14 + 28);
v14 += 28;
if ( a2 == v16 )
return 0;
}
v17 = 28 * (v15 + 1);
goto LABEL_13;
}
return 0;
}
v17 = 28;
LABEL_13:
v18 = CRYPTO_realloc(v13, v17, "ssl/t1_ext.c", 182);
v19 = v18;
if ( v18 )
{
v20 = *(_DWORD *)(v8 + 220);
*(_DWORD *)(v8 + 216) = v18;
v20 *= 28;
v21 = (_DWORD *)(v18 + v20);
memset((void *)(v18 + v20), 0, 0x1Cu);
v22 = *(_DWORD *)(v8 + 220);
v21[5] = a6;
v21[2] = a3;
v21[3] = a4;
*(_WORD *)(v19 + v20) = a2;
v21[4] = a5;
v21[6] = a7;
*(_DWORD *)(v8 + 220) = v22 + 1;
return 1;
}
else
{
CRYPTO_free(*(_DWORD *)(v8 + 216), "ssl/t1_ext.c", 185);
*(_DWORD *)(v8 + 216) = 0;
*(_DWORD *)(v8 + 220) = 0;
return 0;
}
}