//
// SSL_CONF_cmd from 0xd62b7c to 0xd62e20 (676 bytes)
//
// 5 xrefs:
// > sub_D60724 @ 0xd6086c
// > SSL_CONF_cmd_argv @ 0xd62e70
// > SSL_CONF_cmd_argv @ 0xd62ecc
// > SSL_CONF_cmd_argv @ 0xd62f18
// > ??> @ 0xc3900
//
// 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_CONF_cmd(__int64 a1, char *a2, __int64 a3)
{
char *v3; // x19
const char *v6; // x22
size_t v7; // x0
size_t v8; // x23
int v9; // w24
char **v10; // x0
int v11; // w0
bool v12; // cc
int v13; // w1
__int64 result; // x0
unsigned __int64 v15; // x1
_DWORD *v16; // x2
char *v17; // x3
__int64 v18; // x1
int v19; // w0
int v20; // w0
int v21; // w0
int v22; // w0
v3 = a2;
if ( !a2 )
{
ERR_put_error(20, 334, 385, "ssl/ssl_conf.c", 683);
return 0;
}
v6 = *(const char **)(a1 + 8);
if ( v6 )
{
v7 = strlen(a2);
v8 = *(_QWORD *)(a1 + 16);
if ( v7 <= v8 )
return 4294967294LL;
v9 = *(_DWORD *)a1;
if ( (*(_DWORD *)a1 & 1) != 0 )
{
if ( strncmp(v3, v6, *(_QWORD *)(a1 + 16)) )
return 4294967294LL;
}
if ( (v9 & 2) != 0 && strncasecmp(v3, v6, v8) )
return 4294967294LL;
v3 += v8;
}
else
{
v9 = *(_DWORD *)a1;
if ( (*(_DWORD *)a1 & 1) != 0 )
{
if ( *a2 != 45 )
return 4294967294LL;
v3 = a2 + 1;
if ( !a2[1] )
return 4294967294LL;
}
}
v10 = sub_D62058((int *)a1, v3);
if ( !v10 )
{
if ( (v9 & 0x10) != 0 )
{
ERR_put_error(20, 334, 386, "ssl/ssl_conf.c", 712);
ERR_add_error_data(2, "cmd=", v3);
}
return 4294967294LL;
}
if ( *((_WORD *)v10 + 13) == 4 )
{
v15 = ((char *)v10 - (char *)&unk_1121640) >> 5;
if ( v15 > 0xE )
return 0;
v16 = *(_DWORD **)(a1 + 40);
v17 = (char *)&unk_F63648 + 16 * v15;
v18 = *(_QWORD *)v17;
if ( !v16 )
return 1;
if ( (*((_DWORD *)v17 + 2) & 1) != 0 )
{
v19 = *((_DWORD *)v17 + 2) & 0xF00;
if ( v19 != 256 )
{
if ( v19 != 512 )
{
if ( v19 )
return 1;
LABEL_37:
*v16 &= ~(_DWORD)v18;
return 1;
}
v20 = 0;
v16 = *(_DWORD **)(a1 + 112);
LABEL_36:
if ( !v20 )
goto LABEL_37;
LABEL_41:
*v16 |= v18;
return 1;
}
v16 = *(_DWORD **)(a1 + 104);
v22 = 0;
}
else
{
v21 = *((_DWORD *)v17 + 2) & 0xF00;
if ( v21 != 256 )
{
if ( v21 != 512 )
{
if ( v21 )
return 1;
goto LABEL_41;
}
v16 = *(_DWORD **)(a1 + 112);
v20 = 1;
goto LABEL_36;
}
v22 = 1;
v16 = *(_DWORD **)(a1 + 104);
}
if ( !v22 )
goto LABEL_37;
goto LABEL_41;
}
if ( !a3 )
return 4294967293LL;
v11 = ((__int64 (__fastcall *)(__int64, __int64))*v10)(a1, a3);
v12 = v11 <= 0;
v13 = v11;
result = 2;
if ( v12 )
{
if ( v13 != -2 )
{
if ( (*(_DWORD *)a1 & 0x10) != 0 )
{
ERR_put_error(20, 334, 384, "ssl/ssl_conf.c", 705);
ERR_add_error_data(4, "cmd=", v3);
return 0;
}
return 0;
}
return 4294967294LL;
}
return result;
}