{"type": "func", "start": 4295993560, "end": 4295993984, "name": "CustomSongWidget::onDownload", "pseudocode": "// \n// CustomSongWidget::onDownload from 0x1000fa8d8 to 0x1000faa80 (424 bytes)\n// \n// 4 xrefs:\n// > CustomSongWidget::musicActionFinished @ 0x1000fe67c\n// > sub_1000FE684 @ 0x1000fe6a4\n// > CustomSongWidget::FLAlert_Clicked @ 0x1000fe710\n// > CustomSongWidget::init @ 0x1000f9c28\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\nvoid __fastcall CustomSongWidget::onDownload(CustomSongWidget *a1, cocos2d::CCObject *a2)\n{\n  cocos2d::extension::CCScale9Sprite *m_bgSpr; // x0\n  GameManager *v4; // x0\n  MusicDownloadManager *v5; // x0\n  MusicDownloadManager *v6; // x0\n  MusicDownloadManager *v7; // x0\n  std::size_t size; // x8\n  MusicDownloadManager *v9; // x0\n  MusicDownloadManager *v10; // x0\n\n  ((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_errorLabel->setVisible)(a1->m_errorLabel, 0);\n  m_bgSpr = a1->m_bgSpr;\n  if ( m_bgSpr )\n    ((void (__fastcall *)(cocos2d::extension::CCScale9Sprite *, _QWORD))m_bgSpr->setVisible)(m_bgSpr, 0);\n  v4 = GameManager::sharedState();\n  if ( !GameManager::getGameVariable(v4, \"0016\") )\n  {\n    v6 = MusicDownloadManager::sharedState();\n    MusicDownloadManager::showTOS(v6, &a1->FLAlertLayerProtocol);\n    return;\n  }\n  if ( a1->m_hasSFX )\n  {\n    ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_downloadBtn->setVisible)(a1->m_downloadBtn, 0);\n    ((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))a1->m_cancelDownloadBtn->setVisible)(\n      a1->m_cancelDownloadBtn,\n      1);\n    v5 = MusicDownloadManager::sharedState();\n    if ( (v5->m_customContentURL.m_data.m_short.shortStorage.__elems_[22] & 0x8000000000000000LL) != 0 )\n    {\n      if ( !v5->m_customContentURL.m_data.m_long.size )\n      {\nLABEL_18:\n        a1->m_hasLibrarySongs = 1;\n        v9 = MusicDownloadManager::sharedState();\n        MusicDownloadManager::getCustomContentURL(v9);\n        return;\n      }\n    }\n    else if ( !v5->m_customContentURL.m_data.m_short.shortStorage.__elems_[22] )\n    {\n      goto LABEL_18;\n    }\n    CustomSongWidget::startMultiAssetDownload(a1);\n    return;\n  }\n  if ( a1->m_songInfoObject )\n  {\n    ((void (__fastcall *)(cocos2d::CCSprite *, __int64))a1->m_sliderGroove->setVisible)(a1->m_sliderGroove, 1);\n    ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_downloadBtn->setVisible)(a1->m_downloadBtn, 0);\n    ((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))a1->m_cancelDownloadBtn->setVisible)(\n      a1->m_cancelDownloadBtn,\n      1);\n    ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_deleteBtn->setVisible)(a1->m_deleteBtn, 0);\n    if ( a1->m_customSongID >= 10000000 )\n    {\n      v7 = MusicDownloadManager::sharedState();\n      size = v7->m_customContentURL.m_data.m_short.shortStorage.__elems_[22];\n      if ( (size & 0x8000000000000000LL) != 0 )\n        size = v7->m_customContentURL.m_data.m_long.size;\n      if ( !size )\n        goto LABEL_18;\n    }\n    if ( a1->m_songInfoObject->m_verified )\n    {\n      CustomSongWidget::startDownload(a1);\n    }\n    else\n    {\n      a1->m_isNotDownloading = 1;\n      v10 = MusicDownloadManager::sharedState();\n      MusicDownloadManager::getSongInfo(v10, a1->m_customSongID, 1);\n    }\n  }\n}", "assembly": "; \n; CustomSongWidget::onDownload from 0x1000fa8d8 to 0x1000faa80 (424 bytes)\n; \n; 4 xrefs:\n; > CustomSongWidget::musicActionFinished @ 0x1000fe67c\n; > sub_1000FE684 @ 0x1000fe6a4\n; > CustomSongWidget::FLAlert_Clicked @ 0x1000fe710\n; > CustomSongWidget::init @ 0x1000f9c28\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\nSTP             X20, X19, [SP,#-0x10+var_10]!                          ; +0x0, 0x1000fa8d8\nSTP             X29, X30, [SP,#0x10+var_s0]                            ; +0x4, 0x1000fa8dc\nADD             X29, SP, #0x10                                         ; +0x8, 0x1000fa8e0\nMOV             X19, X0                                                ; +0xc, 0x1000fa8e4\nLDR             X0, [X0,#0x178]                                        ; +0x10, 0x1000fa8e8\nLDR             X8, [X0]                                               ; +0x14, 0x1000fa8ec\nLDR             X8, [X8,#0x148]                                        ; +0x18, 0x1000fa8f0\nMOV             W1, #0                                                 ; +0x1c, 0x1000fa8f4\nBLR             X8                                                     ; +0x20, 0x1000fa8f8\nLDR             X0, [X19,#0x1D8]                                       ; +0x24, 0x1000fa8fc\nCBZ             X0, loc_1000FA914                                      ; +0x28, 0x1000fa900\nLDR             X8, [X0]                                               ; +0x2c, 0x1000fa904\nLDR             X8, [X8,#0x148]                                        ; +0x30, 0x1000fa908\nMOV             W1, #0                                                 ; +0x34, 0x1000fa90c\nBLR             X8                                                     ; +0x38, 0x1000fa910\nBL              GameManager__sharedState                               ; +0x3c, 0x1000fa914\nADRL            X1, a0016; \"0016\"                                      ; +0x40, 0x1000fa918\nBL              GameManager__getGameVariable                           ; +0x48, 0x1000fa920\nTBZ             W0, #0, loc_1000FA970                                  ; +0x4c, 0x1000fa924\nLDRB            W8, [X19,#0x209]                                       ; +0x50, 0x1000fa928\nCMP             W8, #1                                                 ; +0x54, 0x1000fa92c\nB.NE            loc_1000FA984                                          ; +0x58, 0x1000fa930\nLDR             X0, [X19,#0x180]                                       ; +0x5c, 0x1000fa934\nLDR             X8, [X0]                                               ; +0x60, 0x1000fa938\nLDR             X8, [X8,#0x148]                                        ; +0x64, 0x1000fa93c\nMOV             W1, #0                                                 ; +0x68, 0x1000fa940\nBLR             X8                                                     ; +0x6c, 0x1000fa944\nLDR             X0, [X19,#0x188]                                       ; +0x70, 0x1000fa948\nLDR             X8, [X0]                                               ; +0x74, 0x1000fa94c\nLDR             X8, [X8,#0x148]                                        ; +0x78, 0x1000fa950\nMOV             W1, #1                                                 ; +0x7c, 0x1000fa954\nBLR             X8                                                     ; +0x80, 0x1000fa958\nBL              MusicDownloadManager__sharedState                      ; +0x84, 0x1000fa95c\nLDRSB           X8, [X0,#0x187]                                        ; +0x88, 0x1000fa960\nTBNZ            X8, #0x3F, loc_1000FAA24 ; '?'                         ; +0x8c, 0x1000fa964\nCBNZ            X8, loc_1000FAA2C                                      ; +0x90, 0x1000fa968\nB               loc_1000FAA3C                                          ; +0x94, 0x1000fa96c\nBL              MusicDownloadManager__sharedState                      ; +0x98, 0x1000fa970\nADD             X1, X19, #0x148                                        ; +0x9c, 0x1000fa974\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0xa0, 0x1000fa978\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0xa4, 0x1000fa97c\nB               MusicDownloadManager__showTOS                          ; +0xa8, 0x1000fa980\nLDR             X8, [X19,#0x150]                                       ; +0xac, 0x1000fa984\nCBZ             X8, loc_1000FAA54                                      ; +0xb0, 0x1000fa988\nLDR             X0, [X19,#0x1C0]                                       ; +0xb4, 0x1000fa98c\nLDR             X8, [X0]                                               ; +0xb8, 0x1000fa990\nLDR             X8, [X8,#0x148]                                        ; +0xbc, 0x1000fa994\nMOV             W1, #1                                                 ; +0xc0, 0x1000fa998\nBLR             X8                                                     ; +0xc4, 0x1000fa99c\nLDR             X0, [X19,#0x180]                                       ; +0xc8, 0x1000fa9a0\nLDR             X8, [X0]                                               ; +0xcc, 0x1000fa9a4\nLDR             X8, [X8,#0x148]                                        ; +0xd0, 0x1000fa9a8\nMOV             W1, #0                                                 ; +0xd4, 0x1000fa9ac\nBLR             X8                                                     ; +0xd8, 0x1000fa9b0\nLDR             X0, [X19,#0x188]                                       ; +0xdc, 0x1000fa9b4\nLDR             X8, [X0]                                               ; +0xe0, 0x1000fa9b8\nLDR             X8, [X8,#0x148]                                        ; +0xe4, 0x1000fa9bc\nMOV             W1, #1                                                 ; +0xe8, 0x1000fa9c0\nBLR             X8                                                     ; +0xec, 0x1000fa9c4\nLDR             X0, [X19,#0x1B0]                                       ; +0xf0, 0x1000fa9c8\nLDR             X8, [X0]                                               ; +0xf4, 0x1000fa9cc\nLDR             X8, [X8,#0x148]                                        ; +0xf8, 0x1000fa9d0\nMOV             W1, #0                                                 ; +0xfc, 0x1000fa9d4\nBLR             X8                                                     ; +0x100, 0x1000fa9d8\nLDR             W8, [X19,#0x1F0]                                       ; +0x104, 0x1000fa9dc\nMOV             W9, #0x989680                                          ; +0x108, 0x1000fa9e0\nCMP             W8, W9                                                 ; +0x110, 0x1000fa9e8\nB.LT            loc_1000FAA04                                          ; +0x114, 0x1000fa9ec\nBL              MusicDownloadManager__sharedState                      ; +0x118, 0x1000fa9f0\nLDRSB           X8, [X0,#0x187]                                        ; +0x11c, 0x1000fa9f4\nTBZ             X8, #0x3F, loc_1000FAA00 ; '?'                         ; +0x120, 0x1000fa9f8\nLDR             X8, [X0,#0x178]                                        ; +0x124, 0x1000fa9fc\nCBZ             X8, loc_1000FAA3C                                      ; +0x128, 0x1000faa00\nLDR             X8, [X19,#0x150]                                       ; +0x12c, 0x1000faa04\nLDRB            W8, [X8,#0x1F9]                                        ; +0x130, 0x1000faa08\nCMP             W8, #1                                                 ; +0x134, 0x1000faa0c\nB.NE            loc_1000FAA60                                          ; +0x138, 0x1000faa10\nMOV             X0, X19                                                ; +0x13c, 0x1000faa14\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x140, 0x1000faa18\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x144, 0x1000faa1c\nB               CustomSongWidget__startDownload                        ; +0x148, 0x1000faa20\nLDR             X8, [X0,#0x178]                                        ; +0x14c, 0x1000faa24\nCBZ             X8, loc_1000FAA3C                                      ; +0x150, 0x1000faa28\nMOV             X0, X19                                                ; +0x154, 0x1000faa2c\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x158, 0x1000faa30\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x15c, 0x1000faa34\nB               CustomSongWidget__startMultiAssetDownload              ; +0x160, 0x1000faa38\nMOV             W8, #1                                                 ; +0x164, 0x1000faa3c\nSTRB            W8, [X19,#0x208]                                       ; +0x168, 0x1000faa40\nBL              MusicDownloadManager__sharedState                      ; +0x16c, 0x1000faa44\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x170, 0x1000faa48\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x174, 0x1000faa4c\nB               MusicDownloadManager__getCustomContentURL              ; +0x178, 0x1000faa50\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x17c, 0x1000faa54\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x180, 0x1000faa58\nRET                                                                    ; +0x184, 0x1000faa5c\nMOV             W8, #1                                                 ; +0x188, 0x1000faa60\nSTRB            W8, [X19,#0x1EB]                                       ; +0x18c, 0x1000faa64\nBL              MusicDownloadManager__sharedState                      ; +0x190, 0x1000faa68\nLDR             W1, [X19,#0x1F0]                                       ; +0x194, 0x1000faa6c\nMOV             W2, #1                                                 ; +0x198, 0x1000faa70\nLDP             X29, X30, [SP,#0x10+var_s0]                            ; +0x19c, 0x1000faa74\nLDP             X20, X19, [SP+0x10+var_10],#0x20                       ; +0x1a0, 0x1000faa78\nB               MusicDownloadManager__getSongInfo                      ; +0x1a4, 0x1000faa7c", "xrefs": ["CustomSongWidget::musicActionFinished @ 0x1000fe67c", "sub_1000FE684 @ 0x1000fe6a4", "CustomSongWidget::FLAlert_Clicked @ 0x1000fe710", "CustomSongWidget::init @ 0x1000f9c28"], "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"}