//
// sub_10069054C from 0x10069054c to 0x10069075c (528 bytes)
//
// 2 xrefs:
// > sub_100682CAC @ 0x100682d74
// > sub_100690820 @ 0x100690c74
//
// This function is hookable on this platform (idp: arm, 32 bit: False, 64 bit: True!
//
// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA
// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings
// Generated at Fri, 27 Nov 2026 11:11:31 +0000
//
__int64 __fastcall sub_10069054C(__int64 result, int a2)
{
__int64 v3; // x20
__int64 v4; // x19
_OWORD *v5; // x21
_OWORD *v6; // x22
_OWORD *v7; // x8
_OWORD *v8; // x9
__int64 v9; // x21
__int64 v10; // x21
__int64 v11; // x21
__int64 v12; // x21
socklen_t v13; // [xsp+24h] [xbp-14Ch] BYREF
sockaddr __b[8]; // [xsp+28h] [xbp-148h] BYREF
sockaddr v15; // [xsp+A8h] [xbp-C8h] BYREF
v3 = result;
if ( *(_DWORD *)(result + 172) != 2 )
{
v4 = *(_QWORD *)result;
if ( *(_BYTE *)(result + 738) )
{
v5 = (_OWORD *)(result + 252);
v6 = (_OWORD *)(result + 312);
LABEL_4:
*(_OWORD *)(v4 + 35862) = *(_OWORD *)((char *)v5 + 30);
*(_OWORD *)(v4 + 35848) = v5[1];
*(_OWORD *)(v4 + 35832) = *v5;
v7 = *(_OWORD **)v3;
*(_OWORD *)((char *)v7 + 35918) = *(_OWORD *)((char *)v6 + 30);
v7[2244] = v6[1];
v7[2243] = *v6;
v8 = *(_OWORD **)v3;
*((_QWORD *)v8 + 4485) = *(_QWORD *)(v3 + 304);
*((_QWORD *)v8 + 4492) = *(_QWORD *)(v3 + 360);
return result;
}
v13 = 128;
if ( getpeername(a2, &v15, &v13) )
{
v9 = (unsigned int)*__error();
sub_1006962D0(v3, v9);
return sub_10067889C(v4, "getpeername() failed with errno %d: %s");
}
else
{
v13 = 128;
memset(__b, 0, sizeof(__b));
if ( getsockname(a2, __b, &v13) )
{
v10 = (unsigned int)*__error();
sub_1006962D0(v3, v10);
return sub_10067889C(v4, "getsockname() failed with errno %d: %s");
}
else
{
v5 = (_OWORD *)(v3 + 252);
if ( (sub_10069075C((int)&v15, (char *)(v3 + 252)) & 1) != 0 )
{
*(_OWORD *)(v3 + 150) = *(_OWORD *)(v3 + 282);
*(_OWORD *)(v3 + 136) = *(_OWORD *)(v3 + 268);
*(_OWORD *)(v3 + 120) = *v5;
v6 = (_OWORD *)(v3 + 312);
result = sub_10069075C((int)__b, (char *)(v3 + 312));
if ( (_DWORD)result )
{
v4 = *(_QWORD *)v3;
goto LABEL_4;
}
v12 = (unsigned int)*__error();
sub_1006962D0(v3, v12);
return sub_10067889C(v4, "ssloc inet_ntop() failed with errno %d: %s");
}
else
{
v11 = (unsigned int)*__error();
sub_1006962D0(v3, v11);
return sub_10067889C(v4, "ssrem inet_ntop() failed with errno %d: %s");
}
}
}
}
return result;
}