//
// cocos2d::extension::WebSocket::onSubThreadStarted from 0x7b3258 to 0x7b3354 (252 bytes)
//
// 0 xrefs:
//
// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!
//
// 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 12:00:09 +0000
//
int __fastcall cocos2d::extension::WebSocket::onSubThreadStarted(cocos2d::extension::WebSocket *this)
{
int v2; // r2
int result; // r0
int v4; // r5
int v5; // r3
const char *v6; // r9
size_t v7; // r0
char *v8; // r1
char *v9; // r2
char *v10; // r5
char *v11; // r3
_DWORD v12[2]; // [sp+1Ch] [bp-88h] BYREF
char *v13; // [sp+24h] [bp-80h]
_DWORD v14[29]; // [sp+28h] [bp-7Ch] BYREF
memset(v14, 0, sizeof(v14));
v2 = *((_DWORD *)this + 14);
v14[15] = this;
v14[0] = -1;
v14[2] = v2;
v14[12] = -1;
v14[13] = -1;
result = lws_create_context(v14);
*((_DWORD *)this + 11) = result;
if ( result )
{
v4 = 0;
*((_DWORD *)this + 1) = 0;
v12[0] = 0;
v12[1] = 0;
v13 = nullptr;
while ( 1 )
{
v5 = *((_DWORD *)this + 14);
if ( !*(_DWORD *)(v5 + v4 + 4) )
break;
v6 = *(const char **)(v5 + v4);
v7 = strlen(v6);
std::string::append(v12, v6, v7);
v4 += 24;
if ( *(_DWORD *)(*((_DWORD *)this + 14) + v4 + 4) )
std::string::append(v12, ", ", 2u);
}
if ( (*((_BYTE *)this + 8) & 1) != 0 )
v8 = *((char **)this + 4);
else
v8 = (char *)this + 9;
if ( (*((_BYTE *)this + 24) & 1) != 0 )
v9 = *((char **)this + 8);
else
v9 = (char *)this + 25;
if ( (*((_BYTE *)this + 8) & 1) != 0 )
v10 = *((char **)this + 4);
else
v10 = (char *)this + 9;
if ( (v12[0] & 1) != 0 )
v11 = v13;
else
v11 = (char *)v12 + 1;
*((_DWORD *)this + 10) = lws_client_connect(
*((_DWORD *)this + 11),
v8,
*((_DWORD *)this + 5),
*((_DWORD *)this + 13),
v9,
v10,
v10,
v11,
-1);
return std::string::~string((int)v12);
}
return result;
}