//
// sub_BA47DC from 0xba47dc to 0xba4948 (364 bytes)
//
// 1 xrefs:
// > sub_B71BAC @ 0xb71cf4
//
// 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
//
void **__fastcall sub_BA47DC(char *cp, unsigned __int16 a2)
{
void **result; // x0
void **v5; // x19
char *v6; // x0
char *v7; // x22
void **v8; // x21
int buf; // [xsp+40h] [xbp+40h] BYREF
_BYTE v10[16]; // [xsp+48h] [xbp+48h] BYREF
if ( inet_pton(2, cp, &buf) <= 0 )
{
if ( inet_pton(10, cp, v10) <= 0 )
return nullptr;
else
return sub_BA4688(10, (__int64)v10, cp, a2);
}
else
{
result = (void **)off_1231000(0x40u);
v5 = result;
if ( result )
{
v6 = off_1231018(cp);
v7 = v6;
if ( v6 )
{
*((_DWORD *)v5 + 8) = buf;
*((_DWORD *)v5 + 4) = 2;
v5[3] = v5 + 6;
v5[6] = v5 + 4;
*v5 = v6;
*((_DWORD *)v5 + 5) = 4;
v5[1] = nullptr;
v5[7] = nullptr;
v8 = sub_BA445C((__int64)v5, a2);
off_1231008(v7);
off_1231008(v5);
return v8;
}
else
{
off_1231008(v5);
return nullptr;
}
}
}
return result;
}