{"type": "func", "start": 3152330, "end": 3152430, "name": "FMODAudioEngine::channelForChannelID", "pseudocode": "// \n// FMODAudioEngine::channelForChannelID from 0x3019ca to 0x301a2e (100 bytes)\n// \n// 20 xrefs:\n// > FMODAudioEngine::saveAudioState @ 0x301a84\n// > FMODAudioEngine::pauseAllMusic @ 0x301b46\n// > FMODAudioEngine::resumeAllMusic @ 0x301b6c\n// > FMODAudioEngine::stopAllMusic @ 0x301c2c\n// > FMODAudioEngine::channelForUniqueID @ 0x301e22\n// > FMODAudioEngine::setMusicTimeMS @ 0x30239a\n// > FMODAudioEngine::getMusicTimeMS @ 0x30240a\n// > FMODAudioEngine::getMusicLengthMS @ 0x302476\n// > FMODAudioEngine::setChannelVolume @ 0x302574\n// > FMODAudioEngine::setChannelVolume @ 0x302594\n// > FMODAudioEngine::setChannelVolumeMod @ 0x302684\n// > FMODAudioEngine::setChannelVolumeMod @ 0x3026a4\n// > FMODAudioEngine::setChannelPitch @ 0x302750\n// > FMODAudioEngine::getActiveMusicChannel @ 0x30286c\n// > FMODAudioEngine::startMusic @ 0x302dc2\n// > FMODAudioEngine::stopAndRemoveMusic @ 0x30336c\n// > FMODAudioEngine::loadMusic @ 0x30354a\n// > FMODAudioEngine::playEffectAdvanced @ 0x305522\n// > FMODAudioEngine::loadAudioState @ 0x305b66\n// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x48b8a0\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\nFMOD::Channel *FMODAudioEngine::channelForChannelID(FMODAudioEngine *a1, int a2)\n{\n  std::_Hashtable<int, std::pair<const int, FMOD::Channel *>, std::allocator<std::pair<const int, FMOD::Channel *>>, std::__detail::_Select1st, std::equal_to<int>, std::hash<int>, std::__detail::_Mod_range_hashing, std::__detail::_Default_ranged_hash, std::__detail::_Prime_rehash_policy, std::__detail::_Hashtable_traits<false, false, true>>::size_type M_bucket_count; // r7\n  std::unordered_map<int, FMOD::Channel *> *p_m_channelIDToChannel; // r9\n  unsigned int v5; // r1\n  FMOD::Channel *result; // r0\n  _DWORD *v7; // r4\n  int v8; // r5\n  int v9; // [sp+4h] [bp-8h] BYREF\n\n  v9 = a2;\n  M_bucket_count = a1->m_channelIDToChannel._M_h._M_bucket_count;\n  v9 = a2;\n  p_m_channelIDToChannel = &a1->m_channelIDToChannel;\n  v5 = a2 % M_bucket_count;\n  result = (FMOD::Channel *)a1->m_channelIDToChannel._M_h._M_buckets[v5];\n  if ( result )\n  {\n    v7 = *(_DWORD **)&result->FMOD::ChannelControl;\n    if ( *(_DWORD *)&result->FMOD::ChannelControl )\n    {\n      v8 = 0;\n      do\n      {\n        if ( a2 == v7[1] )\n        {\n          ++v8;\n        }\n        else if ( v8 )\n        {\n          return (FMOD::Channel *)*std::__detail::_Map_base<int,std::pair<int const,FMOD::Channel *>,std::allocator<std::pair<int const,FMOD::Channel *>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>,true>::operator[](\n                                     p_m_channelIDToChannel,\n                                     (unsigned int *)&v9);\n        }\n        v7 = (_DWORD *)*v7;\n      }\n      while ( v7 && v7[1] % M_bucket_count == v5 );\n      if ( !v8 )\n        return nullptr;\n      return (FMOD::Channel *)*std::__detail::_Map_base<int,std::pair<int const,FMOD::Channel *>,std::allocator<std::pair<int const,FMOD::Channel *>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>,true>::operator[](\n                                 p_m_channelIDToChannel,\n                                 (unsigned int *)&v9);\n    }\n    else\n    {\n      return nullptr;\n    }\n  }\n  return result;\n}", "assembly": "; \n; FMODAudioEngine::channelForChannelID from 0x3019ca to 0x301a2e (100 bytes)\n; \n; 20 xrefs:\n; > FMODAudioEngine::saveAudioState @ 0x301a84\n; > FMODAudioEngine::pauseAllMusic @ 0x301b46\n; > FMODAudioEngine::resumeAllMusic @ 0x301b6c\n; > FMODAudioEngine::stopAllMusic @ 0x301c2c\n; > FMODAudioEngine::channelForUniqueID @ 0x301e22\n; > FMODAudioEngine::setMusicTimeMS @ 0x30239a\n; > FMODAudioEngine::getMusicTimeMS @ 0x30240a\n; > FMODAudioEngine::getMusicLengthMS @ 0x302476\n; > FMODAudioEngine::setChannelVolume @ 0x302574\n; > FMODAudioEngine::setChannelVolume @ 0x302594\n; > FMODAudioEngine::setChannelVolumeMod @ 0x302684\n; > FMODAudioEngine::setChannelVolumeMod @ 0x3026a4\n; > FMODAudioEngine::setChannelPitch @ 0x302750\n; > FMODAudioEngine::getActiveMusicChannel @ 0x30286c\n; > FMODAudioEngine::startMusic @ 0x302dc2\n; > FMODAudioEngine::stopAndRemoveMusic @ 0x30336c\n; > FMODAudioEngine::loadMusic @ 0x30354a\n; > FMODAudioEngine::playEffectAdvanced @ 0x305522\n; > FMODAudioEngine::loadAudioState @ 0x305b66\n; > GJBaseGameLayer::processActivatedAudioTriggers @ 0x48b8a0\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nPUSH.W          {R0-R2,R4-R9,LR}                                       ; +0x0, 0x3019ca\nMOV             R4, R0                                                 ; +0x4, 0x3019ce\nLDR.W           R7, [R0,#0x3A4]                                        ; +0x6, 0x3019d0\nMOV             R8, R1                                                 ; +0xa, 0x3019d4\nSTR             R1, [SP,#0xC+var_8]                                    ; +0xc, 0x3019d6\nADD.W           R9, R0, #0x3A0                                         ; +0xe, 0x3019d8\nMOV             R0, R1                                                 ; +0x12, 0x3019dc\nMOV             R1, R7                                                 ; +0x14, 0x3019de\nBLX             __aeabi_uidivmod                                       ; +0x16, 0x3019e0\nLDR.W           R3, [R4,#0x3A0]                                        ; +0x1a, 0x3019e4\nLDR.W           R0, [R3,R1,LSL#2]                                      ; +0x1e, 0x3019e8\nMOV             R6, R1                                                 ; +0x22, 0x3019ec\nCBZ             R0, loc_301A28                                         ; +0x24, 0x3019ee\nLDR             R4, [R0]                                               ; +0x26, 0x3019f0\nCBZ             R4, loc_301A26                                         ; +0x28, 0x3019f2\nMOVS            R5, #0                                                 ; +0x2a, 0x3019f4\nLDR             R3, [R4,#4]                                            ; +0x2c, 0x3019f6\nCMP             R8, R3                                                 ; +0x2e, 0x3019f8\nBNE             loc_301A00                                             ; +0x30, 0x3019fa\nADDS            R5, #1                                                 ; +0x32, 0x3019fc\nB               loc_301A02                                             ; +0x34, 0x3019fe\nCBNZ            R5, loc_301A1A                                         ; +0x36, 0x301a00\nLDR             R4, [R4]                                               ; +0x38, 0x301a02\nCBNZ            R4, loc_301A0C                                         ; +0x3a, 0x301a04\nCBNZ            R5, loc_301A1A                                         ; +0x3c, 0x301a06\nMOV             R0, R5                                                 ; +0x3e, 0x301a08\nB               loc_301A28                                             ; +0x40, 0x301a0a\nLDR             R0, [R4,#4]                                            ; +0x42, 0x301a0c\nMOV             R1, R7                                                 ; +0x44, 0x301a0e\nBLX             __aeabi_uidivmod                                       ; +0x46, 0x301a10\nCMP             R1, R6                                                 ; +0x4a, 0x301a14\nBEQ             loc_3019F6                                             ; +0x4c, 0x301a16\nB               loc_301A06                                             ; +0x4e, 0x301a18\nMOV             R0, R9                                                 ; +0x50, 0x301a1a\nADD             R1, SP, #0xC+var_8                                     ; +0x52, 0x301a1c\nBL              _ZNSt8__detail9_Map_baseIiSt4pairIKiPN4FMOD7ChannelEESaIS6_ENS_10_Select1stESt8equal_toIiESt4hashIiENS_18_Mod_range_hashingENS_20_Default_ranged_hashENS_20_Prime_rehash_policyENS_17_Hashtable_traitsILb0ELb0ELb1EEELb1EEixERS2_; std::__detail::_Map_base<int,std::pair<int const,FMOD::Channel *>,std::allocator<std::pair<int const,FMOD::Channel *>>,std::__detail::_Select1st,std::equal_to<int>,std::hash<int>,std::__detail::_Mod_range_hashing,std::__detail::_Default_ranged_hash,std::__detail::_Prime_rehash_policy,std::__detail::_Hashtable_traits<false,false,true>,true>::operator[](int const&) ; +0x54, 0x301a1e\nLDR             R0, [R0]                                               ; +0x58, 0x301a22\nB               loc_301A28                                             ; +0x5a, 0x301a24\nMOV             R0, R4                                                 ; +0x5c, 0x301a26\nADD             SP, SP, #0xC                                           ; +0x5e, 0x301a28\nPOP.W           {R4-R9,PC}                                             ; +0x60, 0x301a2a", "xrefs": ["FMODAudioEngine::saveAudioState @ 0x301a84", "FMODAudioEngine::pauseAllMusic @ 0x301b46", "FMODAudioEngine::resumeAllMusic @ 0x301b6c", "FMODAudioEngine::stopAllMusic @ 0x301c2c", "FMODAudioEngine::channelForUniqueID @ 0x301e22", "FMODAudioEngine::setMusicTimeMS @ 0x30239a", "FMODAudioEngine::getMusicTimeMS @ 0x30240a", "FMODAudioEngine::getMusicLengthMS @ 0x302476", "FMODAudioEngine::setChannelVolume @ 0x302574", "FMODAudioEngine::setChannelVolume @ 0x302594", "FMODAudioEngine::setChannelVolumeMod @ 0x302684", "FMODAudioEngine::setChannelVolumeMod @ 0x3026a4", "FMODAudioEngine::setChannelPitch @ 0x302750", "FMODAudioEngine::getActiveMusicChannel @ 0x30286c", "FMODAudioEngine::startMusic @ 0x302dc2", "FMODAudioEngine::stopAndRemoveMusic @ 0x30336c", "FMODAudioEngine::loadMusic @ 0x30354a", "FMODAudioEngine::playEffectAdvanced @ 0x305522", "FMODAudioEngine::loadAudioState @ 0x305b66", "GJBaseGameLayer::processActivatedAudioTriggers @ 0x48b8a0"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}