{"type": "func", "start": 5372415168, "end": 5372415693, "name": "GJKeybindManager::handleGlobalAudioAction", "pseudocode": "// \n// GJKeybindManager::handleGlobalAudioAction from 0x140388cc0 to 0x140388ecd (525 bytes)\n// \n// 2 xrefs:\n// > GJKeybindManager::handleGlobalAction @ 0x140388316\n// > <???> @ 0x140922cdc\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:31:08 +0000\n// \n\n// Hidden C++ exception states: #wind=6\nbool __fastcall GJKeybindManager::handleGlobalAudioAction(int a1, char a2)\n{\n  bool v3; // si\n  bool result; // al\n  __int64 v5; // rbx\n  float v6; // xmm0_4\n  int v7; // eax\n  int v8; // ecx\n  float v9; // xmm6_4\n  __int64 v10; // rcx\n  __int64 v11; // rcx\n  __int64 v12; // rcx\n  void (__fastcall ***v13)(_QWORD); // rcx\n  const char *v14; // rcx\n  void *v15; // [rsp+50h] [rbp+18h]\n  void *v16; // [rsp+50h] [rbp+18h]\n  void *v17; // [rsp+50h] [rbp+18h]\n\n  v3 = (unsigned int)(a1 - 1001) <= 1;\n  result = (unsigned int)(a1 - 1004) <= 1;\n  if ( (unsigned int)(a1 - 1001) <= 1 || (unsigned int)(a1 - 1004) <= 1 )\n  {\n    if ( a2 )\n    {\n      v5 = qword_14090BF60;\n      if ( (unsigned int)(a1 - 1001) > 1 )\n      {\n        if ( !qword_14090BF60 )\n        {\n          v16 = operator new(0x8A8u);\n          qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v16);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);\n          v5 = qword_14090BF60;\n        }\n        v6 = *(float *)(v5 + 516);\n      }\n      else\n      {\n        if ( !qword_14090BF60 )\n        {\n          v15 = operator new(0x8A8u);\n          qword_14090BF60 = FMODAudioEngine::FMODAudioEngine((__int64)v15);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BF60 + 72LL))(qword_14090BF60);\n          v5 = qword_14090BF60;\n        }\n        v6 = *(float *)(v5 + 512);\n      }\n      if ( a1 == 1001 || (v7 = -10, a1 == 1004) )\n        v7 = 10;\n      v8 = v7 + (int)(float)((float)(v6 * 100.0) + 0.5);\n      if ( v8 >= 0 )\n      {\n        if ( v8 > 100 )\n          v8 = 100;\n      }\n      else\n      {\n        v8 = 0;\n      }\n      v9 = (float)(10 * ((v8 + 5) / 10)) / 100.0;\n      if ( v3 )\n      {\n        *(_DWORD *)(v5 + 524) = 0;\n        *(float *)(v5 + 512) = v9;\n        v10 = *(_QWORD *)(v5 + 552);\n      }\n      else\n      {\n        *(float *)(v5 + 516) = v9;\n        v11 = *(_QWORD *)(v5 + 584);\n        if ( v11 )\n          FMOD::ChannelControl::setVolume(v11);\n        v10 = *(_QWORD *)(v5 + 600);\n      }\n      if ( v10 )\n        FMOD::ChannelControl::setVolume(v10);\n      v12 = qword_14090BFD0;\n      if ( !qword_14090BFD0 )\n      {\n        v17 = operator new(0x6E8u);\n        qword_14090BFD0 = GameManager::GameManager((__int64)v17);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n        v12 = qword_14090BFD0;\n      }\n      v13 = *(void (__fastcall ****)(_QWORD))(v12 + 984);\n      if ( v13 )\n        (**v13)(v13);\n      v14 = \"SFX\";\n      if ( v3 )\n        v14 = \"Music\";\n      sub_140388AA0(v14, v9);\n    }\n    return 1;\n  }\n  return result;\n}", "assembly": "; \n; GJKeybindManager::handleGlobalAudioAction from 0x140388cc0 to 0x140388ecd (525 bytes)\n; \n; 2 xrefs:\n; > GJKeybindManager::handleGlobalAction @ 0x140388316\n; > <???> @ 0x140922cdc\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:31:08 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x140388cc0\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x140388cc5\npush    rdi                                                            ; +0xa, 0x140388cca\nsub     rsp, 30h                                                       ; +0xb, 0x140388ccb\nmovaps  [rsp+38h+var_18], xmm6                                         ; +0xf, 0x140388ccf\nmov     edi, ecx                                                       ; +0x14, 0x140388cd4\nlea     eax, [rcx-3E9h]                                                ; +0x16, 0x140388cd6\ncmp     eax, 1                                                         ; +0x1c, 0x140388cdc\nsetbe   sil                                                            ; +0x1f, 0x140388cdf\nlea     eax, [rcx-3ECh]                                                ; +0x23, 0x140388ce3\ncmp     eax, 1                                                         ; +0x29, 0x140388ce9\nsetbe   al                                                             ; +0x2c, 0x140388cec\ntest    sil, sil                                                       ; +0x2f, 0x140388cef\njnz     short loc_140388CFC                                            ; +0x32, 0x140388cf2\ntest    al, al                                                         ; +0x34, 0x140388cf4\njz      loc_140388EB8                                                  ; +0x36, 0x140388cf6\ntest    dl, dl                                                         ; +0x3c, 0x140388cfc\njz      loc_140388EB6                                                  ; +0x3e, 0x140388cfe\nmov     rbx, cs:qword_14090BF60                                        ; +0x44, 0x140388d04\ntest    sil, sil                                                       ; +0x4b, 0x140388d0b\njz      short loc_140388D51                                            ; +0x4e, 0x140388d0e\ntest    rbx, rbx                                                       ; +0x50, 0x140388d10\njnz     short loc_140388D47                                            ; +0x53, 0x140388d13\nmov     ecx, 8A8h; Size                                                ; +0x55, 0x140388d15\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x5a, 0x140388d1a\nmov     [rsp+38h+arg_10], rax                                          ; +0x5f, 0x140388d1f\nmov     rcx, rax                                                       ; +0x64, 0x140388d24\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x67, 0x140388d27\nnop                                                                    ; +0x6c, 0x140388d2c\nmov     cs:qword_14090BF60, rax                                        ; +0x6d, 0x140388d2d\nmov     rcx, [rax]                                                     ; +0x74, 0x140388d34\nmov     rdx, [rcx+48h]                                                 ; +0x77, 0x140388d37\nmov     rcx, rax                                                       ; +0x7b, 0x140388d3b\ncall    rdx                                                            ; +0x7e, 0x140388d3e\nmov     rbx, cs:qword_14090BF60                                        ; +0x80, 0x140388d40\nmovss   xmm0, dword ptr [rbx+200h]                                     ; +0x87, 0x140388d47\njmp     short loc_140388D90                                            ; +0x8f, 0x140388d4f\ntest    rbx, rbx                                                       ; +0x91, 0x140388d51\njnz     short loc_140388D88                                            ; +0x94, 0x140388d54\nmov     ecx, 8A8h; Size                                                ; +0x96, 0x140388d56\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x9b, 0x140388d5b\nmov     [rsp+38h+arg_10], rax                                          ; +0xa0, 0x140388d60\nmov     rcx, rax                                                       ; +0xa5, 0x140388d65\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0xa8, 0x140388d68\nnop                                                                    ; +0xad, 0x140388d6d\nmov     cs:qword_14090BF60, rax                                        ; +0xae, 0x140388d6e\nmov     rcx, [rax]                                                     ; +0xb5, 0x140388d75\nmov     rdx, [rcx+48h]                                                 ; +0xb8, 0x140388d78\nmov     rcx, rax                                                       ; +0xbc, 0x140388d7c\ncall    rdx                                                            ; +0xbf, 0x140388d7f\nmov     rbx, cs:qword_14090BF60                                        ; +0xc1, 0x140388d81\nmovss   xmm0, dword ptr [rbx+204h]                                     ; +0xc8, 0x140388d88\nmovss   xmm1, cs:dword_1408357B0                                       ; +0xd0, 0x140388d90\nmulss   xmm0, xmm1                                                     ; +0xd8, 0x140388d98\naddss   xmm0, cs:dword_140834F20                                       ; +0xdc, 0x140388d9c\ncvttss2si ecx, xmm0                                                    ; +0xe4, 0x140388da4\ncmp     edi, 3E9h                                                      ; +0xe8, 0x140388da8\njz      short loc_140388DBD                                            ; +0xee, 0x140388dae\ncmp     edi, 3ECh                                                      ; +0xf0, 0x140388db0\nmov     eax, 0FFFFFFF6h                                                ; +0xf6, 0x140388db6\njnz     short loc_140388DC2                                            ; +0xfb, 0x140388dbb\nmov     eax, 0Ah                                                       ; +0xfd, 0x140388dbd\nadd     ecx, eax                                                       ; +0x102, 0x140388dc2\njns     short loc_140388DCA                                            ; +0x104, 0x140388dc4\nxor     ecx, ecx                                                       ; +0x106, 0x140388dc6\njmp     short loc_140388DD4                                            ; +0x108, 0x140388dc8\nmov     eax, 64h ; 'd'                                                 ; +0x10a, 0x140388dca\ncmp     ecx, eax                                                       ; +0x10f, 0x140388dcf\ncmovg   ecx, eax                                                       ; +0x111, 0x140388dd1\nadd     ecx, 5                                                         ; +0x114, 0x140388dd4\nmov     eax, 66666667h                                                 ; +0x117, 0x140388dd7\nimul    ecx                                                            ; +0x11c, 0x140388ddc\nsar     edx, 2                                                         ; +0x11e, 0x140388dde\nmov     eax, edx                                                       ; +0x121, 0x140388de1\nshr     eax, 1Fh                                                       ; +0x123, 0x140388de3\nadd     edx, eax                                                       ; +0x126, 0x140388de6\nlea     eax, [rdx+rdx*4]                                               ; +0x128, 0x140388de8\nadd     eax, eax                                                       ; +0x12b, 0x140388deb\nmovd    xmm6, eax                                                      ; +0x12d, 0x140388ded\ncvtdq2ps xmm6, xmm6                                                    ; +0x131, 0x140388df1\ndivss   xmm6, xmm1                                                     ; +0x134, 0x140388df4\ntest    sil, sil                                                       ; +0x138, 0x140388df8\njz      short loc_140388E18                                            ; +0x13b, 0x140388dfb\nmov     dword ptr [rbx+20Ch], 0                                        ; +0x13d, 0x140388dfd\nmovss   dword ptr [rbx+200h], xmm6                                     ; +0x147, 0x140388e07\nmov     rcx, [rbx+228h]                                                ; +0x14f, 0x140388e0f\njmp     short loc_140388E3C                                            ; +0x156, 0x140388e16\nmovss   dword ptr [rbx+204h], xmm6                                     ; +0x158, 0x140388e18\nmov     rcx, [rbx+248h]                                                ; +0x160, 0x140388e20\ntest    rcx, rcx                                                       ; +0x167, 0x140388e27\njz      short loc_140388E35                                            ; +0x16a, 0x140388e2a\nmovaps  xmm1, xmm6                                                     ; +0x16c, 0x140388e2c\ncall    cs:?setVolume@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@M@Z; FMOD::ChannelControl::setVolume(float) ; +0x16f, 0x140388e2f\nmov     rcx, [rbx+258h]                                                ; +0x175, 0x140388e35\ntest    rcx, rcx                                                       ; +0x17c, 0x140388e3c\njz      short loc_140388E4A                                            ; +0x17f, 0x140388e3f\nmovaps  xmm1, xmm6                                                     ; +0x181, 0x140388e41\ncall    cs:?setVolume@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@M@Z; FMOD::ChannelControl::setVolume(float) ; +0x184, 0x140388e44\nmov     rcx, cs:qword_14090BFD0                                        ; +0x18a, 0x140388e4a\ntest    rcx, rcx                                                       ; +0x191, 0x140388e51\njnz     short loc_140388E88                                            ; +0x194, 0x140388e54\nmov     ecx, 6E8h; Size                                                ; +0x196, 0x140388e56\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x19b, 0x140388e5b\nmov     [rsp+38h+arg_10], rax                                          ; +0x1a0, 0x140388e60\nmov     rcx, rax                                                       ; +0x1a5, 0x140388e65\ncall    GameManager__GameManager                                       ; +0x1a8, 0x140388e68\nnop                                                                    ; +0x1ad, 0x140388e6d\nmov     cs:qword_14090BFD0, rax                                        ; +0x1ae, 0x140388e6e\nmov     rcx, [rax]                                                     ; +0x1b5, 0x140388e75\nmov     rdx, [rcx+48h]                                                 ; +0x1b8, 0x140388e78\nmov     rcx, rax                                                       ; +0x1bc, 0x140388e7c\ncall    rdx                                                            ; +0x1bf, 0x140388e7f\nmov     rcx, cs:qword_14090BFD0                                        ; +0x1c1, 0x140388e81\nmov     rcx, [rcx+3D8h]                                                ; +0x1c8, 0x140388e88\ntest    rcx, rcx                                                       ; +0x1cf, 0x140388e8f\njz      short loc_140388E99                                            ; +0x1d2, 0x140388e92\nmov     rax, [rcx]                                                     ; +0x1d4, 0x140388e94\ncall    qword ptr [rax]                                                ; +0x1d7, 0x140388e97\nlea     rax, aMusic; \"Music\"                                           ; +0x1d9, 0x140388e99\nlea     rcx, aSfx; \"SFX\"                                               ; +0x1e0, 0x140388ea0\ntest    sil, sil                                                       ; +0x1e7, 0x140388ea7\ncmovnz  rcx, rax                                                       ; +0x1ea, 0x140388eaa\nmovaps  xmm1, xmm6                                                     ; +0x1ee, 0x140388eae\ncall    sub_140388AA0                                                  ; +0x1f1, 0x140388eb1\nmov     al, 1                                                          ; +0x1f6, 0x140388eb6\nmov     rbx, [rsp+38h+arg_8]                                           ; +0x1f8, 0x140388eb8\nmov     rsi, [rsp+38h+arg_18]                                          ; +0x1fd, 0x140388ebd\nmovaps  xmm6, [rsp+38h+var_18]                                         ; +0x202, 0x140388ec2\nadd     rsp, 30h                                                       ; +0x207, 0x140388ec7\npop     rdi                                                            ; +0x20b, 0x140388ecb\nretn                                                                   ; +0x20c, 0x140388ecc", "xrefs": ["GJKeybindManager::handleGlobalAction @ 0x140388316", "<???> @ 0x140922cdc"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}