{"type": "func", "start": 5370263328, "end": 5370263585, "name": "GameManager::getMenuMusicFile", "pseudocode": "// \n// GameManager::getMenuMusicFile from 0x14017b720 to 0x14017b821 (257 bytes)\n// \n// 4 xrefs:\n// > GameManager::playMenuMusic @ 0x14017b928\n// > GameManager::fadeInMenuMusic @ 0x14017bb87\n// > <???> @ 0x1406cb340\n// > <???> @ 0x1406cb34c\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 GameManager::getMenuMusicFile(__int64 a1, __int64 a2)\n{\n  int v4; // esi\n  MusicDownloadManager *v5; // rax\n  int v6; // edi\n  MusicDownloadManager *v7; // rax\n  _QWORD *v8; // rax\n  size_t v9; // r8\n  _BYTE v11[32]; // [rsp+30h] [rbp-48h] BYREF\n\n  v4 = *(_DWORD *)(a1 + 1080);\n  if ( v4 > 0 )\n  {\n    v5 = MusicDownloadManager::sharedState();\n    if ( !MusicDownloadManager::isSongDownloaded(v5, v4) )\n      *(_DWORD *)(a1 + 1080) = 0;\n  }\n  v6 = *(_DWORD *)(a1 + 1080);\n  if ( v6 <= 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    v7 = MusicDownloadManager::sharedState();\n    v8 = (_QWORD *)MusicDownloadManager::pathForSong(v7, v11, (unsigned int)v6);\n    if ( v8[3] > 0xFu )\n      v8 = (_QWORD *)*v8;\n    *(_OWORD *)a2 = 0;\n    *(_QWORD *)(a2 + 16) = 0;\n    *(_QWORD *)(a2 + 24) = 0;\n    v9 = -1;\n    do\n      ++v9;\n    while ( *((_BYTE *)v8 + v9) );\n    sub_14003A930((_QWORD *)a2, v8, v9);\n    sub_14003A830((__int64)v11);\n  }\n  return a2;\n}", "assembly": "; \n; GameManager::getMenuMusicFile from 0x14017b720 to 0x14017b821 (257 bytes)\n; \n; 4 xrefs:\n; > GameManager::playMenuMusic @ 0x14017b928\n; > GameManager::fadeInMenuMusic @ 0x14017bb87\n; > <???> @ 0x1406cb340\n; > <???> @ 0x1406cb34c\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, 0x14017b720\npush    rbp                                                            ; +0x5, 0x14017b725\npush    rsi                                                            ; +0x6, 0x14017b726\npush    rdi                                                            ; +0x7, 0x14017b727\nsub     rsp, 60h                                                       ; +0x8, 0x14017b728\nmov     rax, cs:__security_cookie                                      ; +0xc, 0x14017b72c\nxor     rax, rsp                                                       ; +0x13, 0x14017b733\nmov     [rsp+78h+var_28], rax                                          ; +0x16, 0x14017b736\nmov     rbx, rdx                                                       ; +0x1b, 0x14017b73b\nmov     rdi, rcx                                                       ; +0x1e, 0x14017b73e\nmov     [rsp+78h+var_50], rdx                                          ; +0x21, 0x14017b741\nxor     ebp, ebp                                                       ; +0x26, 0x14017b746\nmov     esi, [rcx+438h]                                                ; +0x28, 0x14017b748\ntest    esi, esi                                                       ; +0x2e, 0x14017b74e\njle     short loc_14017B76B                                            ; +0x30, 0x14017b750\ncall    MusicDownloadManager__sharedState                              ; +0x32, 0x14017b752\nmov     rcx, rax                                                       ; +0x37, 0x14017b757\nmov     edx, esi                                                       ; +0x3a, 0x14017b75a\ncall    MusicDownloadManager__isSongDownloaded                         ; +0x3c, 0x14017b75c\ntest    al, al                                                         ; +0x41, 0x14017b761\njnz     short loc_14017B76B                                            ; +0x43, 0x14017b763\nmov     [rdi+438h], ebp                                                ; +0x45, 0x14017b765\nmov     edi, [rdi+438h]                                                ; +0x4b, 0x14017b76b\ntest    edi, edi                                                       ; +0x51, 0x14017b771\njle     short loc_14017B7D2                                            ; +0x53, 0x14017b773\ncall    MusicDownloadManager__sharedState                              ; +0x55, 0x14017b775\nmov     rcx, rax                                                       ; +0x5a, 0x14017b77a\nmov     r8d, edi                                                       ; +0x5d, 0x14017b77d\nlea     rdx, [rsp+78h+var_48]                                          ; +0x60, 0x14017b780\ncall    MusicDownloadManager__pathForSong                              ; +0x65, 0x14017b785\nnop                                                                    ; +0x6a, 0x14017b78a\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x6b, 0x14017b78b\njbe     short loc_14017B795                                            ; +0x70, 0x14017b790\nmov     rax, [rax]                                                     ; +0x72, 0x14017b792\nxorps   xmm0, xmm0                                                     ; +0x75, 0x14017b795\nmovups  xmmword ptr [rbx], xmm0                                        ; +0x78, 0x14017b798\nmov     [rbx+10h], rbp                                                 ; +0x7b, 0x14017b79b\nmov     [rbx+18h], rbp                                                 ; +0x7f, 0x14017b79f\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x83, 0x14017b7a3\nnop     word ptr [rax+rax+00h]                                         ; +0x8a, 0x14017b7aa\ninc     r8                                                             ; +0x90, 0x14017b7b0\ncmp     byte ptr [rax+r8], 0                                           ; +0x93, 0x14017b7b3\njnz     short loc_14017B7B0                                            ; +0x98, 0x14017b7b8\nmov     rdx, rax                                                       ; +0x9a, 0x14017b7ba\nmov     rcx, rbx                                                       ; +0x9d, 0x14017b7bd\ncall    sub_14003A930                                                  ; +0xa0, 0x14017b7c0\nnop                                                                    ; +0xa5, 0x14017b7c5\nlea     rcx, [rsp+78h+var_48]                                          ; +0xa6, 0x14017b7c6\ncall    sub_14003A830                                                  ; +0xab, 0x14017b7cb\njmp     short loc_14017B801                                            ; +0xb0, 0x14017b7d0\nxorps   xmm0, xmm0                                                     ; +0xb2, 0x14017b7d2\nmovups  xmmword ptr [rbx], xmm0                                        ; +0xb5, 0x14017b7d5\nmov     qword ptr [rbx+10h], 0Ch                                       ; +0xb8, 0x14017b7d8\nmov     qword ptr [rbx+18h], 0Fh                                       ; +0xc0, 0x14017b7e0\nmovsd   xmm0, cs:qword_14055CEB8                                       ; +0xc8, 0x14017b7e8\nmovsd   qword ptr [rbx], xmm0                                          ; +0xd0, 0x14017b7f0\nmov     eax, cs:dword_14055CEC0                                        ; +0xd4, 0x14017b7f4\nmov     [rbx+8], eax                                                   ; +0xda, 0x14017b7fa\nmov     [rbx+0Ch], bpl                                                 ; +0xdd, 0x14017b7fd\nmov     rax, rbx                                                       ; +0xe1, 0x14017b801\nmov     rcx, [rsp+78h+var_28]                                          ; +0xe4, 0x14017b804\nxor     rcx, rsp; StackCookie                                          ; +0xe9, 0x14017b809\ncall    __security_check_cookie                                        ; +0xec, 0x14017b80c\nmov     rbx, [rsp+78h+arg_10]                                          ; +0xf1, 0x14017b811\nadd     rsp, 60h                                                       ; +0xf9, 0x14017b819\npop     rdi                                                            ; +0xfd, 0x14017b81d\npop     rsi                                                            ; +0xfe, 0x14017b81e\npop     rbp                                                            ; +0xff, 0x14017b81f\nretn                                                                   ; +0x100, 0x14017b820", "xrefs": ["GameManager::playMenuMusic @ 0x14017b928", "GameManager::fadeInMenuMusic @ 0x14017bb87", "<???> @ 0x1406cb340", "<???> @ 0x1406cb34c"], "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"}