//
// SSL_get_shared_ciphers from 0x7982b8 to 0x798390 (216 bytes)
//
// 1 xrefs:
// > ??> @ 0x5be1c
//
// 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
//
_BYTE *__fastcall SSL_get_shared_ciphers(int a1, _BYTE *a2, int a3)
{
int v3; // r3
int v4; // r8
signed int v5; // r7
bool v6; // cc
int v7; // r5
_BYTE *v9; // r6
const char *v10; // r11
signed int v11; // r4
_BYTE *v12; // r3
int v13; // r0
int v14; // r1
v3 = *(_DWORD *)(a1 + 240);
if ( !v3 )
return nullptr;
v4 = *(_DWORD *)(v3 + 180);
v5 = a3;
v6 = v4 <= 0;
if ( v4 )
v6 = a3 <= 1;
v7 = v6;
if ( v6 || !OPENSSL_sk_num(*(_DWORD *)(v3 + 180)) )
return nullptr;
v9 = a2;
while ( 1 )
{
v13 = OPENSSL_sk_num(v4);
v14 = v7;
v6 = v7++ < v13;
if ( !v6 )
{
*(v9 - 1) = 0;
return a2;
}
v10 = *(const char **)(OPENSSL_sk_value(v4, v14) + 4);
v11 = strlen(v10);
if ( v5 <= v11 )
break;
memcpy(v9, v10, v11 + 1);
v12 = &v9[v11];
v9 += v11 + 1;
v5 += ~v11;
*v12 = 58;
}
if ( a2 != v9 )
--v9;
*v9 = 0;
return a2;
}