//
// sub_100577C20 from 0x100577c20 to 0x10057803b (1051 bytes)
//
// 1 xrefs:
// > MemberListPopup::init @ 0x100941979
//
// This function is hookable on this platform (idp: pc, 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 12:32:17 +0000
//
char __fastcall sub_100577C20(__int64 a1, int a2)
{
__int64 v2; // r14
__int64 v3; // rax
char *CString; // r15
__int64 v5; // r12
size_t v6; // rax
std::string::size_type v7; // r13
char *data; // rbx
size_t v9; // r14
__int64 v10; // rbx
__int64 v12; // r13
void *v13; // r12
size_t v14; // rax
std::string::size_type v15; // rbx
char *v16; // r12
char *v17; // r13
__int64 v18; // r15
size_t v19; // r14
__int64 v20; // rax
__int64 v21; // rax
const std::string::value_type *v22; // rax
const char *v23; // r15
size_t v24; // rax
size_t v25; // r12
char *v26; // rbx
size_t v27; // r13
size_t v28; // rax
size_t v29; // r15
char *v30; // rbx
size_t v31; // r12
char v32; // [rsp+0h] [rbp-B0h]
char v33; // [rsp+0h] [rbp-B0h]
__int64 v34; // [rsp+10h] [rbp-A0h]
std::string v35; // [rsp+18h] [rbp-98h] BYREF
_QWORD v36[2]; // [rsp+30h] [rbp-80h] BYREF
void *v37; // [rsp+40h] [rbp-70h]
__int128 v38; // [rsp+48h] [rbp-68h] BYREF
void *v39; // [rsp+58h] [rbp-58h]
__int64 v40; // [rsp+60h] [rbp-50h]
char *__s; // [rsp+68h] [rbp-48h]
std::string __dst[2]; // [rsp+70h] [rbp-40h] BYREF
if ( a2 <= 0 )
return 0;
v2 = a1;
v3 = sub_10088E820("threadMembers_%i", v32);
CString = (char *)cocos2d::CCString::getCString(v3);
v5 = *(_QWORD *)(a1 + 1088);
v6 = strlen(CString);
if ( v6 >= 0xFFFFFFFFFFFFFFF8LL )
LABEL_53:
sub_100003630();
v7 = v6;
LODWORD(__s) = a2;
if ( v6 >= 0x17 )
{
v40 = v5;
v9 = 26;
if ( (v6 | 7) != 0x17 )
v9 = (v6 | 7) + 1;
data = (char *)operator new(v9);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)data;
__dst[0].__r_.__value_.__r.__words[0] = v9 + 1;
v2 = a1;
v5 = v40;
__dst[0].__r_.__value_.__l.__size_ = v7;
goto LABEL_9;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v6);
data = __dst[0].__r_.__value_.__s.__data_;
if ( v6 )
LABEL_9:
memmove(data, CString, v7);
data[v7] = 0;
v10 = cocos2d::CCDictionary::objectForKey(v5, (char *)__dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
if ( v10 )
return 0;
v12 = *(_QWORD *)(v2 + 1088);
v13 = cocos2d::CCNode::create();
v14 = strlen(CString);
if ( v14 >= 0xFFFFFFFFFFFFFFF8LL )
goto LABEL_53;
v15 = v14;
v40 = (__int64)v13;
if ( v14 >= 0x17 )
{
v34 = v12;
v17 = CString;
v18 = v2;
v19 = 26;
if ( (v14 | 7) != 0x17 )
v19 = (v14 | 7) + 1;
v16 = (char *)operator new(v19);
__dst[0].__r_.__value_.__r.__words[2] = (std::string::size_type)v16;
__dst[0].__r_.__value_.__r.__words[0] = v19 + 1;
v2 = v18;
CString = v17;
v12 = v34;
__dst[0].__r_.__value_.__l.__size_ = v15;
goto LABEL_21;
}
__dst[0].__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v14);
v16 = __dst[0].__r_.__value_.__s.__data_;
if ( v14 )
LABEL_21:
memmove(v16, CString, v15);
v16[v15] = 0;
cocos2d::CCDictionary::setObject(v12, v40, (char *)__dst);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
operator delete(__dst[0].__r_.__value_.__l.__data_);
GameLevelManager::getBasePostString(__dst);
v20 = sub_10088E820("%c%s%s%c%c%s", (char)"7");
cocos2d::CCString::getCString(v20);
v21 = sub_10088E820("&threadID=%i&secret=%s", v33);
v22 = (const std::string::value_type *)cocos2d::CCString::getCString(v21);
std::string::append(__dst, v22);
__s = CString;
v35.__r_.__value_.__r.__words[2] = (std::string::size_type)operator new(0x40u);
v35.__r_.__value_.__r.__words[0] = 65;
v35.__r_.__value_.__l.__size_ = 57;
strcpy(v35.__r_.__value_.__l.__data_, "https://www.boomlings.com/database/getGJThreadMembers.php");
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
v23 = __dst[0].__r_.__value_.__l.__data_;
else
v23 = __dst[0].__r_.__value_.__s.__data_;
v24 = strlen(v23);
if ( v24 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v25 = v24;
if ( v24 >= 0x17 )
{
v27 = 26;
if ( (v24 | 7) != 0x17 )
v27 = (v24 | 7) + 1;
v26 = (char *)operator new(v27);
v37 = v26;
v36[0] = v27 | 1;
v36[1] = v25;
goto LABEL_34;
}
LOBYTE(v36[0]) = 2 * v24;
v26 = (char *)v36 + 1;
if ( v24 )
LABEL_34:
memmove(v26, v23, v25);
v26[v25] = 0;
v28 = strlen(__s);
if ( v28 >= 0xFFFFFFFFFFFFFFF8LL )
sub_100003630();
v29 = v28;
if ( v28 >= 0x17 )
{
v31 = 26;
if ( (v28 | 7) != 0x17 )
v31 = (v28 | 7) + 1;
v30 = (char *)operator new(v31);
v39 = v30;
*(_QWORD *)&v38 = v31 | 1;
*((_QWORD *)&v38 + 1) = v29;
goto LABEL_42;
}
LOBYTE(v38) = 2 * v28;
v30 = (char *)&v38 + 1;
if ( v28 )
LABEL_42:
memmove(v30, __s, v29);
v30[v29] = 0;
GameLevelManager::ProcessHttpRequest(v2, &v35, (__int64)v36, &v38, 0x61u);
if ( (v38 & 1) != 0 )
{
operator delete(v39);
if ( (v36[0] & 1) == 0 )
{
LABEL_45:
if ( (*(_BYTE *)&v35.__r_.__value_.__s.0 & 1) == 0 )
goto LABEL_46;
LABEL_51:
operator delete(v35.__r_.__value_.__l.__data_);
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) == 0 )
return 1;
goto LABEL_47;
}
}
else if ( (v36[0] & 1) == 0 )
{
goto LABEL_45;
}
operator delete(v37);
if ( (*(_BYTE *)&v35.__r_.__value_.__s.0 & 1) != 0 )
goto LABEL_51;
LABEL_46:
if ( (*(_BYTE *)&__dst[0].__r_.__value_.__s.0 & 1) != 0 )
LABEL_47:
operator delete(__dst[0].__r_.__value_.__l.__data_);
return 1;
}