{"type": "func", "start": 5373445536, "end": 5373445844, "name": "MusicDownloadManager::isSongDownloaded", "pseudocode": "// \n// MusicDownloadManager::isSongDownloaded from 0x1404845a0 to 0x1404846d4 (308 bytes)\n// \n// 9 xrefs:\n// > AudioAssetsBrowser::onInfo @ 0x140099902\n// > CustomSongWidget::updateSongInfo @ 0x14016cab5\n// > CustomSongWidget::updateWithMultiAssets @ 0x14016d4b6\n// > GameManager::getMenuMusicFile @ 0x1402765b3\n// > LevelInfoLayer::onPlay @ 0x1404215c6\n// > MusicDownloadManager::getDownloadedSongs @ 0x1404838e0\n// > MusicDownloadManager::clearUnusedSongs @ 0x140483b3c\n// > PlayLayer::playPracticeMusic @ 0x14051a1fe\n// > <???> @ 0x140928ac0\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:32:46 +0000\n// \n\n// Hidden C++ exception states: #wind=2\nchar __fastcall MusicDownloadManager::isSongDownloaded(__int64 a1, int a2)\n{\n  __int64 v2; // r10\n  unsigned int v3; // r11d\n  _QWORD *v5; // rax\n  size_t v6; // r8\n  __int64 v7; // rcx\n  __int64 v8; // rax\n  char v9; // bl\n  void *v10; // r8\n  unsigned __int8 v11[8]; // [rsp+30h] [rbp-58h] BYREF\n  void *Block[2]; // [rsp+38h] [rbp-50h] BYREF\n  __m128i si128; // [rsp+48h] [rbp-40h]\n  _BYTE v14[32]; // [rsp+58h] [rbp-30h] BYREF\n\n  *(_DWORD *)v11 = a2;\n  if ( sub_140066B50((_QWORD *)(a1 + 584), v11) )\n    return 1;\n  v5 = (_QWORD *)MusicDownloadManager::pathForSong(v2, v14, v3);\n  if ( v5[3] > 0xFu )\n    v5 = (_QWORD *)*v5;\n  *(_OWORD *)Block = 0;\n  si128 = 0;\n  v6 = -1;\n  do\n    ++v6;\n  while ( *((_BYTE *)v5 + v6) );\n  sub_14003D230(Block, v5, v6);\n  v8 = cocos2d::CCFileUtils::sharedFileUtils(v7);\n  v9 = (*(__int64 (__fastcall **)(__int64, void **))(*(_QWORD *)v8 + 152LL))(v8, Block);\n  if ( si128.m128i_i64[1] > 0xFuLL )\n  {\n    v10 = Block[0];\n    if ( (unsigned __int64)(si128.m128i_i64[1] + 1) >= 0x1000 )\n    {\n      v10 = *((void **)Block[0] - 1);\n      if ( (unsigned __int64)((char *)Block[0] - (char *)v10 - 8) > 0x1F )\n        invoke_watson(nullptr, nullptr, nullptr, 0, 0);\n    }\n    j_j_free(v10);\n  }\n  si128 = _mm_load_si128((const __m128i *)&Size);\n  LOBYTE(Block[0]) = 0;\n  sub_14003D310((__int64)v14);\n  return v9;\n}", "assembly": "; \n; MusicDownloadManager::isSongDownloaded from 0x1404845a0 to 0x1404846d4 (308 bytes)\n; \n; 9 xrefs:\n; > AudioAssetsBrowser::onInfo @ 0x140099902\n; > CustomSongWidget::updateSongInfo @ 0x14016cab5\n; > CustomSongWidget::updateWithMultiAssets @ 0x14016d4b6\n; > GameManager::getMenuMusicFile @ 0x1402765b3\n; > LevelInfoLayer::onPlay @ 0x1404215c6\n; > MusicDownloadManager::getDownloadedSongs @ 0x1404838e0\n; > MusicDownloadManager::clearUnusedSongs @ 0x140483b3c\n; > PlayLayer::playPracticeMusic @ 0x14051a1fe\n; > <???> @ 0x140928ac0\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:32:46 +0000\n; \npush    rbx                                                            ; +0x0, 0x1404845a0\nsub     rsp, 80h                                                       ; +0x2, 0x1404845a2\nmov     rax, cs:__security_cookie                                      ; +0x9, 0x1404845a9\nxor     rax, rsp                                                       ; +0x10, 0x1404845b0\nmov     [rsp+88h+var_10], rax                                          ; +0x13, 0x1404845b3\nmov     r11d, edx                                                      ; +0x18, 0x1404845b8\nmov     r10, rcx                                                       ; +0x1b, 0x1404845bb\nmov     dword ptr [rsp+88h+var_58], edx                                ; +0x1e, 0x1404845be\nadd     rcx, 248h                                                      ; +0x22, 0x1404845c2\nlea     rdx, [rsp+88h+var_58]                                          ; +0x29, 0x1404845c9\ncall    sub_140066B50                                                  ; +0x2e, 0x1404845ce\ntest    rax, rax                                                       ; +0x33, 0x1404845d3\njz      short loc_1404845DF                                            ; +0x36, 0x1404845d6\nmov     al, 1                                                          ; +0x38, 0x1404845d8\njmp     loc_1404846BE                                                  ; +0x3a, 0x1404845da\nmov     r8d, r11d                                                      ; +0x3f, 0x1404845df\nlea     rdx, [rsp+88h+var_30]                                          ; +0x42, 0x1404845e2\nmov     rcx, r10                                                       ; +0x47, 0x1404845e7\ncall    MusicDownloadManager__pathForSong                              ; +0x4a, 0x1404845ea\nnop                                                                    ; +0x4f, 0x1404845ef\ncmp     qword ptr [rax+18h], 0Fh                                       ; +0x50, 0x1404845f0\njbe     short loc_1404845FA                                            ; +0x55, 0x1404845f5\nmov     rax, [rax]                                                     ; +0x57, 0x1404845f7\nxorps   xmm0, xmm0                                                     ; +0x5a, 0x1404845fa\nmovups  xmmword ptr [rsp+88h+Block], xmm0                              ; +0x5d, 0x1404845fd\nxorps   xmm1, xmm1                                                     ; +0x62, 0x140484602\nmovdqu  [rsp+88h+var_40], xmm1                                         ; +0x65, 0x140484605\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x6b, 0x14048460b\ninc     r8                                                             ; +0x72, 0x140484612\ncmp     byte ptr [rax+r8], 0                                           ; +0x75, 0x140484615\njnz     short loc_140484612                                            ; +0x7a, 0x14048461a\nmov     rdx, rax                                                       ; +0x7c, 0x14048461c\nlea     rcx, [rsp+88h+Block]                                           ; +0x7f, 0x14048461f\ncall    sub_14003D230                                                  ; +0x84, 0x140484624\nnop                                                                    ; +0x89, 0x140484629\ncall    cs:?sharedFileUtils@CCFileUtils@cocos2d@@SAPEAV12@XZ; cocos2d::CCFileUtils::sharedFileUtils(void) ; +0x8a, 0x14048462a\nmov     rcx, [rax]                                                     ; +0x90, 0x140484630\nmov     r8, [rcx+98h]                                                  ; +0x93, 0x140484633\nlea     rdx, [rsp+88h+Block]                                           ; +0x9a, 0x14048463a\nmov     rcx, rax                                                       ; +0x9f, 0x14048463f\ncall    r8                                                             ; +0xa2, 0x140484642\nmovzx   ebx, al                                                        ; +0xa5, 0x140484645\nmov     rdx, qword ptr [rsp+88h+var_40+8]                              ; +0xa8, 0x140484648\ncmp     rdx, 0Fh                                                       ; +0xad, 0x14048464d\njbe     short loc_14048469E                                            ; +0xb1, 0x140484651\ninc     rdx                                                            ; +0xb3, 0x140484653\nmov     r8, [rsp+88h+Block]                                            ; +0xb6, 0x140484656\nmov     rcx, r8                                                        ; +0xbb, 0x14048465b\ncmp     rdx, 1000h                                                     ; +0xbe, 0x14048465e\njb      short loc_140484696                                            ; +0xc5, 0x140484665\nadd     rdx, 27h ; '''                                                 ; +0xc7, 0x140484667\nmov     r8, [r8-8]                                                     ; +0xcb, 0x14048466b\nsub     rcx, r8                                                        ; +0xcf, 0x14048466f\nsub     rcx, 8                                                         ; +0xd2, 0x140484672\ncmp     rcx, 1Fh                                                       ; +0xd6, 0x140484676\njbe     short loc_140484696                                            ; +0xda, 0x14048467a\nmov     [rsp+88h+Reserved], 0; Reserved                                ; +0xdc, 0x14048467c\nxor     r9d, r9d; LineNo                                               ; +0xe5, 0x140484685\nxor     r8d, r8d; FileName                                             ; +0xe8, 0x140484688\nxor     edx, edx; FunctionName                                         ; +0xeb, 0x14048468b\nxor     ecx, ecx; Expression                                           ; +0xed, 0x14048468d\ncall    cs:_invoke_watson                                              ; +0xef, 0x14048468f\nalign 2                                                                ; +0xf5, 0x140484695\nmov     rcx, r8; Block                                                 ; +0xf6, 0x140484696\ncall    j_j_free                                                       ; +0xf9, 0x140484699\nmovdqa  xmm0, cs:Size                                                  ; +0xfe, 0x14048469e\nmovdqu  [rsp+88h+var_40], xmm0                                         ; +0x106, 0x1404846a6\nmov     byte ptr [rsp+88h+Block], 0                                    ; +0x10c, 0x1404846ac\nlea     rcx, [rsp+88h+var_30]                                          ; +0x111, 0x1404846b1\ncall    sub_14003D310                                                  ; +0x116, 0x1404846b6\nmovzx   eax, bl                                                        ; +0x11b, 0x1404846bb\nmov     rcx, [rsp+88h+var_10]                                          ; +0x11e, 0x1404846be\nxor     rcx, rsp; StackCookie                                          ; +0x123, 0x1404846c3\ncall    __security_check_cookie                                        ; +0x126, 0x1404846c6\nadd     rsp, 80h                                                       ; +0x12b, 0x1404846cb\npop     rbx                                                            ; +0x132, 0x1404846d2\nretn                                                                   ; +0x133, 0x1404846d3", "xrefs": ["AudioAssetsBrowser::onInfo @ 0x140099902", "CustomSongWidget::updateSongInfo @ 0x14016cab5", "CustomSongWidget::updateWithMultiAssets @ 0x14016d4b6", "GameManager::getMenuMusicFile @ 0x1402765b3", "LevelInfoLayer::onPlay @ 0x1404215c6", "MusicDownloadManager::getDownloadedSongs @ 0x1404838e0", "MusicDownloadManager::clearUnusedSongs @ 0x140483b3c", "PlayLayer::playPracticeMusic @ 0x14051a1fe", "<???> @ 0x140928ac0"], "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"}