{"type": "func", "start": 5369070768, "end": 5369070950, "name": "FMODAudioEngine::channelForChannelID", "pseudocode": "// \n// FMODAudioEngine::channelForChannelID from 0x1400584b0 to 0x140058566 (182 bytes)\n// \n// 34 xrefs:\n// > FMODAudioEngine::saveAudioState @ 0x140055a3f\n// > FMODAudioEngine::loadAudioState @ 0x1400560ac\n// > FMODAudioEngine::playEffectAdvanced @ 0x140057047\n// > FMODAudioEngine::setChannelVolume @ 0x140058f28\n// > FMODAudioEngine::setChannelVolume @ 0x140058f58\n// > FMODAudioEngine::setChannelVolumeMod @ 0x1400590f8\n// > FMODAudioEngine::setChannelVolumeMod @ 0x140059128\n// > FMODAudioEngine::setChannelPitch @ 0x140059261\n// > FMODAudioEngine::isMusicPlaying_1 @ 0x140059d77\n// > FMODAudioEngine::stopAllMusic @ 0x140059e75\n// > FMODAudioEngine::resumeAllMusic @ 0x140059edc\n// > FMODAudioEngine::loadAndPlayMusic @ 0x14005a0fc\n// > FMODAudioEngine::playMusic @ 0x14005a20e\n// > FMODAudioEngine::playMusic @ 0x14005a273\n// > FMODAudioEngine::loadMusic @ 0x14005a39c\n// > FMODAudioEngine::startMusic @ 0x14005a6a4\n// > FMODAudioEngine::updateQueuedMusic @ 0x14005b81c\n// > FMODAudioEngine::setMusicTimeMS @ 0x14005c1fb\n// > FMODAudioEngine::getMusicTimeMS @ 0x14005c335\n// > FMODAudioEngine::getMusicLengthMS @ 0x14005c39b\n// > FMODAudioEngine::fadeInMusic @ 0x14005c44b\n// > FMODAudioEngine::fadeOutMusic @ 0x14005c58b\n// > FMODAudioEngine::fadeMusic @ 0x14005c6d3\n// > FMODAudioEngine::stopAndRemoveMusic @ 0x14005cafa\n// > AppDelegate::pauseSound @ 0x1400831d6\n// > GJBaseGameLayer::pauseAudio @ 0x140237586\n// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140243c1e\n// > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244bad\n// > GJBaseGameLayer::processSongState @ 0x140245c54\n// > PlayLayer::showCompleteEffect @ 0x1403a948b\n// > PlayLayer::destroyPlayer @ 0x1403b3fde\n// > PlayLayer::loadFromCheckpoint @ 0x1403b7720\n// > PlayLayer::resetLevel @ 0x1403b901c\n// > <???> @ 0x1406c5148\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  char *v3; // rcx\n  FMOD::Channel *result; // rax\n  FMOD::Channel *v5; // rcx\n  _BYTE v6[24]; // [rsp+20h] [rbp-18h] BYREF\n  int v7; // [rsp+48h] [rbp+10h] BYREF\n\n  v7 = a2;\n  v3 = (char *)a1->m_channelIDToChannel._Vec._Mypair._Myval2._Myfirst\n     + 16\n     * ((0x100000001B3LL\n       * (HIBYTE(a2)\n        ^ (0x100000001B3LL\n         * (BYTE2(a2)\n          ^ (0x100000001B3LL * (BYTE1(a2) ^ (0x100000001B3LL * ((unsigned __int8)a2 ^ 0xCBF29CE484222325uLL))))))))\n      & a1->m_channelIDToChannel._Mask);\n  result = *((FMOD::Channel **)v3 + 1);\n  if ( result != (FMOD::Channel *)a1->m_channelIDToChannel._List._Mypair._Myval2._Myhead )\n  {\n    v5 = *(FMOD::Channel **)v3;\n    if ( a2 == *(_DWORD *)&result[16].FMOD::ChannelControl )\n      goto LABEL_7;\n    while ( result != v5 )\n    {\n      result = *(FMOD::Channel **)&result[8].FMOD::ChannelControl;\n      if ( a2 == *(_DWORD *)&result[16].FMOD::ChannelControl )\n        goto LABEL_7;\n    }\n  }\n  result = nullptr;\nLABEL_7:\n  if ( result )\n    return *(FMOD::Channel **)(*(_QWORD *)sub_140060FD0(&a1->m_channelIDToChannel, v6, &v7) + 24LL);\n  return result;\n}", "assembly": "; \n; FMODAudioEngine::channelForChannelID from 0x1400584b0 to 0x140058566 (182 bytes)\n; \n; 34 xrefs:\n; > FMODAudioEngine::saveAudioState @ 0x140055a3f\n; > FMODAudioEngine::loadAudioState @ 0x1400560ac\n; > FMODAudioEngine::playEffectAdvanced @ 0x140057047\n; > FMODAudioEngine::setChannelVolume @ 0x140058f28\n; > FMODAudioEngine::setChannelVolume @ 0x140058f58\n; > FMODAudioEngine::setChannelVolumeMod @ 0x1400590f8\n; > FMODAudioEngine::setChannelVolumeMod @ 0x140059128\n; > FMODAudioEngine::setChannelPitch @ 0x140059261\n; > FMODAudioEngine::isMusicPlaying_1 @ 0x140059d77\n; > FMODAudioEngine::stopAllMusic @ 0x140059e75\n; > FMODAudioEngine::resumeAllMusic @ 0x140059edc\n; > FMODAudioEngine::loadAndPlayMusic @ 0x14005a0fc\n; > FMODAudioEngine::playMusic @ 0x14005a20e\n; > FMODAudioEngine::playMusic @ 0x14005a273\n; > FMODAudioEngine::loadMusic @ 0x14005a39c\n; > FMODAudioEngine::startMusic @ 0x14005a6a4\n; > FMODAudioEngine::updateQueuedMusic @ 0x14005b81c\n; > FMODAudioEngine::setMusicTimeMS @ 0x14005c1fb\n; > FMODAudioEngine::getMusicTimeMS @ 0x14005c335\n; > FMODAudioEngine::getMusicLengthMS @ 0x14005c39b\n; > FMODAudioEngine::fadeInMusic @ 0x14005c44b\n; > FMODAudioEngine::fadeOutMusic @ 0x14005c58b\n; > FMODAudioEngine::fadeMusic @ 0x14005c6d3\n; > FMODAudioEngine::stopAndRemoveMusic @ 0x14005cafa\n; > AppDelegate::pauseSound @ 0x1400831d6\n; > GJBaseGameLayer::pauseAudio @ 0x140237586\n; > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140243c1e\n; > GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244bad\n; > GJBaseGameLayer::processSongState @ 0x140245c54\n; > PlayLayer::showCompleteEffect @ 0x1403a948b\n; > PlayLayer::destroyPlayer @ 0x1403b3fde\n; > PlayLayer::loadFromCheckpoint @ 0x1403b7720\n; > PlayLayer::resetLevel @ 0x1403b901c\n; > <???> @ 0x1406c5148\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\nmov     [rsp+arg_8], edx                                               ; +0x0, 0x1400584b0\nsub     rsp, 38h                                                       ; +0x4, 0x1400584b4\nmov     r9, rcx                                                        ; +0x8, 0x1400584b8\nmovzx   r8d, dl                                                        ; +0xb, 0x1400584bb\nmov     rcx, 100000001B3h                                              ; +0xf, 0x1400584bf\nmov     rax, 0CBF29CE484222325h                                        ; +0x19, 0x1400584c9\nxor     r8, rax                                                        ; +0x23, 0x1400584d3\nmovzx   eax, byte ptr [rsp+38h+arg_8+1]                                ; +0x26, 0x1400584d6\nimul    r8, rcx                                                        ; +0x2b, 0x1400584db\nxor     r8, rax                                                        ; +0x2f, 0x1400584df\nmovzx   eax, byte ptr [rsp+38h+arg_8+2]                                ; +0x32, 0x1400584e2\nimul    r8, rcx                                                        ; +0x37, 0x1400584e7\nxor     r8, rax                                                        ; +0x3b, 0x1400584eb\nmovzx   eax, byte ptr [rsp+38h+arg_8+3]                                ; +0x3e, 0x1400584ee\nimul    r8, rcx                                                        ; +0x43, 0x1400584f3\nxor     r8, rax                                                        ; +0x47, 0x1400584f7\nimul    r8, rcx                                                        ; +0x4a, 0x1400584fa\nmov     rcx, [r9+678h]                                                 ; +0x4e, 0x1400584fe\nand     rcx, r8                                                        ; +0x55, 0x140058505\nshl     rcx, 4                                                         ; +0x58, 0x140058508\nadd     rcx, [r9+660h]                                                 ; +0x5c, 0x14005850c\nmov     rax, [rcx+8]                                                   ; +0x63, 0x140058513\ncmp     rax, [r9+650h]                                                 ; +0x67, 0x140058517\njz      short loc_140058538                                            ; +0x6e, 0x14005851e\nmov     rcx, [rcx]                                                     ; +0x70, 0x140058520\ncmp     edx, [rax+10h]                                                 ; +0x73, 0x140058523\njz      short loc_14005853A                                            ; +0x76, 0x140058526\ncmp     rax, rcx                                                       ; +0x78, 0x140058528\njz      short loc_140058538                                            ; +0x7b, 0x14005852b\nmov     rax, [rax+8]                                                   ; +0x7d, 0x14005852d\ncmp     edx, [rax+10h]                                                 ; +0x81, 0x140058531\njnz     short loc_140058528                                            ; +0x84, 0x140058534\njmp     short loc_14005853A                                            ; +0x86, 0x140058536\nxor     eax, eax                                                       ; +0x88, 0x140058538\ntest    rax, rax                                                       ; +0x8a, 0x14005853a\njz      short loc_140058561                                            ; +0x8d, 0x14005853d\nlea     rcx, [r9+648h]                                                 ; +0x8f, 0x14005853f\nlea     r8, [rsp+38h+arg_8]                                            ; +0x96, 0x140058546\nlea     rdx, [rsp+38h+var_18]                                          ; +0x9b, 0x14005854b\ncall    sub_140060FD0                                                  ; +0xa0, 0x140058550\nmov     rax, [rax]                                                     ; +0xa5, 0x140058555\nmov     rax, [rax+18h]                                                 ; +0xa8, 0x140058558\nadd     rsp, 38h                                                       ; +0xac, 0x14005855c\nretn                                                                   ; +0xb0, 0x140058560\nadd     rsp, 38h                                                       ; +0xb1, 0x140058561\nretn                                                                   ; +0xb5, 0x140058565", "xrefs": ["FMODAudioEngine::saveAudioState @ 0x140055a3f", "FMODAudioEngine::loadAudioState @ 0x1400560ac", "FMODAudioEngine::playEffectAdvanced @ 0x140057047", "FMODAudioEngine::setChannelVolume @ 0x140058f28", "FMODAudioEngine::setChannelVolume @ 0x140058f58", "FMODAudioEngine::setChannelVolumeMod @ 0x1400590f8", "FMODAudioEngine::setChannelVolumeMod @ 0x140059128", "FMODAudioEngine::setChannelPitch @ 0x140059261", "FMODAudioEngine::isMusicPlaying_1 @ 0x140059d77", "FMODAudioEngine::stopAllMusic @ 0x140059e75", "FMODAudioEngine::resumeAllMusic @ 0x140059edc", "FMODAudioEngine::loadAndPlayMusic @ 0x14005a0fc", "FMODAudioEngine::playMusic @ 0x14005a20e", "FMODAudioEngine::playMusic @ 0x14005a273", "FMODAudioEngine::loadMusic @ 0x14005a39c", "FMODAudioEngine::startMusic @ 0x14005a6a4", "FMODAudioEngine::updateQueuedMusic @ 0x14005b81c", "FMODAudioEngine::setMusicTimeMS @ 0x14005c1fb", "FMODAudioEngine::getMusicTimeMS @ 0x14005c335", "FMODAudioEngine::getMusicLengthMS @ 0x14005c39b", "FMODAudioEngine::fadeInMusic @ 0x14005c44b", "FMODAudioEngine::fadeOutMusic @ 0x14005c58b", "FMODAudioEngine::fadeMusic @ 0x14005c6d3", "FMODAudioEngine::stopAndRemoveMusic @ 0x14005cafa", "AppDelegate::pauseSound @ 0x1400831d6", "GJBaseGameLayer::pauseAudio @ 0x140237586", "GJBaseGameLayer::processActivatedAudioTriggers @ 0x140243c1e", "GJBaseGameLayer::processActivatedAudioTriggers @ 0x140244bad", "GJBaseGameLayer::processSongState @ 0x140245c54", "PlayLayer::showCompleteEffect @ 0x1403a948b", "PlayLayer::destroyPlayer @ 0x1403b3fde", "PlayLayer::loadFromCheckpoint @ 0x1403b7720", "PlayLayer::resetLevel @ 0x1403b901c", "<???> @ 0x1406c5148"], "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"}