{"type": "func", "start": 5371290944, "end": 5371291315, "name": "GameManager::getMenuMusicFile", "pseudocode": "// \n// GameManager::getMenuMusicFile from 0x140276540 to 0x1402766b3 (371 bytes)\n// \n// 4 xrefs:\n// > GameManager::playMenuMusic @ 0x1402767b9\n// > GameManager::fadeInMenuMusic @ 0x140276a18\n// > <???> @ 0x14091cd54\n// > <???> @ 0x14091cd60\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:28:56 +0000\n// \n\n// Hidden C++ exception states: #wind=3\n__int64 __fastcall GameManager::getMenuMusicFile(__int64 a1, __int64 a2)\n{\n  __int64 v4; // rcx\n  __int64 v5; // rcx\n  _QWORD *v6; // rax\n  size_t v7; // r8\n  void *v9; // [rsp+20h] [rbp-48h]\n  void *v10; // [rsp+20h] [rbp-48h]\n  _BYTE v11[32]; // [rsp+30h] [rbp-38h] BYREF\n\n  if ( *(int *)(a1 + 1164) > 0 )\n  {\n    v4 = qword_14090C070;\n    if ( !qword_14090C070 )\n    {\n      v9 = operator new(0x3D0u);\n      qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v9);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);\n      v4 = qword_14090C070;\n    }\n    if ( !(unsigned __int8)MusicDownloadManager::isSongDownloaded(v4, *(unsigned int *)(a1 + 1164)) )\n      *(_DWORD *)(a1 + 1164) = 0;\n  }\n  if ( *(int *)(a1 + 1164) <= 0 )\n  {\n    *(_OWORD *)a2 = 0;\n    *(_QWORD *)(a2 + 16) = 12;\n    *(_QWORD *)(a2 + 24) = 15;\n    strcpy((char *)a2, \"menuLoop.mp3\");\n  }\n  else\n  {\n    v5 = qword_14090C070;\n    if ( !qword_14090C070 )\n    {\n      v10 = operator new(0x3D0u);\n      qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v10);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);\n      v5 = qword_14090C070;\n    }\n    v6 = (_QWORD *)MusicDownloadManager::pathForSong(v5, v11, *(unsigned int *)(a1 + 1164));\n    if ( v6[3] > 0xFu )\n      v6 = (_QWORD *)*v6;\n    *(_OWORD *)a2 = 0;\n    *(_QWORD *)(a2 + 16) = 0;\n    *(_QWORD *)(a2 + 24) = 0;\n    v7 = -1;\n    do\n      ++v7;\n    while ( *((_BYTE *)v6 + v7) );\n    sub_14003D230((_QWORD *)a2, v6, v7);\n    sub_14003D310((__int64)v11);\n  }\n  return a2;\n}", "assembly": "; \n; GameManager::getMenuMusicFile from 0x140276540 to 0x1402766b3 (371 bytes)\n; \n; 4 xrefs:\n; > GameManager::playMenuMusic @ 0x1402767b9\n; > GameManager::fadeInMenuMusic @ 0x140276a18\n; > <???> @ 0x14091cd54\n; > <???> @ 0x14091cd60\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:28:56 +0000\n; \nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x140276540\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x140276545\npush    rdi                                                            ; +0xa, 0x14027654a\nsub     rsp, 60h                                                       ; +0xb, 0x14027654b\nmov     rax, cs:__security_cookie                                      ; +0xf, 0x14027654f\nxor     rax, rsp                                                       ; +0x16, 0x140276556\nmov     [rsp+68h+var_18], rax                                          ; +0x19, 0x140276559\nmov     rbx, rdx                                                       ; +0x1e, 0x14027655e\nmov     rdi, rcx                                                       ; +0x21, 0x140276561\nmov     [rsp+68h+var_48], rdx                                          ; +0x24, 0x140276564\nxor     esi, esi                                                       ; +0x29, 0x140276569\ncmp     [rcx+48Ch], esi                                                ; +0x2b, 0x14027656b\njle     short loc_1402765C2                                            ; +0x31, 0x140276571\nmov     rcx, cs:qword_14090C070                                        ; +0x33, 0x140276573\ntest    rcx, rcx                                                       ; +0x3a, 0x14027657a\njnz     short loc_1402765AD                                            ; +0x3d, 0x14027657d\nmov     ecx, 3D0h; Size                                                ; +0x3f, 0x14027657f\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x44, 0x140276584\nmov     [rsp+68h+var_48], rax                                          ; +0x49, 0x140276589\nmov     rcx, rax                                                       ; +0x4e, 0x14027658e\ncall    MusicDownloadManager__MusicDownloadManager                     ; +0x51, 0x140276591\nmov     rcx, rax                                                       ; +0x56, 0x140276596\nmov     cs:qword_14090C070, rax                                        ; +0x59, 0x140276599\nmov     rax, [rax]                                                     ; +0x60, 0x1402765a0\ncall    qword ptr [rax+48h]                                            ; +0x63, 0x1402765a3\nmov     rcx, cs:qword_14090C070                                        ; +0x66, 0x1402765a6\nmov     edx, [rdi+48Ch]                                                ; +0x6d, 0x1402765ad\ncall    MusicDownloadManager__isSongDownloaded                         ; +0x73, 0x1402765b3\ntest    al, al                                                         ; +0x78, 0x1402765b8\njnz     short loc_1402765C2                                            ; +0x7a, 0x1402765ba\nmov     [rdi+48Ch], esi                                                ; +0x7c, 0x1402765bc\ncmp     dword ptr [rdi+48Ch], 0                                        ; +0x82, 0x1402765c2\njle     loc_140276662                                                  ; +0x89, 0x1402765c9\nmov     rcx, cs:qword_14090C070                                        ; +0x8f, 0x1402765cf\ntest    rcx, rcx                                                       ; +0x96, 0x1402765d6\njnz     short loc_140276609                                            ; +0x99, 0x1402765d9\nmov     ecx, 3D0h; Size                                                ; +0x9b, 0x1402765db\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xa0, 0x1402765e0\nmov     [rsp+68h+var_48], rax                                          ; +0xa5, 0x1402765e5\nmov     rcx, rax                                                       ; +0xaa, 0x1402765ea\ncall    MusicDownloadManager__MusicDownloadManager                     ; +0xad, 0x1402765ed\nmov     rcx, rax                                                       ; +0xb2, 0x1402765f2\nmov     cs:qword_14090C070, rax                                        ; +0xb5, 0x1402765f5\nmov     rax, [rax]                                                     ; +0xbc, 0x1402765fc\ncall    qword ptr [rax+48h]                                            ; +0xbf, 0x1402765ff\nmov     rcx, cs:qword_14090C070                                        ; +0xc2, 0x140276602\nmov     r8d, [rdi+48Ch]                                                ; +0xc9, 0x140276609\nlea     rdx, [rsp+68h+var_38]                                          ; +0xd0, 0x140276610\ncall    MusicDownloadManager__pathForSong                              ; +0xd5, 0x140276615\nnop                                                                    ; +0xda, 0x14027661a\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0xdb, 0x14027661b\njbe     short loc_140276625                                            ; +0xe0, 0x140276620\nmov     rax, [rax]                                                     ; +0xe2, 0x140276622\nxorps   xmm0, xmm0                                                     ; +0xe5, 0x140276625\nmovups  xmmword ptr [rbx], xmm0                                        ; +0xe8, 0x140276628\nmov     [rbx+10h], rsi                                                 ; +0xeb, 0x14027662b\nmov     [rbx+18h], rsi                                                 ; +0xef, 0x14027662f\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0xf3, 0x140276633\nnop     word ptr [rax+rax+00h]                                         ; +0xfa, 0x14027663a\ninc     r8                                                             ; +0x100, 0x140276640\ncmp     byte ptr [rax+r8], 0                                           ; +0x103, 0x140276643\njnz     short loc_140276640                                            ; +0x108, 0x140276648\nmov     rdx, rax                                                       ; +0x10a, 0x14027664a\nmov     rcx, rbx                                                       ; +0x10d, 0x14027664d\ncall    sub_14003D230                                                  ; +0x110, 0x140276650\nnop                                                                    ; +0x115, 0x140276655\nlea     rcx, [rsp+68h+var_38]                                          ; +0x116, 0x140276656\ncall    sub_14003D310                                                  ; +0x11b, 0x14027665b\njmp     short loc_140276691                                            ; +0x120, 0x140276660\nxorps   xmm0, xmm0                                                     ; +0x122, 0x140276662\nmovups  xmmword ptr [rbx], xmm0                                        ; +0x125, 0x140276665\nmov     qword ptr [rbx+10h], 0Ch                                       ; +0x128, 0x140276668\nmov     qword ptr [rbx+18h], 0Fh                                       ; +0x130, 0x140276670\nmovsd   xmm0, cs:qword_14075D5A8                                       ; +0x138, 0x140276678\nmovsd   qword ptr [rbx], xmm0                                          ; +0x140, 0x140276680\nmov     eax, cs:dword_14075D5B0                                        ; +0x144, 0x140276684\nmov     [rbx+8], eax                                                   ; +0x14a, 0x14027668a\nmov     byte ptr [rbx+0Ch], 0                                          ; +0x14d, 0x14027668d\nmov     rax, rbx                                                       ; +0x151, 0x140276691\nmov     rcx, [rsp+68h+var_18]                                          ; +0x154, 0x140276694\nxor     rcx, rsp; StackCookie                                          ; +0x159, 0x140276699\ncall    __security_check_cookie                                        ; +0x15c, 0x14027669c\nlea     r11, [rsp+68h+var_8]                                           ; +0x161, 0x1402766a1\nmov     rbx, [r11+20h]                                                 ; +0x166, 0x1402766a6\nmov     rsi, [r11+28h]                                                 ; +0x16a, 0x1402766aa\nmov     rsp, r11                                                       ; +0x16e, 0x1402766ae\npop     rdi                                                            ; +0x171, 0x1402766b1\nretn                                                                   ; +0x172, 0x1402766b2", "xrefs": ["GameManager::playMenuMusic @ 0x1402767b9", "GameManager::fadeInMenuMusic @ 0x140276a18", "<???> @ 0x14091cd54", "<???> @ 0x14091cd60"], "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"}