//
// SSL_CONF_cmd from 0x7bc694 to 0x7bc93c (680 bytes)
//
// 5 xrefs:
// > sub_7B9D64 @ 0x7b9e5c
// > SSL_CONF_cmd_argv @ 0x7bc9bc
// > SSL_CONF_cmd_argv @ 0x7bca04
// > SSL_CONF_cmd_argv @ 0x7bca4c
// > ??> @ 0x5dffc
//
// 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 SSL_CONF_cmd(int *a1, char *a2, int a3)
{
char *v3; // r4
const char *v4; // r7
size_t v7; // r8
int v8; // r9
char **v9; // r0
int v10; // r0
unsigned int v12; // r0
_DWORD *v13; // r1
int v14; // r2
int v15; // r3
int v16; // r3
int v17; // r3
v3 = a2;
if ( !a2 )
{
ERR_put_error(20, 334, 385, "ssl/ssl_conf.c", 683);
return 0;
}
v4 = (const char *)a1[1];
if ( v4 )
{
v7 = a1[2];
if ( strlen(a2) <= v7 )
return -2;
v8 = *a1;
if ( (*a1 & 1) != 0 )
{
if ( strncmp(v3, v4, a1[2]) )
return -2;
}
if ( (v8 & 2) != 0 && strncasecmp(v3, v4, v7) )
return -2;
v3 += v7;
}
else
{
v8 = *a1;
if ( (*a1 & 1) != 0 )
{
if ( *a2 != 45 || !a2[1] )
return -2;
v3 = a2 + 1;
}
}
v9 = sub_7BB7E8(a1, v3);
if ( !v9 )
{
if ( (v8 & 0x10) != 0 )
{
ERR_put_error(20, 334, 386, "ssl/ssl_conf.c", 712);
ERR_add_error_data(2, "cmd=", v3);
}
return -2;
}
if ( *((_WORD *)v9 + 7) == 4 )
{
v12 = ((char *)v9 - (char *)&unk_A300F0) >> 4;
if ( v12 > 0xE )
return 0;
v13 = (_DWORD *)a1[5];
v14 = dword_A0CF04[2 * v12];
if ( !v13 )
return 1;
if ( (dword_A0CF04[2 * v12 + 1] & 1) != 0 )
{
v15 = dword_A0CF04[2 * v12 + 1] & 0xF00;
if ( v15 != 256 )
{
if ( v15 != 512 )
{
if ( v15 )
return 1;
LABEL_42:
*v13 &= ~v14;
return 1;
}
v17 = 0;
LABEL_44:
v13 = (_DWORD *)a1[14];
LABEL_41:
if ( !v17 )
goto LABEL_42;
LABEL_37:
*v13 |= v14;
return 1;
}
v17 = 0;
}
else
{
v16 = dword_A0CF04[2 * v12 + 1] & 0xF00;
if ( v16 != 256 )
{
if ( v16 != 512 )
{
if ( v16 )
return 1;
goto LABEL_37;
}
v17 = 1;
goto LABEL_44;
}
v17 = 1;
}
v13 = (_DWORD *)a1[13];
goto LABEL_41;
}
if ( a3 )
{
v10 = ((int (__fastcall *)(int *, int))*v9)(a1, a3);
if ( v10 > 0 )
return 2;
if ( v10 != -2 )
{
if ( (*a1 & 0x10) != 0 )
{
ERR_put_error(20, 334, 384, "ssl/ssl_conf.c", 705);
ERR_add_error_data(4, "cmd=", v3);
}
return 0;
}
return -2;
}
return -3;
}