// // MusicDownloadManager::parseSFXLibrary from 0x96b864 to 0x96c9d0 (4460 bytes) // // 4 xrefs: // > MusicDownloadManager::onDownloadSFXLibraryCompleted @ 0x96caac // > MusicDownloadManager::tryLoadLibraries @ 0x978df0 // > sub_B947C8 @ 0xb9636c // > @ 0xe8630 // // 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:39 +0000 // __int64 __fastcall MusicDownloadManager::parseSFXLibrary(cocos2d::CCArray **this) { cocos2d::CCFileUtils *v2; // x0 __int64 v3; // x0 _BYTE *v4; // x1 cocos2d::ZipUtils *v5; // x0 int v6; // w4 unsigned __int8 *v7; // x19 unsigned __int8 *v8; // x0 unsigned __int8 *v9; // x0 cocos2d::CCObject *v10; // x0 cocos2d::CCObject *v11; // x0 cocos2d::CCArray *v12; // x0 cocos2d::CCObject *v13; // x0 char *v14; // x20 __int64 v15; // x0 __int64 v16; // x23 unsigned __int64 i; // x22 __int64 v18; // x26 char *j; // x0 __int64 v20; // x28 const char *v21; // x0 int v22; // w26 char v23; // w0 char *v24; // x27 __int64 v25; // x28 size_t v26; // x0 __int64 v27; // x28 const char *v28; // x0 int v29; // w27 const char *v30; // x0 const char *v31; // x0 const char *v32; // x0 int v33; // w28 int *v34; // x0 __int64 v35; // x27 unsigned __int64 v36; // x26 __int64 v37; // x20 char *k; // x0 cocos2d::CCArray *v39; // x20 __int64 v40; // x5 __int64 v41; // x0 __int64 v42; // x1 cocos2d::CCObject *v43; // x0 cocos2d::CCObject *v44; // x0 cocos2d::CCObject *v45; // x0 int v46; // w0 void *v47; // x0 __int64 v48; // x5 __int64 v49; // x20 char *v50; // x0 __int64 v51; // x20 char *v52; // x0 __int64 v53; // x19 char *v54; // x0 unsigned __int8 *v55; // x19 unsigned __int8 *v56; // x0 const char *v58; // x0 int *v59; // x0 size_t v60; // x2 void *v61; // x1 _BYTE *v62; // x20 _BYTE *v63; // x22 __int64 v64; // x27 char *v65; // x0 __int64 v66; // x2 _BYTE *ii; // x0 char *v68; // x20 char *v69; // x0 const char *v70; // x0 unsigned int v71; // w22 const char *v72; // x0 int v73; // w1 const char *v74; // x0 int v75; // w0 __int64 v76; // x1 _BYTE *v77; // x20 _BYTE *v78; // x3 __int64 v79; // x22 unsigned __int64 v80; // x23 char *v81; // x0 __int64 v82; // x2 _BYTE *n; // x0 char *v84; // x20 char *v85; // x0 char *v86; // x20 char *v87; // x0 __int64 v88; // x5 void *v89; // x0 size_t v90; // x1 cocos2d::CCObject *v91; // x0 _BYTE *v92; // x20 _BYTE *v93; // x0 void *v94; // x0 char *v95; // x20 char *v96; // x0 cocos2d::CCObject *v97; // [xsp+90h] [xbp+90h] int v98; // [xsp+B8h] [xbp+B8h] cocos2d::CCArray *v99; // [xsp+B8h] [xbp+B8h] int v100; // [xsp+C0h] [xbp+C0h] unsigned __int64 m; // [xsp+C0h] [xbp+C0h] int v102; // [xsp+C8h] [xbp+C8h] _BOOL8 v103; // [xsp+D8h] [xbp+D8h] BYREF char v104; // [xsp+E0h] [xbp+E0h] BYREF _BYTE v105[7]; // [xsp+E1h] [xbp+E1h] BYREF _BYTE *v106; // [xsp+F0h] [xbp+F0h] __int64 v107; // [xsp+F8h] [xbp+F8h] BYREF __int64 v108; // [xsp+100h] [xbp+100h] _BYTE *v109; // [xsp+108h] [xbp+108h] __int64 v110[3]; // [xsp+110h] [xbp+110h] BYREF unsigned __int8 *v111; // [xsp+128h] [xbp+128h] BYREF unsigned __int8 *v112; // [xsp+130h] [xbp+130h] __int64 v113; // [xsp+138h] [xbp+138h] unsigned __int8 *v114; // [xsp+140h] [xbp+140h] BYREF char *v115; // [xsp+148h] [xbp+148h] __int64 v116; // [xsp+150h] [xbp+150h] char *v117; // [xsp+158h] [xbp+158h] BYREF char *v118; // [xsp+160h] [xbp+160h] __int64 v119; // [xsp+168h] [xbp+168h] __int64 v120; // [xsp+170h] [xbp+170h] BYREF size_t v121; // [xsp+178h] [xbp+178h] void *v122; // [xsp+180h] [xbp+180h] __int64 v123; // [xsp+188h] [xbp+188h] BYREF size_t v124; // [xsp+190h] [xbp+190h] void *v125; // [xsp+198h] [xbp+198h] unsigned __int8 *v126; // [xsp+1A0h] [xbp+1A0h] BYREF char *v127; // [xsp+1A8h] [xbp+1A8h] __int64 v128; // [xsp+1B0h] [xbp+1B0h] __int64 v129; // [xsp+1B8h] [xbp+1B8h] BYREF __int64 v130; // [xsp+1C0h] [xbp+1C0h] void *v131; // [xsp+1C8h] [xbp+1C8h] __int64 v132; // [xsp+1D0h] [xbp+1D0h] BYREF __int64 v133; // [xsp+1D8h] [xbp+1D8h] void *v134; // [xsp+1E0h] [xbp+1E0h] __int64 v135; // [xsp+1E8h] [xbp+1E8h] BYREF __int64 v136; // [xsp+1F0h] [xbp+1F0h] void *v137; // [xsp+1F8h] [xbp+1F8h] void *v138; // [xsp+200h] [xbp+200h] BYREF _BYTE *v139; // [xsp+208h] [xbp+208h] __int64 v140; // [xsp+210h] [xbp+210h] void *v141; // [xsp+218h] [xbp+218h] BYREF char *v142; // [xsp+220h] [xbp+220h] __int64 v143; // [xsp+228h] [xbp+228h] void *v144; // [xsp+230h] [xbp+230h] BYREF char *v145; // [xsp+238h] [xbp+238h] __int64 v146; // [xsp+240h] [xbp+240h] void *v147; // [xsp+248h] [xbp+248h] BYREF _BYTE *v148; // [xsp+250h] [xbp+250h] __int64 v149; // [xsp+258h] [xbp+258h] void *v150; // [xsp+260h] [xbp+260h] BYREF _BYTE *v151; // [xsp+268h] [xbp+268h] __int64 v152; // [xsp+270h] [xbp+270h] __int64 v153; // [xsp+278h] [xbp+278h] BYREF __int64 v154; // [xsp+280h] [xbp+280h] void *v155; // [xsp+288h] [xbp+288h] __int64 v156; // [xsp+290h] [xbp+290h] BYREF size_t v157; // [xsp+298h] [xbp+298h] void *v158; // [xsp+2A0h] [xbp+2A0h] MusicDownloadManager::pathForSFXFolder((MusicDownloadManager *)this, 0, (__int64)&v104); v2 = (cocos2d::CCFileUtils *)std::string::append((__int64)&v104, "sfxlibrary.dat", 0xEu); v103 = 0; v3 = cocos2d::CCFileUtils::sharedFileUtils(v2); v4 = v105; if ( (v104 & 1) != 0 ) v4 = v106; v5 = (cocos2d::ZipUtils *)(*(__int64 (__fastcall **)(__int64, _BYTE *, char *, _BOOL8 *))(*(_QWORD *)v3 + 32LL))( v3, v4, "r", &v103); v107 = 0; v108 = 0; v109 = nullptr; if ( !v5 ) goto LABEL_86; cocos2d::ZipUtils::decompressString2(v110, v5, nullptr, v103, 11, v6); if ( (v107 & 1) != 0 ) { *v109 = 0; v108 = 0; } else { LOWORD(v107) = 0; } std::string::reserve(&v107, 0); v107 = v110[0]; v108 = v110[1]; v109 = (_BYTE *)v110[2]; if ( (v110[0] & 1) != 0 ) { if ( !v108 ) goto LABEL_89; LABEL_8: v111 = nullptr; v112 = nullptr; v113 = 0; sub_961B60((unsigned __int8 *)&v107, "|", (__int64 *)&v111); v7 = v111; v8 = v112; if ( 0xAAAAAAAAAAAAAAABLL * ((v112 - v111) >> 3) <= 1 ) { if ( v111 ) { if ( v111 != v112 ) { do { v112 = v8 - 24; std::string::~string((__int64)(v8 - 24)); v8 = v112; } while ( v7 != v112 ); v56 = v111; LABEL_85: operator delete(v56); goto LABEL_86; } operator delete(v111); } LABEL_86: if ( (v107 & 1) == 0 ) goto LABEL_87; LABEL_89: operator delete(v109); if ( (v104 & 1) == 0 ) return _stack_chk_guard; LABEL_90: operator delete(v106); return _stack_chk_guard; } v114 = nullptr; v115 = nullptr; v116 = 0; sub_961B60(v111, ";", (__int64 *)&v114); v9 = v111; if ( (*v111 & 1) != 0 ) { **((_BYTE **)v111 + 2) = 0; *((_QWORD *)v9 + 1) = 0; } else { v111[1] = 0; *v9 = 0; } v117 = nullptr; v118 = nullptr; v119 = 0; if ( 0xAAAAAAAAAAAAAAABLL * ((v115 - (char *)v114) >> 3) ) { v10 = *(this + 50); if ( v10 ) { cocos2d::CCObject::release(v10); v10 = *(this + 51); if ( v10 ) v10 = (cocos2d::CCObject *)cocos2d::CCObject::release(v10); } v11 = (cocos2d::CCObject *)cocos2d::CCDictionary::create(v10); *(this + 50) = v11; v12 = (cocos2d::CCArray *)cocos2d::CCObject::retain(v11); v13 = (cocos2d::CCObject *)cocos2d::CCArray::create(v12); *(this + 51) = v13; cocos2d::CCObject::retain(v13); v14 = v115; v15 = (__int64)v114; *((_DWORD *)this + 107) = 0; if ( 0xAAAAAAAAAAAAAAABLL * ((__int64)&v14[-v15] >> 3) ) { v16 = 0; for ( i = 0; 0xAAAAAAAAAAAAAAABLL * ((v115 - (char *)v114) >> 3) > i; ++i ) { v18 = (__int64)v117; for ( j = v118; (char *)v18 != v118; j = v118 ) { v118 = j - 24; std::string::~string((__int64)(j - 24)); } sub_961B60(&v114[v16], &byte_1169BE0, (__int64 *)&v117); v20 = (__int64)v117; if ( 0xAAAAAAAAAAAAAAABLL * ((v118 - v117) >> 3) <= 5 ) goto LABEL_40; v21 = v117 + 1; if ( (*v117 & 1) != 0 ) v21 = *((const char **)v117 + 2); v22 = atoi(v21); v23 = *(_BYTE *)(v20 + 24); v24 = (char *)(v20 + 25); v25 = v20 + 24; if ( (v23 & 1) != 0 ) v24 = *(char **)(v25 + 16); v156 = 0; v157 = 0; v158 = nullptr; v26 = strlen(v24); std::string::__init(&v156, v24, v26); v27 = (__int64)v117; v28 = v117 + 49; if ( (v117[48] & 1) != 0 ) v28 = *((const char **)v117 + 8); v29 = atoi(v28); v30 = (const char *)(v27 + 73); if ( (*(_BYTE *)(v27 + 72) & 1) != 0 ) v30 = *(const char **)(v27 + 88); v100 = atoi(v30); v31 = (const char *)(v27 + 97); if ( (*(_BYTE *)(v27 + 96) & 1) != 0 ) v31 = *(const char **)(v27 + 112); v98 = atoi(v31); v32 = (const char *)(v27 + 121); if ( (*(_BYTE *)(v27 + 120) & 1) != 0 ) v32 = *(const char **)(v27 + 136); v33 = atoi(v32); if ( v22 == 1 ) { v58 = (char *)&v156 + 1; if ( (v156 & 1) != 0 ) v58 = (const char *)v158; *((_DWORD *)this + 106) = atoi(v58); std::string::assign(&v156, "Root"); if ( !v29 ) { LABEL_34: v120 = 0; v121 = 0; v122 = nullptr; if ( (v156 & 1) != 0 ) { std::string::__init(&v120, v158, v157); } else { v122 = v158; v120 = v156; v121 = v157; } v34 = (int *)SFXInfoObject::create(v22, (char *)&v120, v100, v98, v33); MusicDownloadManager::storeSFXInfoObject((__int64)this, v34); if ( (v120 & 1) != 0 ) operator delete(v122); ++*((_DWORD *)this + 107); LABEL_39: if ( (v156 & 1) != 0 ) goto LABEL_105; goto LABEL_40; } } else if ( !v29 ) { goto LABEL_34; } v123 = 0; v124 = 0; v125 = nullptr; if ( (v156 & 1) != 0 ) { std::string::__init(&v123, v158, v157); } else { v125 = v158; v123 = v156; v124 = v157; } v59 = (int *)SFXFolderObject::create(v22, (char *)&v123, v100); MusicDownloadManager::storeSFXInfoObject((__int64)this, v59); if ( (v123 & 1) == 0 ) goto LABEL_39; operator delete(v125); if ( (v156 & 1) != 0 ) LABEL_105: operator delete(v158); LABEL_40: v16 += 24; } } } v126 = nullptr; v127 = nullptr; v128 = 0; sub_961B60(v111 + 24, ";", (__int64 *)&v126); if ( 0xAAAAAAAAAAAAAAABLL * ((v127 - (char *)v126) >> 3) ) { v35 = 0; v36 = 0; do { v37 = (__int64)v117; for ( k = v118; (char *)v37 != v118; k = v118 ) { v118 = k - 24; std::string::~string((__int64)(k - 24)); } sub_961B60(&v126[v35], &byte_1169BE0, (__int64 *)&v117); if ( 0xAAAAAAAAAAAAAAABLL * ((v118 - v117) >> 3) > 1 ) { v129 = 0; v130 = 0; v131 = nullptr; v39 = *(this + 51); if ( (*v117 & 1) != 0 ) { std::string::__init(&v129, *((void **)v117 + 2), *((_QWORD *)v117 + 1)); v41 = (__int64)v117; } else { v40 = *((_QWORD *)v117 + 1); v129 = *(_QWORD *)v117; v130 = v40; v41 = (__int64)v117; v131 = *((void **)v117 + 2); } v132 = 0; v133 = 0; v134 = nullptr; if ( (*(_BYTE *)(v41 + 24) & 1) != 0 ) { std::string::__init(&v132, *(void **)(v41 + 40), *(_QWORD *)(v41 + 32)); } else { v42 = *(_QWORD *)(v41 + 32); v132 = *(_QWORD *)(v41 + 24); v133 = v42; v134 = *(void **)(v41 + 40); } v43 = CCURLObject::create((char *)&v129, (char *)&v132); cocos2d::CCArray::addObject(v39, v43); if ( (v132 & 1) != 0 ) operator delete(v134); if ( (v129 & 1) != 0 ) operator delete(v131); } ++v36; v35 += 24; } while ( v36 < 0xAAAAAAAAAAAAAAABLL * ((v127 - (char *)v126) >> 3) ); } v44 = *(this + 52); if ( v44 ) v44 = (cocos2d::CCObject *)cocos2d::CCObject::release(v44); v45 = (cocos2d::CCObject *)cocos2d::CCArray::create(v44); *(this + 52) = v45; cocos2d::CCObject::retain(v45); if ( 0xAAAAAAAAAAAAAAABLL * ((v112 - v111) >> 3) > 2 ) { v46 = v111[48]; if ( (v46 & 1) != 0 ) { v60 = *((_QWORD *)v111 + 7); if ( !v60 ) goto LABEL_66; v61 = *((void **)v111 + 8); v135 = 0; v136 = 0; v137 = nullptr; std::string::__init(&v135, v61, v60); } else { if ( !(v46 >> 1) ) goto LABEL_66; v47 = *((void **)v111 + 8); v48 = *((_QWORD *)v111 + 7); v135 = *((_QWORD *)v111 + 6); v136 = v48; v137 = v47; } LevelTools::base64DecodeString((__int64)&v135, &v132); if ( (v135 & 1) != 0 ) operator delete(v137); if ( (v132 & 1) != 0 ) { if ( !v133 ) { LABEL_65: operator delete(v134); goto LABEL_66; } } else if ( !((int)(unsigned __int8)v132 >> 1) ) { goto LABEL_66; } v138 = nullptr; v139 = nullptr; v140 = 0; sub_961B60((unsigned __int8 *)&v132, "$", (__int64 *)&v138); v62 = v138; v63 = v139; if ( 0xAAAAAAAAAAAAAAABLL * ((v139 - (_BYTE *)v138) >> 3) ) { v64 = 0; for ( m = 0; m < 0xAAAAAAAAAAAAAAABLL * ((v63 - v62) >> 3); ++m ) { v65 = &v62[v64]; v66 = v62[v64] >> 1; if ( (v62[v64] & 1) != 0 ) v66 = *((_QWORD *)v65 + 1); if ( !v66 ) goto LABEL_119; v141 = nullptr; v142 = nullptr; v143 = 0; sub_961B60((unsigned __int8 *)v65, ":", (__int64 *)&v141); if ( v141 == v142 ) { v95 = (char *)v141; } else { v144 = nullptr; v145 = nullptr; v146 = 0; sub_961B60((unsigned __int8 *)v141, &byte_1169BE0, (__int64 *)&v144); v68 = (char *)v144; v69 = v145; if ( 0xAAAAAAAAAAAAAAABLL * ((v145 - (_BYTE *)v144) >> 3) > 2 ) { v70 = (char *)v144 + 1; if ( (*(_BYTE *)v144 & 1) != 0 ) v70 = *((const char **)v144 + 2); v71 = atoi(v70); v72 = v68 + 25; if ( (v68[24] & 1) != 0 ) v72 = *((const char **)v68 + 5); v73 = atoi(v72); v74 = v68 + 49; if ( (v68[48] & 1) != 0 ) v74 = *((const char **)v68 + 8); v102 = v73; v75 = atoi(v74); v97 = (cocos2d::CCObject *)SFXChangelogEntry::create((SFXChangelogEntry *)v71, v102, v75); if ( 0xAAAAAAAAAAAAAAABLL * ((v142 - (_BYTE *)v141) >> 3) > 1 ) { v76 = *((_BYTE *)v141 + 24) >> 1; if ( (*((_BYTE *)v141 + 24) & 1) != 0 ) v76 = *((_QWORD *)v141 + 4); if ( v76 ) { v147 = nullptr; v148 = nullptr; v149 = 0; sub_961B60((unsigned __int8 *)v141 + 24, ";", (__int64 *)&v147); v77 = v147; v78 = v148; v79 = 0; v80 = 0; if ( 0xAAAAAAAAAAAAAAABLL * ((v148 - (_BYTE *)v147) >> 3) ) { do { v81 = &v77[v79]; v82 = v77[v79] >> 1; if ( (v77[v79] & 1) != 0 ) v82 = *((_QWORD *)v81 + 1); if ( v82 ) { v150 = nullptr; v151 = nullptr; v152 = 0; sub_961B60((unsigned __int8 *)v81, "~", (__int64 *)&v150); if ( 0xAAAAAAAAAAAAAAABLL * ((v151 - (_BYTE *)v150) >> 3) <= 1 ) { v92 = v150; } else { v153 = 0; v154 = 0; v155 = nullptr; v99 = *((cocos2d::CCArray **)v97 + 9); if ( (*(_BYTE *)v150 & 1) != 0 ) { std::string::__init(&v153, *((void **)v150 + 2), *((_QWORD *)v150 + 1)); v89 = v150; } else { v88 = *((_QWORD *)v150 + 1); v153 = *(_QWORD *)v150; v154 = v88; v89 = v150; v155 = *((void **)v150 + 2); } v156 = 0; v157 = 0; v158 = nullptr; if ( (*((_BYTE *)v89 + 24) & 1) != 0 ) { std::string::__init(&v156, *((void **)v89 + 5), *((_QWORD *)v89 + 4)); } else { v90 = *((_QWORD *)v89 + 4); v156 = *((_QWORD *)v89 + 3); v157 = v90; v158 = *((void **)v89 + 5); } v91 = CCURLObject::create((char *)&v153, (char *)&v156); cocos2d::CCArray::addObject(v99, v91); if ( (v156 & 1) != 0 ) operator delete(v158); if ( (v153 & 1) != 0 ) operator delete(v155); v92 = v150; } if ( v92 ) { v93 = v151; if ( v151 != v92 ) { do { v151 = v93 - 24; std::string::~string((__int64)(v93 - 24)); v93 = v151; } while ( v151 != v92 ); v92 = v150; } operator delete(v92); } v77 = v147; v78 = v148; } ++v80; v79 += 24; } while ( v80 < 0xAAAAAAAAAAAAAAABLL * ((v78 - v77) >> 3) ); } if ( v77 ) { for ( n = v148; v148 != v77; n = v148 ) { v148 = n - 24; std::string::~string((__int64)(n - 24)); } operator delete(v147); } } } cocos2d::CCArray::addObject(*(this + 52), v97); v84 = (char *)v144; if ( v144 ) { v85 = v145; if ( v144 != v145 ) { do { v145 = v85 - 24; std::string::~string((__int64)(v85 - 24)); v85 = v145; } while ( v84 != v145 ); v85 = (char *)v144; } operator delete(v85); } v86 = (char *)v141; if ( !v141 ) goto LABEL_157; v87 = v142; if ( v141 != v142 ) { do { v142 = v87 - 24; std::string::~string((__int64)(v87 - 24)); v87 = v142; } while ( v86 != v142 ); v87 = (char *)v141; } goto LABEL_156; } if ( v144 ) { if ( v144 == v145 ) { v94 = v144; } else { do { v145 = v69 - 24; std::string::~string((__int64)(v69 - 24)); v69 = v145; } while ( v68 != v145 ); v94 = v144; } operator delete(v94); } v95 = (char *)v141; } if ( !v95 ) goto LABEL_157; v96 = v142; if ( v142 != v95 ) { do { v142 = v96 - 24; std::string::~string((__int64)(v96 - 24)); v96 = v142; } while ( v142 != v95 ); v95 = (char *)v141; } v87 = v95; LABEL_156: operator delete(v87); LABEL_157: v62 = v138; v63 = v139; LABEL_119: v64 += 24; } } if ( v62 ) { for ( ii = v139; v139 != v62; ii = v139 ) { v139 = ii - 24; std::string::~string((__int64)(ii - 24)); } operator delete(v138); } if ( (v132 & 1) != 0 ) goto LABEL_65; } LABEL_66: MusicDownloadManager::syncCustomSFXPlacements((__int64)this); v49 = (__int64)v126; if ( v126 ) { v50 = v127; if ( v126 != (unsigned __int8 *)v127 ) { do { v127 = v50 - 24; std::string::~string((__int64)(v50 - 24)); v50 = v127; } while ( (char *)v49 != v127 ); v50 = (char *)v126; } operator delete(v50); } v51 = (__int64)v117; if ( v117 ) { v52 = v118; if ( v117 != v118 ) { do { v118 = v52 - 24; std::string::~string((__int64)(v52 - 24)); v52 = v118; } while ( (char *)v51 != v118 ); v52 = v117; } operator delete(v52); } v53 = (__int64)v114; if ( v114 ) { v54 = v115; if ( v114 != (unsigned __int8 *)v115 ) { do { v115 = v54 - 24; std::string::~string((__int64)(v54 - 24)); v54 = v115; } while ( (char *)v53 != v115 ); v54 = (char *)v114; } operator delete(v54); } v55 = v111; if ( v111 ) { v56 = v112; if ( v111 != v112 ) { do { v112 = v56 - 24; std::string::~string((__int64)(v56 - 24)); v56 = v112; } while ( v55 != v112 ); v56 = v111; } goto LABEL_85; } goto LABEL_86; } if ( (int)LOBYTE(v110[0]) >> 1 ) goto LABEL_8; LABEL_87: if ( (v104 & 1) != 0 ) goto LABEL_90; return _stack_chk_guard; }
GD Web Decomp Icon

GD Web Decomp

Raw Source