// // FMODAudioEngine::preloadEffectAsync from 0x5b2040 to 0x5b2394 (852 bytes) // // 2 xrefs: // > FMODAudioEngine::queuePlayEffect @ 0x5b2504 // > @ 0x442b0 // // This function is hookable on this platform! // // Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA // Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings // FMOD::Sound *__fastcall FMODAudioEngine::preloadEffectAsync(__int64 a1, const void **a2) { __int64 v2; // x24 unsigned __int64 v5; // x0 unsigned __int64 v6; // x20 unsigned __int64 v7; // x26 unsigned __int64 v8; // x27 _QWORD *v9; // x0 _QWORD *v10; // x19 unsigned __int64 v11; // x0 __int64 v12; // x25 cocos2d::CCFileUtils *v13; // x0 void *v14; // x0 const char *v15; // x1 FMOD::System *v16; // x0 FMOD::Sound *v17; // x19 char *v18; // x0 char *v19; // x22 _QWORD *v21; // x1 size_t v22; // x2 cocos2d::CCString *v23; // x0 size_t v24; // x0 unsigned int *v25; // x21 int v26; // w0 unsigned int *v27; // x1 int v28; // w2 const char *CString; // [xsp+68h] [xbp+68h] FMOD::Sound *v30; // [xsp+78h] [xbp+78h] BYREF const char *v31; // [xsp+80h] [xbp+80h] BYREF FMOD_CREATESOUNDEXINFO v32; // [xsp+88h] [xbp+88h] BYREF v2 = a1 + 1880; v5 = sub_CCD1D0(*a2, *((_QWORD *)*a2 - 3), 3339675911LL); v6 = *(_QWORD *)(a1 + 1888); v7 = v5; v8 = v5 % v6; v9 = *(_QWORD **)(*(_QWORD *)(a1 + 1880) + 8 * (v5 % v6)); if ( v9 && (v10 = (_QWORD *)*v9) != nullptr ) { v11 = v10[3]; v12 = 0; do { if ( v7 == v11 && (v21 = (_QWORD *)v10[1], v22 = *((_QWORD *)*a2 - 3), v22 == *(v21 - 3)) && !memcmp(*a2, v21, v22) ) { ++v12; } else if ( v12 ) { return *(FMOD::Sound **)std::__detail::_Map_base,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits,true>::operator[]( v2, a2); } v10 = (_QWORD *)*v10; if ( !v10 ) break; v11 = v10[3]; } while ( v8 == v11 % v6 ); if ( !v12 ) goto LABEL_9; return *(FMOD::Sound **)std::__detail::_Map_base,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits,true>::operator[]( v2, a2); } else { LABEL_9: v30 = nullptr; v13 = cocos2d::CCFileUtils::sharedFileUtils(); ((void (__fastcall *)(FMOD_CREATESOUNDEXINFO *__return_ptr, cocos2d::CCFileUtils *, const void *, _QWORD))v13->createCCArrayWithContentsOfFile)( &v32, v13, *a2, 0); sub_D153B8((int)&v31, *(char **)&v32.cbsize); v14 = (void *)(*(_QWORD *)&v32.cbsize - 24LL); if ( (__int64 *)(*(_QWORD *)&v32.cbsize - 24LL) != &qword_124B6B0 ) { if ( &pthread_create ) { v27 = (unsigned int *)(*(_QWORD *)&v32.cbsize - 8LL); do v28 = __ldaxr(v27); while ( __stlxr(v28 - 1, v27) ); } else { v28 = *(_DWORD *)(*(_QWORD *)&v32.cbsize - 8LL); *(_DWORD *)(*(_QWORD *)&v32.cbsize - 8LL) = v28 - 1; } if ( v28 <= 0 ) operator delete(v14); } v15 = v31; if ( *((_QWORD *)v31 - 3) ) { if ( (*((_DWORD *)v31 - 2) & 0x80000000) == 0 ) { sub_D176A8(&v31); v15 = v31; } if ( *v15 != 47 ) { v23 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat( (cocos2d::CCString *)"file:///android_asset/%s", (const char *)*a2); CString = cocos2d::CCString::getCString(v23); v24 = strlen(CString); sub_D1798C(&v31, CString, v24); v15 = v31; } } v16 = *(FMOD::System **)(a1 + 536); memset(&v32.fileoffset, 0, 104); *(_QWORD *)&v32.suggestedsoundtype = 10; memset(&v32.fileuseropen, 0, 104); *(_QWORD *)&v32.cbsize = 224; *(_DWORD *)(a1 + 576) = FMOD::System::createSound(v16, v15, 0x801000Au, &v32, &v30); ERRCHECK_fn(); v17 = v30; if ( v30 ) { v18 = std::__detail::_Map_base,std::allocator>,std::__detail::_Select1st,std::equal_to,std::hash,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits,true>::operator[]( v2, a2); *(_QWORD *)v18 = v30; v17 = v30; } v19 = (char *)(v31 - 24); if ( v31 - 24 != (const char *)&qword_124B6B0 ) { if ( &pthread_create ) { v25 = (unsigned int *)(v31 - 8); do v26 = __ldaxr(v25); while ( __stlxr(v26 - 1, v25) ); } else { v26 = *((_DWORD *)v31 - 2); *((_DWORD *)v31 - 2) = v26 - 1; } if ( v26 <= 0 ) operator delete(v19); } } return v17; }
GD Web Decomp Icon

GD Web Decomp

Raw Source