//
// GameLevelManager::syncFollowing from 0x140251520 to 0x1402518db (955 bytes)
//
// 2 xrefs:
// > GameLevelManager::syncFollowListIfNeeded @ 0x140251ab0
// > ??> @ 0x14091c4a8
//
// 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 11:28:42 +0000
//
// Hidden C++ exception states: #wind=5
char __fastcall GameLevelManager::syncFollowing(__int64 a1)
{
__int64 v2; // rbx
void *v3; // r8
__int64 v5; // rbx
__int64 v6; // rax
void *v7; // rcx
__int64 v8; // rcx
cocos2d::CCArray *v9; // rsi
unsigned int v10; // ebx
size_t v11; // rdi
cocos2d::CCString *v12; // rax
char *CString; // rax
size_t v14; // r8
const char *p_Src; // rbx
cocos2d::CCString *v16; // rax
const char *v17; // rax
cocos2d::CCString *v18; // rax
char *v19; // rax
size_t v20; // r8
_QWORD *v21; // rdx
int Reserved; // [rsp+20h] [rbp-99h]
int v23; // [rsp+28h] [rbp-91h]
__int128 v24; // [rsp+40h] [rbp-79h] BYREF
__int64 v25; // [rsp+50h] [rbp-69h]
__int64 v26; // [rsp+58h] [rbp-61h]
__int128 v27; // [rsp+60h] [rbp-59h] BYREF
__int64 v28; // [rsp+70h] [rbp-49h]
__int64 v29; // [rsp+78h] [rbp-41h]
__int128 *v30; // [rsp+80h] [rbp-39h]
__int128 *v31; // [rsp+88h] [rbp-31h]
void *Block[2]; // [rsp+98h] [rbp-21h] BYREF
__int128 v33; // [rsp+A8h] [rbp-11h]
__int128 Src; // [rsp+B8h] [rbp-1h] BYREF
__int64 v35; // [rsp+C8h] [rbp+Fh]
unsigned __int64 v36; // [rsp+D0h] [rbp+17h]
_QWORD v37[4]; // [rsp+D8h] [rbp+1Fh] BYREF
*(_OWORD *)Block = 0;
v33 = 0;
sub_14003D230(Block, "following", 9u);
v2 = cocos2d::CCDictionary::objectForKey(*(_QWORD *)(a1 + 1192), Block);
if ( *((_QWORD *)&v33 + 1) > 0xFu )
{
v3 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v33 + 1) + 1LL) >= 0x1000 )
{
v3 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v3 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v3);
}
if ( v2 )
return 0;
*(_OWORD *)Block = 0;
v33 = 0;
sub_14003D230(Block, "following", 9u);
v5 = *(_QWORD *)(a1 + 1192);
v6 = cocos2d::CCNode::create();
cocos2d::CCDictionary::setObject(v5, v6, Block);
if ( *((_QWORD *)&v33 + 1) > 0xFu )
{
v7 = Block[0];
if ( (unsigned __int64)(*((_QWORD *)&v33 + 1) + 1LL) >= 0x1000 )
{
v7 = *((void **)Block[0] - 1);
if ( (unsigned __int64)((char *)Block[0] - (char *)v7 - 8) > 0x1F )
invoke_watson(nullptr, nullptr, nullptr, 0, 0);
}
j_j_free(v7);
}
Src = 0;
v35 = 0;
v36 = 15;
LOBYTE(Src) = 0;
v9 = cocos2d::CCDictionary::allKeys(*(cocos2d::CCDictionary **)(a1 + 872));
v10 = 0;
v11 = -1;
if ( v9 )
{
while ( v10 < cocos2d::CCArray::count(v9) )
{
if ( v35 )
sub_140044D80(&Src, byte_14070ECF8, 1u);
v12 = cocos2d::CCArray::objectAtIndex(v9, v10);
CString = (char *)cocos2d::CCString::getCString(v12);
v14 = -1;
do
++v14;
while ( CString[v14] );
sub_140044D80(&Src, CString, v14);
++v10;
}
}
GameLevelManager::getBasePostString(v8, v37);
p_Src = (const char *)&Src;
if ( v36 > 0xF )
p_Src = (const char *)Src;
v23 = 98;
Reserved = 103;
v16 = cocos2d::CCString::createWithFormat(
"%c%s%s%c%c%s",
87,
"mfd",
"2893",
Reserved,
v23,
(const char *)&word_14070D040);
v17 = cocos2d::CCString::getCString(v16);
v18 = cocos2d::CCString::createWithFormat("&follows=%s&ack=1&secret=%s", p_Src, v17);
v19 = (char *)cocos2d::CCString::getCString(v18);
v20 = -1;
do
++v20;
while ( v19[v20] );
sub_140044D80(v37, v19, v20);
v30 = &v24;
v31 = &v27;
v24 = 0;
v25 = 0;
v26 = 0;
sub_14003D230(&v24, "following", 9u);
v21 = v37;
if ( v37[3] > 0xFu )
v21 = (_QWORD *)v37[0];
v27 = 0;
v28 = 0;
v29 = 0;
do
++v11;
while ( *((_BYTE *)v21 + v11) );
sub_14003D230(&v27, v21, v11);
*(_OWORD *)Block = 0;
v33 = 0u;
Block[0] = sub_14003D460(0x40u);
*(_QWORD *)&v33 = 54;
*((_QWORD *)&v33 + 1) = 63;
strcpy((char *)Block[0], "https://www.boomlings.com/database/syncGJFollowing.php");
GameLevelManager::ProcessHttpRequest(
(cocos2d::CCActionManager **)a1,
(__int64)Block,
(const char *)&v27,
(const char *)&v24,
0x73u);
sub_14003D310((__int64)v37);
sub_14003D310((__int64)&Src);
return 1;
}