// // LocalLevelManager::dataLoaded from 0x544758 to 0x544e40 (1768 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 11:52:22 +0000 // signed int __fastcall LocalLevelManager::dataLoaded(cocos2d::CCArray **this, DS_Dictionary *a2) { unsigned int v2; // r5 unsigned int updated; // r4 unsigned int v4; // r11 int v5; // r0 int v6; // r12 _DWORD *v7; // r6 int v8; // r8 int v9; // r3 _DWORD *v10; // r4 int v11; // r9 size_t v12; // r3 int v13; // r7 unsigned int v14; // r10 const void *v15; // r0 const void *v16; // r1 size_t v17; // r2 int v18; // r0 _DWORD *v19; // r3 _DWORD ***v20; // r7 unsigned int v21; // r7 size_t v22; // r10 const void *v23; // r0 const void *v24; // r1 size_t v25; // r2 int v26; // r0 _DWORD *v27; // r4 unsigned int i; // r9 int v29; // r4 int v30; // r3 cocos2d::CCArray *v31; // r5 cocos2d::CCArray *v32; // r5 unsigned int v33; // r7 int v34; // r8 int v35; // r0 unsigned int j; // r10 int v37; // r0 cocos2d::CCObject *v38; // r7 unsigned int k; // r8 int v40; // r0 unsigned int v41; // r4 cocos2d::CCArray *v42; // r7 cocos2d::CCString *v43; // r0 const char *CString; // r8 size_t v45; // r0 cocos2d::CCArray *v46; // r8 cocos2d::CCArray *v47; // r10 unsigned int v48; // r6 unsigned int v49; // r4 cocos2d::CCDictionary *v50; // r0 char *v51; // r5 cocos2d::CCDictionary *v52; // r7 cocos2d::CCObject *v53; // r0 int v54; // r11 cocos2d::CCObject *v55; // r9 cocos2d::CCObject *v56; // r8 cocos2d::CCArray *v57; // r0 unsigned int m; // r9 int v59; // r4 int v60; // r3 cocos2d::CCArray *v61; // r6 cocos2d::CCArray *v62; // r11 unsigned int v63; // r8 int v64; // r0 cocos2d::CCArray *v65; // r2 unsigned int n; // r11 int v67; // r0 cocos2d::CCObject *v68; // r8 unsigned int ii; // r8 GJLevelList *v70; // r0 unsigned int v71; // r4 cocos2d::CCArray *v72; // r8 cocos2d::CCString *v73; // r0 const char *v74; // r0 const char *v75; // r9 size_t v76; // r0 cocos2d::CCArray *v77; // r9 signed int result; // r0 cocos2d::CCArray *ArrayForKey; // [sp+4h] [bp-58h] cocos2d::CCArray *v81; // [sp+4h] [bp-58h] cocos2d::CCDictionary *LevelsInNameGroups; // [sp+8h] [bp-54h] unsigned int v84; // [sp+18h] [bp-44h] _BOOL4 v85; // [sp+18h] [bp-44h] int v86; // [sp+1Ch] [bp-40h] _DWORD **v87; // [sp+20h] [bp-3Ch] BYREF _DWORD *v88; // [sp+24h] [bp-38h] BYREF _DWORD *v89; // [sp+28h] [bp-34h] BYREF int v90; // [sp+2Ch] [bp-30h] int v91[3]; // [sp+30h] [bp-2Ch] BYREF int v92[3]; // [sp+3Ch] [bp-20h] BYREF int v93; // [sp+48h] [bp-14h] BYREF int v94; // [sp+4Ch] [bp-10h] int v95; // [sp+50h] [bp-Ch] ArrayForKey = (cocos2d::CCArray *)DS_Dictionary::getArrayForKey(a2, "LLM_01", 0); if ( !*(this + 71) ) { LocalLevelManager::setLocalLevels(this, ArrayForKey); goto LABEL_103; } v2 = 0; updated = LocalLevelManager::updateLevelOrder((LocalLevelManager *)this); v4 = cocos2d::CCArray::count(ArrayForKey) + 1 + updated; v89 = nullptr; v90 = 0; v88 = &v89; LevelsInNameGroups = (cocos2d::CCDictionary *)LocalLevelManager::getLevelsInNameGroups(this); LABEL_4: if ( v2 < cocos2d::CCArray::count(*(this + 71)) ) { v5 = cocos2d::CCArray::objectAtIndex(*(this + 71), v2); v6 = *(unsigned __int8 *)(v5 + 1132); v7 = (_DWORD *)v5; v8 = v6 & 1; if ( (v6 & 1) != 0 ) v9 = *(_DWORD *)(v5 + 1136); else v9 = v6 >> 1; if ( !v9 ) goto LABEL_57; v10 = v89; if ( !v89 ) { v20 = (_DWORD ***)&v89; v87 = &v89; goto LABEL_53; } v11 = v6 >> 1; while ( 1 ) { if ( v8 ) v12 = v7[284]; else v12 = v11; v13 = *((unsigned __int8 *)v10 + 16); if ( (v13 & 1) != 0 ) v14 = v10[5]; else v14 = v13 >> 1; if ( v8 ) v15 = (const void *)v7[285]; else v15 = (char *)v7 + 1133; if ( (v13 & 1) != 0 ) v16 = (const void *)v10[6]; else v16 = (char *)v10 + 17; v17 = v14; v86 = v13 & 1; if ( v14 >= v12 ) v17 = v12; v84 = v12; v18 = std::char_traits::compare(v15, v16, v17); if ( v18 ) { if ( v18 < 0 ) { LABEL_29: v19 = (_DWORD *)*v10; if ( !*v10 ) { v87 = (_DWORD **)v10; v20 = (_DWORD ***)v10; goto LABEL_53; } goto LABEL_30; } } else if ( v84 < v14 ) { goto LABEL_29; } if ( (v13 & 1) != 0 ) { v21 = v10[5]; if ( !v8 ) { v22 = v11; goto LABEL_37; } } else { v21 = v13 >> 1; if ( !v8 ) { v22 = v11; LABEL_39: v23 = (char *)v10 + 17; goto LABEL_40; } } v22 = v7[284]; if ( !v86 ) goto LABEL_39; LABEL_37: v23 = (const void *)v10[6]; LABEL_40: if ( v8 ) v24 = (const void *)v7[285]; else v24 = (char *)v7 + 1133; v25 = v22; if ( v22 >= v21 ) v25 = v21; v26 = std::char_traits::compare(v23, v24, v25); if ( v26 ) { if ( v26 >= 0 ) { LABEL_51: v87 = (_DWORD **)v10; v20 = &v87; LABEL_53: if ( !*v20 ) { v27 = (_DWORD *)operator new(0x1Cu); std::string::basic_string(v27 + 4, (int)(v7 + 283)); *v27 = 0; v27[1] = 0; v27[2] = v87; *v20 = (_DWORD **)v27; if ( *v88 ) v88 = (_DWORD *)*v88; std::__tree_balance_after_insert *>(v89, *v20); ++v90; } LABEL_57: ++v2; goto LABEL_4; } } else if ( v21 >= v22 ) { goto LABEL_51; } v19 = (_DWORD *)v10[1]; if ( !v19 ) { v87 = (_DWORD **)v10; v20 = (_DWORD ***)(v10 + 1); goto LABEL_53; } LABEL_30: v10 = v19; } } for ( i = 0; i < cocos2d::CCArray::count(ArrayForKey); ++i ) { v29 = cocos2d::CCArray::objectAtIndex(ArrayForKey, i); *(_BYTE *)(v29 + 610) = 0; std::string::basic_string(&v93, v29 + 280); if ( (v93 & 1) != 0 ) v30 = v94; else v30 = (int)(unsigned __int8)v93 >> 1; if ( !v30 ) std::string::assign(&v93, "Unknown"); v31 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(LevelsInNameGroups, &v93); if ( v31 ) { v33 = 0; v34 = 0; while ( v33 < cocos2d::CCArray::count(v31) ) { v35 = cocos2d::CCArray::objectAtIndex(v31, v33++); if ( v34 < *(_DWORD *)(v35 + 440) ) v34 = *(_DWORD *)(v35 + 440); } for ( j = 0; ; ++j ) { if ( j >= cocos2d::CCArray::count(v31) ) { for ( k = 0; k < cocos2d::CCArray::count(v31); ++k ) { v40 = cocos2d::CCArray::objectAtIndex(v31, k); std::string::basic_string(v91, v40 + 304); std::string::basic_string(v92, v29 + 304); v85 = sub_542480((unsigned __int8 *)v91, (unsigned __int8 *)v92); std::string::~string((int)v92); std::string::~string((int)v91); if ( v85 ) goto LABEL_98; } if ( std::__tree::__count_unique((int)&v88, (unsigned __int8 *)(v29 + 1132)) ) { if ( (*(_BYTE *)(v29 + 1132) & 1) != 0 ) { **(_BYTE **)(v29 + 1140) = 0; *(_DWORD *)(v29 + 1136) = 0; } else { *(_BYTE *)(v29 + 1133) = 0; *(_BYTE *)(v29 + 1132) = 0; } } cocos2d::CCArray::addObject(v31, (cocos2d::CCObject *)v29); goto LABEL_97; } v37 = cocos2d::CCArray::objectAtIndex(v31, j); v38 = (cocos2d::CCObject *)v37; if ( *(_DWORD *)(v37 + 440) == *(_DWORD *)(v29 + 440) ) break; } if ( !*(_BYTE *)(v37 + 610) ) { GJGameLevel::handleStatsConflict((GJGameLevel *)v29, (GJGameLevel *)v37); cocos2d::CCArray::removeObject(v31, v38, 1); cocos2d::CCArray::addObject(v31, (cocos2d::CCObject *)v29); goto LABEL_98; } if ( std::__tree::__count_unique((int)&v88, (unsigned __int8 *)(v29 + 1132)) ) { if ( (*(_BYTE *)(v29 + 1132) & 1) != 0 ) { **(_BYTE **)(v29 + 1140) = 0; *(_DWORD *)(v29 + 1136) = 0; } else { *(_BYTE *)(v29 + 1133) = 0; *(_BYTE *)(v29 + 1132) = 0; } } cocos2d::CCArray::addObject(v31, (cocos2d::CCObject *)v29); *((_DWORD *)v38 + 110) = v34 + 1; LABEL_97: *(_DWORD *)(v29 + 460) = v4--; } else { v32 = (cocos2d::CCArray *)cocos2d::CCArray::create(nullptr); if ( std::__tree::__count_unique((int)&v88, (unsigned __int8 *)(v29 + 1132)) ) { if ( (*(_BYTE *)(v29 + 1132) & 1) != 0 ) { **(_BYTE **)(v29 + 1140) = 0; *(_DWORD *)(v29 + 1136) = 0; } else { *(_BYTE *)(v29 + 1133) = 0; *(_BYTE *)(v29 + 1132) = 0; } } cocos2d::CCArray::addObject(v32, (cocos2d::CCObject *)v29); *(_DWORD *)(v29 + 460) = v4; cocos2d::CCDictionary::setObject((int)LevelsInNameGroups, v32); --v4; } LABEL_98: std::string::~string((int)&v93); } cocos2d::CCArray::removeAllObjects(*(this + 71)); v41 = 0; v42 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(LevelsInNameGroups); while ( v41 < cocos2d::CCArray::count(v42) ) { v43 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v42, v41); CString = (const char *)cocos2d::CCString::getCString(v43); v93 = 0; v94 = 0; v95 = 0; v45 = strlen(CString); std::string::__init(&v93, CString, v45); v46 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(LevelsInNameGroups, &v93); std::string::~string((int)&v93); cocos2d::CCArray::addObjectsFromArray(*(this + 71), v46); ++v41; } LocalLevelManager::reorderLevels((LocalLevelManager *)this); std::__tree::destroy((int)&v88, v89); LABEL_103: v47 = (cocos2d::CCArray *)DS_Dictionary::getArrayForKey(a2, "LLM_03", 0); if ( *(this + 72) ) { v48 = 0; v49 = LocalLevelManager::updateListOrder((LocalLevelManager *)this); v50 = (cocos2d::CCDictionary *)(cocos2d::CCArray::count(v47) + 1); v51 = (char *)v50 + v49; v52 = (cocos2d::CCDictionary *)cocos2d::CCDictionary::create(v50); while ( v48 < cocos2d::CCArray::count(*(this + 72)) ) { v53 = (cocos2d::CCObject *)cocos2d::CCArray::objectAtIndex(*(this + 72), v48); v54 = (int)v53 + 348; v55 = v53; std::string::basic_string(&v93, (int)v53 + 348); v56 = (cocos2d::CCObject *)cocos2d::CCDictionary::objectForKey(v52, &v93); v57 = (cocos2d::CCArray *)std::string::~string((int)&v93); if ( !v56 ) { v56 = (cocos2d::CCObject *)cocos2d::CCArray::create(v57); std::string::basic_string(&v93, v54); cocos2d::CCDictionary::setObject((int)v52, v56); std::string::~string((int)&v93); } cocos2d::CCArray::addObject(v56, v55); ++v48; } for ( m = 0; m < cocos2d::CCArray::count(v47); ++m ) { v59 = cocos2d::CCArray::objectAtIndex(v47, m); *(_BYTE *)(v59 + 331) = 0; std::string::basic_string(&v93, v59 + 348); if ( (v93 & 1) != 0 ) v60 = v94; else v60 = (int)(unsigned __int8)v93 >> 1; if ( !v60 ) std::string::assign(&v93, "Unknown"); v61 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v52, &v93); if ( v61 ) { v63 = 0; v81 = nullptr; while ( v63 < cocos2d::CCArray::count(v61) ) { v64 = cocos2d::CCArray::objectAtIndex(v61, v63); v65 = v81; ++v63; if ( (int)v81 < *(_DWORD *)(v64 + 304) ) v65 = *(cocos2d::CCArray **)(v64 + 304); v81 = v65; } for ( n = 0; ; ++n ) { if ( n >= cocos2d::CCArray::count(v61) ) { for ( ii = 0; ii < cocos2d::CCArray::count(v61); ++ii ) { v70 = (GJLevelList *)cocos2d::CCArray::objectAtIndex(v61, ii); if ( GJLevelList::hasMatchingLevels((GJLevelList *)v59, v70) ) goto LABEL_139; } cocos2d::CCArray::addObject(v61, (cocos2d::CCObject *)v59); goto LABEL_138; } v67 = cocos2d::CCArray::objectAtIndex(v61, n); v68 = (cocos2d::CCObject *)v67; if ( *(_DWORD *)(v67 + 304) == *(_DWORD *)(v59 + 304) ) break; } if ( !*(_BYTE *)(v67 + 331) ) { GJLevelList::handleStatsConflict(v59, (GJLevelList *)v67); cocos2d::CCArray::removeObject(v61, v68, 1); cocos2d::CCArray::addObject(v61, (cocos2d::CCObject *)v59); goto LABEL_139; } if ( !GJLevelList::hasMatchingLevels((GJLevelList *)v59, (GJLevelList *)v67) ) { cocos2d::CCArray::addObject(v61, (cocos2d::CCObject *)v59); *((_DWORD *)v68 + 76) = (char *)v81 + 1; LABEL_138: *(_DWORD *)(v59 + 308) = v51--; } } else { v62 = (cocos2d::CCArray *)cocos2d::CCArray::create(nullptr); cocos2d::CCArray::addObject(v62, (cocos2d::CCObject *)v59); *(_DWORD *)(v59 + 308) = v51; cocos2d::CCDictionary::setObject((int)v52, v62); --v51; } LABEL_139: std::string::~string((int)&v93); } v71 = 0; cocos2d::CCArray::removeAllObjects(*(this + 72)); v72 = (cocos2d::CCArray *)cocos2d::CCDictionary::allKeys(v52); while ( v71 < cocos2d::CCArray::count(v72) ) { v73 = (cocos2d::CCString *)cocos2d::CCArray::stringAtIndex(v72, v71); v74 = (const char *)cocos2d::CCString::getCString(v73); v93 = 0; v94 = 0; v95 = 0; v75 = v74; v76 = strlen(v74); std::string::__init(&v93, v75, v76); v77 = (cocos2d::CCArray *)cocos2d::CCDictionary::objectForKey(v52, &v93); std::string::~string((int)&v93); ++v71; cocos2d::CCArray::addObjectsFromArray(*(this + 72), v77); } LocalLevelManager::reorderLists((LocalLevelManager *)this); } else { LocalLevelManager::setLocalLists(this, v47); } result = DS_Dictionary::getIntegerForKey(a2, "LLM_02"); if ( result <= 18 ) return LocalLevelManager::updateLevelRevision(this); return result; }
GD Web Decomp Icon

GD Web Decomp

Raw Source