//
// sub_B8AABC from 0xb8aabc to 0xb8ae94 (984 bytes)
//
// 1 xrefs:
// > ??> @ 0x111c490
//
// 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
//
char *__fastcall sub_B8AABC(__int64 *a1, _BYTE *a2)
{
__int64 v2; // x21
int v3; // w26
__int64 v5; // x25
const char *v6; // x19
char *v7; // x0
char *v8; // x23
char *v9; // x22
char *v10; // x0
const char *v11; // x20
char *v12; // x0
char *v13; // x19
char *v14; // x0
const char *v15; // x22
unsigned int v16; // w19
char *v17; // x0
char *result; // x0
char *v19; // x0
char *v20; // x22
char *v21; // x19
char *v22; // x20
char *v23; // x0
char *v24; // x0
const char *v25; // x20
char *v26; // x19
int v27; // w0
_BYTE *v28; // x1
int v29; // t1
v2 = *a1;
v3 = *((_DWORD *)a1 + 152);
v5 = *a1 + 152;
v6 = *(const char **)(*a1 + 36032);
*a2 = 1;
if ( (unsigned int)sub_B94674(v6, "/MATCH:", 7)
|| (unsigned int)sub_B94674(v6, "/M:", 3)
|| (unsigned int)sub_B94674(v6, "/FIND:", 6) )
{
v7 = strchr(v6, 58);
v8 = v7;
if ( !v7 )
{
v13 = nullptr;
v9 = "default";
sub_B7B528(v2, "lookup word is missing\n");
goto LABEL_17;
}
v9 = v7 + 1;
v10 = strchr(v7 + 1, 58);
if ( v10 )
{
v11 = v10 + 1;
*v10 = 0;
v12 = strchr(v10 + 1, 58);
if ( v12 )
{
v13 = v12 + 1;
*v12 = 0;
v14 = strchr(v12 + 1, 58);
if ( v14 )
*v14 = 0;
}
else
{
v13 = nullptr;
}
if ( v8[1] )
{
LABEL_9:
if ( *v11 )
{
LABEL_10:
if ( !v13 || !*v13 )
{
v13 = &byte_EEFB80;
v15 = sub_B8A9A8(v2, v9);
if ( !v15 )
return (_BYTE *)(&off_18 + 3);
goto LABEL_13;
}
LABEL_12:
v15 = sub_B8A9A8(v2, v9);
if ( !v15 )
return (_BYTE *)(&off_18 + 3);
LABEL_13:
v16 = sub_B7B804(v3, a1, (__int64)"CLIENT libcurl 7.52.1\r\nMATCH %s %s %s\r\nQUIT\r\n", v11, v13, v15);
v17 = (char *)v15;
goto LABEL_14;
}
LABEL_17:
v11 = "!";
goto LABEL_10;
}
}
else
{
if ( v8[1] )
{
v11 = "!";
v13 = &byte_EEFB80;
goto LABEL_12;
}
v11 = nullptr;
v13 = nullptr;
}
v9 = "default";
sub_B7B528(v2, "lookup word is missing\n");
if ( !v11 )
goto LABEL_17;
goto LABEL_9;
}
if ( (unsigned int)sub_B94674(v6, "/DEFINE:", 8)
|| (unsigned int)sub_B94674(v6, "/D:", 3)
|| (unsigned int)sub_B94674(v6, "/LOOKUP:", 8) )
{
v19 = strchr(v6, 58);
v20 = v19;
v21 = v19;
if ( v19 )
{
v22 = v19 + 1;
v23 = strchr(v19 + 1, 58);
if ( v23 )
{
v21 = v23 + 1;
*v23 = 0;
v24 = strchr(v23 + 1, 58);
if ( v24 )
*v24 = 0;
if ( v20[1] )
{
LABEL_31:
if ( *v21 )
goto LABEL_33;
goto LABEL_32;
}
}
else
{
if ( v20[1] )
goto LABEL_32;
v21 = nullptr;
}
}
v22 = "default";
sub_B7B528(v2, "lookup word is missing\n");
if ( v21 )
goto LABEL_31;
LABEL_32:
v21 = "!";
LABEL_33:
v25 = sub_B8A9A8(v2, v22);
if ( v25 )
{
v16 = sub_B7B804(v3, a1, (__int64)"CLIENT libcurl 7.52.1\r\nDEFINE %s %s\r\nQUIT\r\n", v21, v25);
v17 = (char *)v25;
LABEL_14:
off_1231008(v17);
if ( v16 )
{
LABEL_21:
sub_B7B690(v2, "Failed sending DICT request");
return (char *)v16;
}
goto LABEL_15;
}
return (_BYTE *)(&off_18 + 3);
}
result = strchr(v6, 47);
v26 = result;
if ( result )
{
v27 = (unsigned __int8)result[1];
v28 = v26 + 1;
if ( v27 )
{
do
{
if ( v27 == 58 )
*v28 = 32;
v29 = (unsigned __int8)*++v28;
v27 = v29;
}
while ( v29 );
}
v16 = sub_B7B804(v3, a1, (__int64)"CLIENT libcurl 7.52.1\r\n%s\r\nQUIT\r\n", v26 + 1);
if ( v16 )
goto LABEL_21;
LABEL_15:
sub_B94394(a1, v16, -1, v16, v5, 0xFFFFFFFFLL, 0);
return (char *)v16;
}
return result;
}