// // SFXSearchResult::updateObjects from 0x96a7ec to 0x96b148 (2396 bytes) // // 2 xrefs: // > @ 0xaf2e8 // > @ 0x146f0a0 // // 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 12:57:38 +0000 // __int64 __fastcall SFXSearchResult::updateObjects(__int64 a1, int a2) { int v3; // w3 int v4; // w1 __int64 v5; // x27 __int64 v6; // x2 MusicDownloadManager *v7; // x0 MusicDownloadManager *v8; // x2 __int64 v9; // x0 __int64 v10; // x2 cocos2d::CCArray *v11; // x26 cocos2d::CCObject *v12; // x1 cocos2d::CCArray *v13; // x21 __int64 Object; // x19 __int64 v15; // x0 unsigned int *v16; // x0 cocos2d::CCObject **v17; // x19 cocos2d::CCObject **v18; // x20 GameManager *v19; // x0 __int64 v20; // x1 unsigned int v21; // w1 GameManager *k; // x2 __int64 v23; // x1 GameManager *v24; // x0 char v25; // w0 __int64 v26; // x0 cocos2d::CCObject *v27; // x1 cocos2d::CCObject *v28; // x1 unsigned int v29; // w20 cocos2d::CCObject *v30; // x21 _BYTE *v31; // x19 cocos2d::CCObject *v32; // x21 cocos2d::CCArray *v33; // x23 __int64 v34; // x19 bool v35; // w21 char *v36; // x7 unsigned __int64 v37; // x0 unsigned __int8 *v38; // x2 cocos2d::CCObject *v39; // x3 __int64 v40; // x0 unsigned int *v41; // x0 unsigned __int8 **v42; // x19 unsigned __int8 **m; // x20 unsigned __int8 *v44; // x1 int v45; // w0 cocos2d::CCObject *v46; // x1 cocos2d::CCArray *v47; // x0 cocos2d::CCArray *FilesMatchingSearch; // x20 MusicDownloadManager *v49; // x0 __int64 v50; // x0 __int64 v51; // x21 __int64 j; // x19 MusicDownloadManager *v53; // x0 cocos2d::CCObject *v54; // x1 cocos2d::CCArray *AllSFXObjects; // x19 cocos2d::CCArray *v56; // x0 unsigned int v57; // w1 unsigned int *v58; // x1 cocos2d::CCObject **v59; // x19 __int64 v60; // x0 char *v61; // x20 cocos2d::CCObject *v62; // x1 char v63; // w0 __int64 v64; // x0 unsigned __int64 v65; // x1 cocos2d::CCObject *v66; // x0 __int64 v68; // x0 unsigned int *v69; // x1 cocos2d::CCObject **v70; // x19 __int64 v71; // x0 char *v72; // x21 cocos2d::CCObject *v73; // x1 unsigned __int8 v74; // w0 int v75; // w1 __int64 v76; // x0 unsigned int *v77; // x0 unsigned int v78; // w2 __int64 *v79; // x0 __int64 *v80; // x2 __int64 v81; // x0 unsigned __int64 v82; // x1 cocos2d::CCObject *v83; // x0 MusicDownloadManager *v84; // x0 MusicDownloadManager *v85; // x19 const char *v86; // x0 int v87; // w0 cocos2d::CCArray *SFXObject; // x0 cocos2d::CCObject *v89; // x1 cocos2d::CCObject *v90; // x0 cocos2d::CCObject *v91; // x19 cocos2d::CCObject *v92; // x1 char *v93; // x20 __int64 v94; // x0 __int64 v95; // x3 __int64 v96; // x0 __int64 *v97; // x19 MusicDownloadManager *v98; // x0 MusicDownloadManager *v99; // x0 cocos2d::CCObject *v100; // x1 __int64 CustomSFXObject; // x0 __int64 *v102; // x19 MusicDownloadManager *v103; // x0 MusicDownloadManager *v104; // x0 cocos2d::CCObject *v105; // x1 __int64 v106; // x0 __int64 v107; // x23 __int64 i; // x21 MusicDownloadManager *v109; // x28 MusicDownloadManager *v110; // x0 int v111; // w27 int v112; // w26 unsigned __int8 *v113; // x1 MusicDownloadManager *v114; // x0 MusicDownloadManager *v115; // x26 __int64 v116; // x0 cocos2d::CCArray *v117; // x0 unsigned int v118; // w1 char *v120; // [xsp+68h] [xbp+68h] unsigned __int8 *v121; // [xsp+68h] [xbp+68h] __int64 v122; // [xsp+78h] [xbp+78h] BYREF cocos2d::CCObject *v123; // [xsp+80h] [xbp+80h] void *v124; // [xsp+88h] [xbp+88h] __int64 v125; // [xsp+90h] [xbp+90h] BYREF unsigned __int64 v126; // [xsp+98h] [xbp+98h] void *v127; // [xsp+A0h] [xbp+A0h] v3 = *(_DWORD *)(a1 + 140); if ( v3 ) goto LABEL_69; v4 = *(unsigned __int8 *)(a1 + 104); v5 = a1 + 104; if ( (v4 & 1) != 0 ) { v6 = *(_QWORD *)(a1 + 112); if ( !v6 ) goto LABEL_9; v7 = *(MusicDownloadManager **)(a1 + 120); } else { LODWORD(v6) = v4 >> 1; if ( !(v4 >> 1) ) goto LABEL_9; v7 = (MusicDownloadManager *)(a1 + 105); v6 = (int)v6; } v8 = (MusicDownloadManager *)((char *)v7 + v6); if ( v8 == v7 ) { LABEL_124: v85 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v7); if ( (*(_BYTE *)(a1 + 104) & 1) != 0 ) v86 = *(const char **)(a1 + 120); else v86 = (const char *)(a1 + 105); v87 = atoi(v86); SFXObject = (cocos2d::CCArray *)MusicDownloadManager::getSFXObject(v85, v87); if ( SFXObject ) { v90 = (cocos2d::CCObject *)cocos2d::CCArray::createWithObject(SFXObject, v89); v91 = v90; v92 = *(cocos2d::CCObject **)(a1 + 64); if ( v90 != v92 ) { if ( v90 ) { cocos2d::CCObject::retain(v90); v92 = *(cocos2d::CCObject **)(a1 + 64); } if ( v92 ) cocos2d::CCObject::release(v92); *(_QWORD *)(a1 + 64) = v91; } return _stack_chk_guard; } v3 = *(_DWORD *)(a1 + 140); LABEL_69: v47 = (cocos2d::CCArray *)(unsigned int)(v3 - 1); *(_DWORD *)(a1 + 128) = a2; v5 = a1 + 104; if ( (unsigned int)v47 <= 2 ) { FilesMatchingSearch = (cocos2d::CCArray *)cocos2d::CCArray::create(v47); v49 = (MusicDownloadManager *)*(unsigned int *)(a1 + 140); switch ( (_DWORD)v49 ) { case 1: v96 = MusicDownloadManager::sharedState(v49); v97 = *(__int64 **)(v96 + 624); while ( 1 ) { v98 = (MusicDownloadManager *)MusicDownloadManager::sharedState((MusicDownloadManager *)v96); if ( !v97 ) break; v99 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v98); v96 = MusicDownloadManager::getSFXObject(v99, *((_DWORD *)v97 + 4)); v100 = (cocos2d::CCObject *)v96; if ( v96 && (v96 = *(unsigned __int8 *)(v96 + 72), !(_DWORD)v96) ) { v96 = cocos2d::CCArray::addObject(FilesMatchingSearch, v100); v97 = (__int64 *)*v97; } else { v97 = (__int64 *)*v97; } } CustomSFXObject = MusicDownloadManager::sharedState(v98); v102 = *(__int64 **)(CustomSFXObject + 664); while ( 1 ) { v103 = (MusicDownloadManager *)MusicDownloadManager::sharedState((MusicDownloadManager *)CustomSFXObject); if ( !v102 ) break; v104 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v103); CustomSFXObject = MusicDownloadManager::getCustomSFXObject(v104, *((_DWORD *)v102 + 4)); v105 = (cocos2d::CCObject *)CustomSFXObject; if ( CustomSFXObject && (CustomSFXObject = *(unsigned __int8 *)(CustomSFXObject + 72), !(_DWORD)CustomSFXObject) ) { CustomSFXObject = cocos2d::CCArray::addObject(FilesMatchingSearch, v105); v102 = (__int64 *)*v102; } else { v102 = (__int64 *)*v102; } } break; case 3: v68 = *(_QWORD *)(a1 + 88); if ( v68 ) { v69 = *(unsigned int **)(v68 + 56); if ( *v69 ) { v70 = *((cocos2d::CCObject ***)v69 + 2); v71 = 8LL * *v69 - 8; v72 = (char *)v70 + v71; if ( v70 <= (cocos2d::CCObject **)((char *)v70 + v71) ) { do { v73 = *v70; if ( !*v70 ) break; ++v70; cocos2d::CCArray::addObject(FilesMatchingSearch, v73); } while ( v72 >= (char *)v70 ); } } break; } break; case 2: v106 = MusicDownloadManager::sharedState(v49); v107 = (__int64)(*(_QWORD *)(v106 + 736) - *(_QWORD *)(v106 + 728)) >> 3; if ( v107 ) { for ( i = 0; i != v107; ++i ) { v109 = (MusicDownloadManager *)MusicDownloadManager::sharedState((MusicDownloadManager *)v106); v110 = *(MusicDownloadManager **)(MusicDownloadManager::sharedState(v109) + 728); v111 = *((_DWORD *)v110 + 2 * i); v112 = *(_DWORD *)(*(_QWORD *)(MusicDownloadManager::sharedState(v110) + 728) + 8 * i + 4); v125 = 0; v126 = 0; v127 = nullptr; std::string::__init(&v125, &byte_11B8890, 0); v113 = (unsigned __int8 *)MusicDownloadManager::resolveSFXPlacement(v109, v111, v112, (__int64)&v125); v114 = (MusicDownloadManager *)(unsigned __int8)v125; if ( (v125 & 1) != 0 ) { v121 = v113; operator delete(v127); v113 = v121; } if ( !v113 ) { v115 = (MusicDownloadManager *)MusicDownloadManager::sharedState(v114); v116 = MusicDownloadManager::sharedState(v115); v106 = MusicDownloadManager::getSFXObject(v115, *(_DWORD *)(*(_QWORD *)(v116 + 728) + 8 * i)); v113 = (unsigned __int8 *)v106; if ( !v106 ) continue; } v106 = v113[72]; if ( !v113[72] ) v106 = cocos2d::CCArray::addObject(FilesMatchingSearch, (cocos2d::CCObject *)v113); } } break; default: v50 = *(_QWORD *)(a1 + 152); v51 = (v50 - *(_QWORD *)(a1 + 144)) >> 2; if ( v51 ) { for ( j = 0; j != v51; ++j ) { v53 = (MusicDownloadManager *)MusicDownloadManager::sharedState((MusicDownloadManager *)v50); v50 = MusicDownloadManager::getSFXObject(v53, *(_DWORD *)(*(_QWORD *)(a1 + 144) + 4 * j)); v54 = (cocos2d::CCObject *)v50; if ( v50 ) { v50 = *(unsigned __int8 *)(v50 + 72); if ( !(_DWORD)v50 ) v50 = cocos2d::CCArray::addObject(FilesMatchingSearch, v54); } } } break; } v74 = *(_BYTE *)(a1 + 104); v75 = v74 & 1; if ( (v74 & 1) != 0 ) v76 = *(_QWORD *)(a1 + 112); else v76 = v74 >> 1; if ( v76 ) { if ( FilesMatchingSearch ) { v77 = *((unsigned int **)FilesMatchingSearch + 7); v78 = *v77; if ( *v77 ) { v79 = *((__int64 **)v77 + 2); v80 = &v79[v78 - 1]; if ( v79 <= v80 ) { v95 = *v79; if ( *v79 ) { do { ++v79; *(_BYTE *)(v95 + 73) = 0; if ( v80 < v79 ) break; v95 = *v79; } while ( *v79 ); v75 = *(_BYTE *)(a1 + 104) & 1; } } } } v125 = 0; v126 = 0; v127 = nullptr; if ( v75 ) { std::string::__init(&v125, *(void **)(a1 + 120), *(_QWORD *)(a1 + 112)); } else { v81 = *(_QWORD *)(a1 + 104); v82 = *(_QWORD *)(a1 + 112); v127 = *(void **)(a1 + 120); v125 = v81; v126 = v82; } FilesMatchingSearch = MusicSearchResult::getFilesMatchingSearch(a1, (__int64)FilesMatchingSearch, (char *)&v125); if ( (v125 & 1) != 0 ) operator delete(v127); } if ( *(_DWORD *)(a1 + 140) != 2 ) sub_95A13C(FilesMatchingSearch, a2); v83 = *(cocos2d::CCObject **)(a1 + 64); if ( FilesMatchingSearch != v83 ) { if ( FilesMatchingSearch ) { cocos2d::CCObject::retain(FilesMatchingSearch); v83 = *(cocos2d::CCObject **)(a1 + 64); } if ( v83 ) cocos2d::CCObject::release(v83); *(_QWORD *)(a1 + 64) = FilesMatchingSearch; } return _stack_chk_guard; } goto LABEL_10; } while ( (unsigned int)*(unsigned __int8 *)v7 - 48 <= 9 ) { v7 = (MusicDownloadManager *)((char *)v7 + 1); if ( v8 == v7 ) goto LABEL_124; } LABEL_9: *(_DWORD *)(a1 + 128) = a2; LABEL_10: v9 = *(_QWORD *)(a1 + 176); if ( !v9 ) goto LABEL_123; v10 = *(_BYTE *)(a1 + 104) >> 1; if ( (*(_BYTE *)(a1 + 104) & 1) != 0 ) v10 = *(_QWORD *)(v5 + 8); if ( !v10 ) { AllSFXObjects = *(cocos2d::CCArray **)(v9 + 152); LABEL_80: v56 = (cocos2d::CCArray *)cocos2d::CCArray::count(AllSFXObjects); v11 = (cocos2d::CCArray *)cocos2d::CCArray::createWithCapacity(v56, v57); if ( AllSFXObjects ) { v58 = *((unsigned int **)AllSFXObjects + 7); if ( *v58 ) { v59 = *((cocos2d::CCObject ***)v58 + 2); v60 = 8LL * *v58 - 8; v61 = (char *)v59 + v60; if ( v59 <= (cocos2d::CCObject **)((char *)v59 + v60) ) { do { v62 = *v59; if ( !*v59 ) break; ++v59; cocos2d::CCArray::addObject(v11, v62); } while ( v61 >= (char *)v59 ); } } } goto LABEL_24; } if ( !v3 ) { v9 = *(unsigned int *)(v9 + 56); if ( (_DWORD)v9 == 1 ) { LABEL_123: v84 = (MusicDownloadManager *)MusicDownloadManager::sharedState((MusicDownloadManager *)v9); AllSFXObjects = (cocos2d::CCArray *)MusicDownloadManager::getAllSFXObjects(v84, 1u); goto LABEL_80; } } v11 = (cocos2d::CCArray *)cocos2d::CCArray::create((cocos2d::CCArray *)v9); v13 = (cocos2d::CCArray *)cocos2d::CCArray::createWithObject(*(cocos2d::CCArray **)(a1 + 176), v12); LABEL_17: while ( (unsigned int)cocos2d::CCArray::count(v13) ) { while ( 1 ) { Object = cocos2d::CCArray::lastObject(v13); cocos2d::CCArray::removeLastObject(v13, 1); v15 = *(_QWORD *)(Object + 152); if ( !v15 ) break; v16 = *(unsigned int **)(v15 + 56); if ( !*v16 ) break; v17 = *((cocos2d::CCObject ***)v16 + 2); v18 = &v17[*v16 - 1]; if ( v17 <= v18 ) { do { v46 = *v17; if ( !*v17 ) break; if ( *((_BYTE *)v46 + 72) ) cocos2d::CCArray::addObject(v13, v46); else cocos2d::CCArray::addObject(v11, v46); ++v17; } while ( v18 >= v17 ); goto LABEL_17; } if ( !(unsigned int)cocos2d::CCArray::count(v13) ) goto LABEL_22; } } LABEL_22: if ( !v11 ) { v117 = (cocos2d::CCArray *)cocos2d::CCArray::count(nullptr); v11 = (cocos2d::CCArray *)cocos2d::CCArray::createWithCapacity(v117, v118); } LABEL_24: v19 = (GameManager *)*(unsigned __int8 *)(a1 + 104); v20 = (unsigned __int8)v19 >> 1; if ( ((unsigned __int8)v19 & 1) != 0 ) v20 = *(_QWORD *)(v5 + 8); if ( v20 ) { if ( v11 ) { v19 = *((GameManager **)v11 + 7); v21 = *(_DWORD *)v19; if ( *(_DWORD *)v19 ) { v19 = *((GameManager **)v19 + 2); for ( k = (GameManager *)((char *)v19 + 8 * v21 - 8); k >= v19; *(_BYTE *)(v23 + 73) = 0 ) { v23 = *(_QWORD *)v19; if ( !*(_QWORD *)v19 ) break; v19 = (GameManager *)((char *)v19 + 8); } } } v24 = (GameManager *)GameManager::sharedState(v19); if ( (unsigned __int8)GameManager::getGameVariable(v24, "0147") && *(_QWORD *)(a1 + 176) ) { v25 = *(_BYTE *)(a1 + 104); v122 = 0; v123 = nullptr; v124 = nullptr; if ( (v25 & 1) != 0 ) { std::string::__init(&v122, *(void **)(v5 + 16), *(_QWORD *)(v5 + 8)); } else { v26 = *(_QWORD *)v5; v27 = *(cocos2d::CCObject **)(v5 + 8); v124 = *(void **)(v5 + 16); v122 = v26; v123 = v27; } v28 = (cocos2d::CCObject *)((unsigned __int8)v122 >> 1); if ( (v122 & 1) != 0 ) v28 = v123; v29 = (unsigned int)v28; if ( (_DWORD)v28 ) { v28 = nullptr; if ( (v122 & 1) == 0 ) goto LABEL_42; while ( 1 ) { v30 = (cocos2d::CCObject *)((char *)v28 + 1); v31 = (char *)v28 + (_QWORD)v124; *v31 = tolower((unsigned __int8)*v31); v28 = v30; if ( v29 <= (unsigned int)v30 ) break; while ( (v122 & 1) == 0 ) { LABEL_42: v32 = (cocos2d::CCObject *)((char *)v28 + 1); *((_BYTE *)&v122 + (_QWORD)v28 + 1) = tolower(*((unsigned __int8 *)&v122 + (_QWORD)v28 + 1)); v28 = v32; if ( v29 <= (unsigned int)v32 ) goto LABEL_43; } } } LABEL_43: v33 = (cocos2d::CCArray *)cocos2d::CCArray::createWithObject(*(cocos2d::CCArray **)(a1 + 176), v28); while ( 1 ) { if ( !(unsigned int)cocos2d::CCArray::count(v33) ) { if ( (v122 & 1) != 0 ) operator delete(v124); goto LABEL_88; } v34 = cocos2d::CCArray::lastObject(v33); cocos2d::CCArray::removeLastObject(v33, 1); SFXInfoObject::getLowerCaseName((SFXInfoObject *)v34, &v125); v35 = 1; if ( !*(_BYTE *)(v34 + 73) ) { if ( (v125 & 1) != 0 ) { v36 = (char *)v127; v37 = v126; } else { v37 = (unsigned __int8)v125 >> 1; v36 = (char *)&v125 + 1; } if ( (v122 & 1) != 0 ) { v38 = (unsigned __int8 *)v124; v39 = v123; } else { v39 = (cocos2d::CCObject *)((unsigned __int8)v122 >> 1); v38 = (unsigned __int8 *)&v122 + 1; } if ( v37 < (unsigned __int64)v39 ) goto LABEL_133; v35 = 1; if ( v39 ) break; } LABEL_52: v40 = *(_QWORD *)(v34 + 152); if ( v40 ) { v41 = *(unsigned int **)(v40 + 56); if ( *v41 ) { v42 = *((unsigned __int8 ***)v41 + 2); for ( m = &v42[*v41 - 1]; m >= v42; ++v42 ) { v44 = *v42; if ( !*v42 ) break; v45 = v44[72]; v44[73] = v35; if ( v45 ) cocos2d::CCArray::addObject(v33, (cocos2d::CCObject *)v44); } } } if ( (v125 & 1) != 0 ) operator delete(v127); } v93 = &v36[v37]; v120 = v36; v94 = std::__search( (__int64)v36, (__int64)&v36[v37], v38, (unsigned __int8 *)v39 + (_QWORD)v38, (unsigned __int8 (__fastcall *)(__int64, _QWORD))std::char_traits::eq); if ( v93 != (char *)v94 ) { v35 = v94 - (_QWORD)v120 != -1; goto LABEL_52; } LABEL_133: v35 = 0; goto LABEL_52; } LABEL_88: v63 = *(_BYTE *)(a1 + 104); v125 = 0; v126 = 0; v127 = nullptr; if ( (v63 & 1) != 0 ) { std::string::__init(&v125, *(void **)(v5 + 16), *(_QWORD *)(v5 + 8)); } else { v64 = *(_QWORD *)v5; v65 = *(_QWORD *)(v5 + 8); v127 = *(void **)(v5 + 16); v125 = v64; v126 = v65; } v11 = MusicSearchResult::getFilesMatchingSearch(a1, (__int64)v11, (char *)&v125); if ( (v125 & 1) != 0 ) operator delete(v127); } sub_95A13C(v11, a2); v66 = *(cocos2d::CCObject **)(a1 + 64); if ( v11 != v66 ) { if ( v11 ) { cocos2d::CCObject::retain(v11); v66 = *(cocos2d::CCObject **)(a1 + 64); } if ( v66 ) cocos2d::CCObject::release(v66); *(_QWORD *)(a1 + 64) = v11; } return _stack_chk_guard; }
GD Web Decomp Icon

GD Web Decomp

Raw Source