{"type": "func", "start": 5369076224, "end": 5369076422, "name": "FMODAudioEngine::lengthForSound", "pseudocode": "// \n// FMODAudioEngine::lengthForSound from 0x140059a00 to 0x140059ac6 (198 bytes)\n// \n// 3 xrefs:\n// > SetupSFXPopup::onClose @ 0x14044877d\n// > SetupSFXPopup::createSFXWidget @ 0x140448af8\n// > <???> @ 0x1406c5250\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\n// Hidden C++ exception states: #wind=1\n__int64 __fastcall FMODAudioEngine::lengthForSound(__int64 a1, _QWORD *a2)\n{\n  __int64 v2; // rdi\n  __int64 v4; // r9\n  unsigned __int64 v5; // r8\n  unsigned __int64 i; // rcx\n  unsigned int v7; // ebx\n  _BYTE v9[16]; // [rsp+20h] [rbp-28h] BYREF\n  _QWORD *v10; // [rsp+30h] [rbp-18h]\n\n  v2 = (__int64)a2;\n  v10 = a2;\n  if ( a2[3] > 0xFu )\n    a2 = (_QWORD *)*a2;\n  v4 = 0xCBF29CE484222325uLL;\n  v5 = *(_QWORD *)(v2 + 16);\n  for ( i = 0; i < v5; ++i )\n    v4 = 0x100000001B3LL * (*((unsigned __int8 *)a2 + i) ^ (unsigned __int64)v4);\n  if ( *(_QWORD *)(sub_140063040(a1 + 384, v9, v2, v4) + 8) )\n  {\n    v7 = *(_DWORD *)(*(_QWORD *)sub_1400612C0(a1 + 384, v9, v2) + 88LL);\n    sub_14003A830(v2);\n    return v7;\n  }\n  else\n  {\n    sub_14003A830(v2);\n    return 0;\n  }\n}", "assembly": "; \n; FMODAudioEngine::lengthForSound from 0x140059a00 to 0x140059ac6 (198 bytes)\n; \n; 3 xrefs:\n; > SetupSFXPopup::onClose @ 0x14044877d\n; > SetupSFXPopup::createSFXWidget @ 0x140448af8\n; > <???> @ 0x1406c5250\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_10], rbx                                              ; +0x0, 0x140059a00\npush    rdi                                                            ; +0x5, 0x140059a05\nsub     rsp, 40h                                                       ; +0x6, 0x140059a06\nmov     rax, cs:__security_cookie                                      ; +0xa, 0x140059a0a\nxor     rax, rsp                                                       ; +0x11, 0x140059a11\nmov     [rsp+48h+var_10], rax                                          ; +0x14, 0x140059a14\nmov     rdi, rdx                                                       ; +0x19, 0x140059a19\nmov     rbx, rcx                                                       ; +0x1c, 0x140059a1c\nmov     [rsp+48h+var_18], rdx                                          ; +0x1f, 0x140059a1f\ncmp     qword ptr [rdx+18h], 0Fh                                       ; +0x24, 0x140059a24\njbe     short loc_140059A2E                                            ; +0x29, 0x140059a29\nmov     rdx, [rdx]                                                     ; +0x2b, 0x140059a2b\nmov     r9, 0CBF29CE484222325h                                         ; +0x2e, 0x140059a2e\nmov     r8, [rdi+10h]                                                  ; +0x38, 0x140059a38\nxor     ecx, ecx                                                       ; +0x3c, 0x140059a3c\ntest    r8, r8                                                         ; +0x3e, 0x140059a3e\njz      short loc_140059A63                                            ; +0x41, 0x140059a41\nmov     r10, 100000001B3h                                              ; +0x43, 0x140059a43\nnop     dword ptr [rax]                                                ; +0x4d, 0x140059a4d\nmovzx   eax, byte ptr [rcx+rdx]                                        ; +0x50, 0x140059a50\nxor     r9, rax                                                        ; +0x54, 0x140059a54\nimul    r9, r10                                                        ; +0x57, 0x140059a57\ninc     rcx                                                            ; +0x5b, 0x140059a5b\ncmp     rcx, r8                                                        ; +0x5e, 0x140059a5e\njb      short loc_140059A50                                            ; +0x61, 0x140059a61\nmov     r8, rdi                                                        ; +0x63, 0x140059a63\nlea     rdx, [rsp+48h+var_28]                                          ; +0x66, 0x140059a66\nlea     rcx, [rbx+180h]                                                ; +0x6b, 0x140059a6b\ncall    sub_140063040                                                  ; +0x72, 0x140059a72\ncmp     qword ptr [rax+8], 0                                           ; +0x77, 0x140059a77\njz      short loc_140059AA4                                            ; +0x7c, 0x140059a7c\nmov     r8, rdi                                                        ; +0x7e, 0x140059a7e\nlea     rdx, [rsp+48h+var_28]                                          ; +0x81, 0x140059a81\nlea     rcx, [rbx+180h]                                                ; +0x86, 0x140059a86\ncall    sub_1400612C0                                                  ; +0x8d, 0x140059a8d\nmov     rdx, [rax]                                                     ; +0x92, 0x140059a92\nmov     ebx, [rdx+58h]                                                 ; +0x95, 0x140059a95\nmov     rcx, rdi                                                       ; +0x98, 0x140059a98\ncall    sub_14003A830                                                  ; +0x9b, 0x140059a9b\nmov     eax, ebx                                                       ; +0xa0, 0x140059aa0\njmp     short loc_140059AAE                                            ; +0xa2, 0x140059aa2\nmov     rcx, rdi                                                       ; +0xa4, 0x140059aa4\ncall    sub_14003A830                                                  ; +0xa7, 0x140059aa7\nxor     eax, eax                                                       ; +0xac, 0x140059aac\nmov     rcx, [rsp+48h+var_10]                                          ; +0xae, 0x140059aae\nxor     rcx, rsp; StackCookie                                          ; +0xb3, 0x140059ab3\ncall    __security_check_cookie                                        ; +0xb6, 0x140059ab6\nmov     rbx, [rsp+48h+arg_10]                                          ; +0xbb, 0x140059abb\nadd     rsp, 40h                                                       ; +0xc0, 0x140059ac0\npop     rdi                                                            ; +0xc4, 0x140059ac4\nretn                                                                   ; +0xc5, 0x140059ac5", "xrefs": ["SetupSFXPopup::onClose @ 0x14044877d", "SetupSFXPopup::createSFXWidget @ 0x140448af8", "<???> @ 0x1406c5250"], "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"}