{"type": "func", "start": 5369068320, "end": 5369068621, "name": "FMODAudioEngine::registerChannel", "pseudocode": "// \n// FMODAudioEngine::registerChannel from 0x140057b20 to 0x140057c4d (301 bytes)\n// \n// 3 xrefs:\n// > FMODAudioEngine::playEffectAdvanced @ 0x140057777\n// > FMODAudioEngine::loadMusic @ 0x14005a3f0\n// > <???> @ 0x1406c510c\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\nint FMODAudioEngine::registerChannel(FMODAudioEngine *a1, FMOD::Channel *a2, int a3, int a4)\n{\n  __int64 v6; // rax\n  __int64 v7; // rax\n  __int64 v8; // rax\n  __int64 v9; // rax\n  _BYTE v11[16]; // [rsp+20h] [rbp-10h] BYREF\n  int v12; // [rsp+50h] [rbp+20h] BYREF\n  int v13; // [rsp+58h] [rbp+28h] BYREF\n  int v14; // [rsp+60h] [rbp+30h] BYREF\n  int v15; // [rsp+68h] [rbp+38h] BYREF\n\n  v15 = a4;\n  v14 = a3;\n  if ( !a3 )\n  {\n    a3 = dword_1406BA0E4;\n    v14 = dword_1406BA0E4++;\n  }\n  FMOD::ChannelControl::setUserData(a2, (void *)a3);\n  *(_QWORD *)(*(_QWORD *)sub_140060FD0(&a1->m_channelIDToChannel, v11, &v14) + 24LL) = a2;\n  v12 = 0;\n  FMOD::ChannelControl::getVolume(a2, (float *)&v12);\n  v6 = sub_140060B20(&a1->m_audioState.m_volumeForEffectChannels, v11, &v14);\n  *(_DWORD *)(*(_QWORD *)v6 + 20LL) = v12;\n  *(_DWORD *)(*(_QWORD *)sub_140060B20(&a1->m_audioState.m_volumeModForEffectChannels, v11, &v14) + 20LL) = 1065353216;\n  v13 = 0;\n  FMOD::ChannelControl::getPitch(a2, (float *)&v13);\n  v7 = sub_140060B20(&a1->m_audioState.m_pitchForEffectChannels, v11, &v14);\n  *(_DWORD *)(*(_QWORD *)v7 + 20LL) = v13;\n  if ( v15 )\n  {\n    v8 = sub_140060B20(&a1->m_channelIDToEffectID, v11, &v14);\n    *(_DWORD *)(*(_QWORD *)v8 + 20LL) = v15;\n    v9 = sub_140060B20(&a1->m_effectIDToChannelID, v11, &v15);\n    *(_DWORD *)(*(_QWORD *)v9 + 20LL) = v14;\n  }\n  return v14;\n}", "assembly": "; \n; FMODAudioEngine::registerChannel from 0x140057b20 to 0x140057c4d (301 bytes)\n; \n; 3 xrefs:\n; > FMODAudioEngine::playEffectAdvanced @ 0x140057777\n; > FMODAudioEngine::loadMusic @ 0x14005a3f0\n; > <???> @ 0x1406c510c\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-18h+arg_18], r9d                                          ; +0x0, 0x140057b20\nmov     [rsp-18h+arg_10], r8d                                          ; +0x5, 0x140057b25\npush    rbp                                                            ; +0xa, 0x140057b2a\npush    rbx                                                            ; +0xb, 0x140057b2b\npush    rdi                                                            ; +0xc, 0x140057b2c\nmov     rbp, rsp                                                       ; +0xd, 0x140057b2d\nsub     rsp, 30h                                                       ; +0x10, 0x140057b30\nmov     rdi, rdx                                                       ; +0x14, 0x140057b34\nmov     rbx, rcx                                                       ; +0x17, 0x140057b37\ntest    r8d, r8d                                                       ; +0x1a, 0x140057b3a\njnz     short loc_140057B53                                            ; +0x1d, 0x140057b3d\nmov     eax, cs:dword_1406BA0E4                                        ; +0x1f, 0x140057b3f\nmov     r8d, eax                                                       ; +0x25, 0x140057b45\nmov     [rbp+arg_10], eax                                              ; +0x28, 0x140057b48\ninc     eax                                                            ; +0x2b, 0x140057b4b\nmov     cs:dword_1406BA0E4, eax                                        ; +0x2d, 0x140057b4d\nmovsxd  rdx, r8d                                                       ; +0x33, 0x140057b53\nmov     rcx, rdi                                                       ; +0x36, 0x140057b56\ncall    cs:?setUserData@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@PEAX@Z; FMOD::ChannelControl::setUserData(void *) ; +0x39, 0x140057b59\nlea     rcx, [rbx+648h]                                                ; +0x3f, 0x140057b5f\nlea     r8, [rbp+arg_10]                                               ; +0x46, 0x140057b66\nlea     rdx, [rbp+var_10]                                              ; +0x4a, 0x140057b6a\ncall    sub_140060FD0                                                  ; +0x4e, 0x140057b6e\nlea     rdx, [rbp+arg_0]                                               ; +0x53, 0x140057b73\nmov     rcx, [rax]                                                     ; +0x57, 0x140057b77\nmov     [rcx+18h], rdi                                                 ; +0x5a, 0x140057b7a\nmov     rcx, rdi                                                       ; +0x5e, 0x140057b7e\nmov     [rbp+arg_0], 0                                                 ; +0x61, 0x140057b81\ncall    cs:?getVolume@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@PEAM@Z; FMOD::ChannelControl::getVolume(float *) ; +0x68, 0x140057b88\nlea     rcx, [rbx+2A8h]                                                ; +0x6e, 0x140057b8e\nlea     r8, [rbp+arg_10]                                               ; +0x75, 0x140057b95\nlea     rdx, [rbp+var_10]                                              ; +0x79, 0x140057b99\ncall    sub_140060B20                                                  ; +0x7d, 0x140057b9d\nmovss   xmm0, [rbp+arg_0]                                              ; +0x82, 0x140057ba2\nlea     r8, [rbp+arg_10]                                               ; +0x87, 0x140057ba7\nlea     rdx, [rbp+var_10]                                              ; +0x8b, 0x140057bab\nmov     rcx, [rax]                                                     ; +0x8f, 0x140057baf\nmovss   dword ptr [rcx+14h], xmm0                                      ; +0x92, 0x140057bb2\nlea     rcx, [rbx+2E8h]                                                ; +0x97, 0x140057bb7\ncall    sub_140060B20                                                  ; +0x9e, 0x140057bbe\nlea     rdx, [rbp+arg_8]                                               ; +0xa3, 0x140057bc3\nmov     rcx, [rax]                                                     ; +0xa7, 0x140057bc7\nmov     dword ptr [rcx+14h], 3F800000h                                 ; +0xaa, 0x140057bca\nmov     rcx, rdi                                                       ; +0xb1, 0x140057bd1\nmov     [rbp+arg_8], 0                                                 ; +0xb4, 0x140057bd4\ncall    cs:?getPitch@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@PEAM@Z; FMOD::ChannelControl::getPitch(float *) ; +0xbb, 0x140057bdb\nlea     rcx, [rbx+328h]                                                ; +0xc1, 0x140057be1\nlea     r8, [rbp+arg_10]                                               ; +0xc8, 0x140057be8\nlea     rdx, [rbp+var_10]                                              ; +0xcc, 0x140057bec\ncall    sub_140060B20                                                  ; +0xd0, 0x140057bf0\nmovss   xmm0, [rbp+arg_8]                                              ; +0xd5, 0x140057bf5\nmov     rcx, [rax]                                                     ; +0xda, 0x140057bfa\nmovss   dword ptr [rcx+14h], xmm0                                      ; +0xdd, 0x140057bfd\ncmp     [rbp+arg_18], 0                                                ; +0xe2, 0x140057c02\njz      short loc_140057C42                                            ; +0xe6, 0x140057c06\nlea     rcx, [rbx+6D0h]                                                ; +0xe8, 0x140057c08\nlea     r8, [rbp+arg_10]                                               ; +0xef, 0x140057c0f\nlea     rdx, [rbp+var_10]                                              ; +0xf3, 0x140057c13\ncall    sub_140060B20                                                  ; +0xf7, 0x140057c17\nlea     r8, [rbp+arg_18]                                               ; +0xfc, 0x140057c1c\nlea     rdx, [rbp+var_10]                                              ; +0x100, 0x140057c20\nmov     rcx, [rax]                                                     ; +0x104, 0x140057c24\nmov     eax, [rbp+arg_18]                                              ; +0x107, 0x140057c27\nmov     [rcx+14h], eax                                                 ; +0x10a, 0x140057c2a\nlea     rcx, [rbx+710h]                                                ; +0x10d, 0x140057c2d\ncall    sub_140060B20                                                  ; +0x114, 0x140057c34\nmov     rcx, [rax]                                                     ; +0x119, 0x140057c39\nmov     eax, [rbp+arg_10]                                              ; +0x11c, 0x140057c3c\nmov     [rcx+14h], eax                                                 ; +0x11f, 0x140057c3f\nmov     eax, [rbp+arg_10]                                              ; +0x122, 0x140057c42\nadd     rsp, 30h                                                       ; +0x125, 0x140057c45\npop     rdi                                                            ; +0x129, 0x140057c49\npop     rbx                                                            ; +0x12a, 0x140057c4a\npop     rbp                                                            ; +0x12b, 0x140057c4b\nretn                                                                   ; +0x12c, 0x140057c4c", "xrefs": ["FMODAudioEngine::playEffectAdvanced @ 0x140057777", "FMODAudioEngine::loadMusic @ 0x14005a3f0", "<???> @ 0x1406c510c"], "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"}