{"type": "func", "start": 5372110304, "end": 5372110489, "name": "MusicDownloadManager::getDownloadedSongs", "pseudocode": "// \n// MusicDownloadManager::getDownloadedSongs from 0x14033e5e0 to 0x14033e699 (185 bytes)\n// \n// 6 xrefs:\n// > GJSongBrowser::customSetup @ 0x1402b76fc\n// > GJSongBrowser::FLAlert_Clicked @ 0x1402b7b7c\n// > MusicDownloadManager::onDownloadSongCompleted @ 0x14033eecb\n// > <???> @ 0x140695000\n// > <???> @ 0x140695038\n// > <???> @ 0x1406d563c\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\ncocos2d::CCArray *MusicDownloadManager::getDownloadedSongs(MusicDownloadManager *a1)\n{\n  __int64 v2; // rax\n  cocos2d::CCDictionary *m_songObjects; // rdx\n  cocos2d::CCArray *v4; // rdi\n  cocos2d::CCDictElement *m_pElements; // rdx\n  cocos2d::CCDictElement *i; // rbx\n  struct cocos2d::CCObject *m_pObject; // rsi\n\n  v2 = cocos2d::CCArray::create(a1);\n  m_songObjects = a1->m_songObjects;\n  v4 = (cocos2d::CCArray *)v2;\n  if ( m_songObjects )\n  {\n    m_pElements = m_songObjects->m_pElements;\n    if ( m_pElements )\n    {\n      for ( i = (cocos2d::CCDictElement *)m_pElements->hh.next; ; i = (cocos2d::CCDictElement *)i->hh.next )\n      {\n        m_pObject = m_pElements->m_pObject;\n        if ( MusicDownloadManager::isSongDownloaded(a1, m_pObject[5].m_unknown2) )\n          cocos2d::CCArray::addObject(v4, m_pObject);\n        m_pElements = i;\n        if ( !i )\n          break;\n      }\n    }\n  }\n  if ( cocos2d::CCArray::count(v4) > 1 )\n    qsort(v4->data->arr, v4->data->num, 8u, (_CoreCrtNonSecureSearchSortCompareFunction)sub_14033C500);\n  return v4;\n}", "assembly": "; \n; MusicDownloadManager::getDownloadedSongs from 0x14033e5e0 to 0x14033e699 (185 bytes)\n; \n; 6 xrefs:\n; > GJSongBrowser::customSetup @ 0x1402b76fc\n; > GJSongBrowser::FLAlert_Clicked @ 0x1402b7b7c\n; > MusicDownloadManager::onDownloadSongCompleted @ 0x14033eecb\n; > <???> @ 0x140695000\n; > <???> @ 0x140695038\n; > <???> @ 0x1406d563c\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\npush    rdi                                                            ; +0x0, 0x14033e5e0\nsub     rsp, 20h                                                       ; +0x2, 0x14033e5e2\nmov     [rsp+28h+arg_8], rbp                                           ; +0x6, 0x14033e5e6\nmov     rbp, rcx                                                       ; +0xb, 0x14033e5eb\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0xe, 0x14033e5ee\nmov     rdx, [rbp+158h]                                                ; +0x14, 0x14033e5f4\nmov     rdi, rax                                                       ; +0x1b, 0x14033e5fb\ntest    rdx, rdx                                                       ; +0x1e, 0x14033e5fe\njz      short loc_14033E660                                            ; +0x21, 0x14033e601\nmov     rdx, [rdx+38h]                                                 ; +0x23, 0x14033e603\ntest    rdx, rdx                                                       ; +0x27, 0x14033e607\njz      short loc_14033E660                                            ; +0x2a, 0x14033e60a\nmov     [rsp+28h+arg_0], rbx                                           ; +0x2c, 0x14033e60c\nmov     rbx, [rdx+120h]                                                ; +0x31, 0x14033e611\nmov     [rsp+28h+arg_10], rsi                                          ; +0x38, 0x14033e618\nnop     dword ptr [rax]                                                ; +0x3d, 0x14033e61d\nmov     rsi, [rdx+108h]                                                ; +0x40, 0x14033e620\nmov     rcx, rbp                                                       ; +0x47, 0x14033e627\nmov     edx, [rsi+140h]                                                ; +0x4a, 0x14033e62a\ncall    MusicDownloadManager__isSongDownloaded                         ; +0x50, 0x14033e630\ntest    al, al                                                         ; +0x55, 0x14033e635\njz      short loc_14033E645                                            ; +0x57, 0x14033e637\nmov     rdx, rsi                                                       ; +0x59, 0x14033e639\nmov     rcx, rdi                                                       ; +0x5c, 0x14033e63c\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x5f, 0x14033e63f\nmov     rdx, rbx                                                       ; +0x65, 0x14033e645\ntest    rbx, rbx                                                       ; +0x68, 0x14033e648\njz      short loc_14033E656                                            ; +0x6b, 0x14033e64b\nmov     rbx, [rbx+120h]                                                ; +0x6d, 0x14033e64d\njmp     short loc_14033E620                                            ; +0x74, 0x14033e654\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x76, 0x14033e656\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x7b, 0x14033e65b\nmov     rcx, rdi                                                       ; +0x80, 0x14033e660\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x83, 0x14033e663\nmov     rbp, [rsp+28h+arg_8]                                           ; +0x89, 0x14033e669\ncmp     eax, 1                                                         ; +0x8e, 0x14033e66e\njbe     short loc_14033E690                                            ; +0x91, 0x14033e671\nmov     rcx, [rdi+38h]                                                 ; +0x93, 0x14033e673\nlea     r9, sub_14033C500; CompareFunction                             ; +0x97, 0x14033e677\nmov     r8d, 8; SizeOfElements                                         ; +0x9e, 0x14033e67e\nmov     edx, [rcx]; NumOfElements                                      ; +0xa4, 0x14033e684\nmov     rcx, [rcx+10h]; Base                                           ; +0xa6, 0x14033e686\ncall    cs:qsort                                                       ; +0xaa, 0x14033e68a\nmov     rax, rdi                                                       ; +0xb0, 0x14033e690\nadd     rsp, 20h                                                       ; +0xb3, 0x14033e693\npop     rdi                                                            ; +0xb7, 0x14033e697\nretn                                                                   ; +0xb8, 0x14033e698", "xrefs": ["GJSongBrowser::customSetup @ 0x1402b76fc", "GJSongBrowser::FLAlert_Clicked @ 0x1402b7b7c", "MusicDownloadManager::onDownloadSongCompleted @ 0x14033eecb", "<???> @ 0x140695000", "<???> @ 0x140695038", "<???> @ 0x1406d563c"], "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"}