{"type": "func", "start": 7635120, "end": 7635560, "name": "CustomSongWidget::onDownload", "pseudocode": "// \n// CustomSongWidget::onDownload from 0x7480b0 to 0x748268 (440 bytes)\n// \n// 5 xrefs:\n// > CustomSongWidget::musicActionFinished @ 0x748284\n// > CustomSongWidget::FLAlert_Clicked @ 0x74830c\n// > <???> @ 0x69600\n// > CustomSongWidget::init @ 0x745a48\n// > <???> @ 0x122b6d8\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 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\n  a1->m_errorLabel->setVisible(a1->m_errorLabel, 0);\n  m_bgSpr = a1->m_bgSpr;\n  if ( m_bgSpr )\n    m_bgSpr->setVisible(m_bgSpr, 0);\n  v4 = GameManager::sharedState();\n  if ( !GameManager::getGameVariable(v4, \"0016\") )\n  {\n    v7 = MusicDownloadManager::sharedState();\n    MusicDownloadManager::showTOS(v7, &a1->FLAlertLayerProtocol);\n    return;\n  }\n  if ( a1->m_hasSFX )\n  {\n    a1->m_downloadBtn->setVisible(a1->m_downloadBtn, 0);\n    a1->m_cancelDownloadBtn->setVisible(a1->m_cancelDownloadBtn, 1);\n    if ( *((_QWORD *)MusicDownloadManager::sharedState()->m_customContentURL.m_data.m_data - 3) )\n    {\n      CustomSongWidget::startMultiAssetDownload(a1);\n      return;\n    }\n    goto LABEL_10;\n  }\n  if ( !a1->m_songInfoObject )\n    return;\n  a1->m_sliderGroove->setVisible(a1->m_sliderGroove, 1);\n  a1->m_downloadBtn->setVisible(a1->m_downloadBtn, 0);\n  a1->m_cancelDownloadBtn->setVisible(a1->m_cancelDownloadBtn, 1);\n  a1->m_deleteBtn->setVisible(a1->m_deleteBtn, 0);\n  if ( a1->m_customSongID > 9999999\n    && !*((_QWORD *)MusicDownloadManager::sharedState()->m_customContentURL.m_data.m_data - 3) )\n  {\nLABEL_10:\n    a1->m_hasLibrarySongs = (unsigned __int8)&dword_0 + 1;\n    v6 = MusicDownloadManager::sharedState();\n    MusicDownloadManager::getCustomContentURL(v6);\n    return;\n  }\n  if ( a1->m_songInfoObject->m_verified )\n  {\n    CustomSongWidget::startDownload(a1);\n  }\n  else\n  {\n    a1->m_isNotDownloading = 1;\n    v5 = MusicDownloadManager::sharedState();\n    MusicDownloadManager::getSongInfo(v5, a1->m_customSongID, 1);\n  }\n}", "assembly": "; \n; CustomSongWidget::onDownload from 0x7480b0 to 0x748268 (440 bytes)\n; \n; 5 xrefs:\n; > CustomSongWidget::musicActionFinished @ 0x748284\n; > CustomSongWidget::FLAlert_Clicked @ 0x74830c\n; > <???> @ 0x69600\n; > CustomSongWidget::init @ 0x745a48\n; > <???> @ 0x122b6d8\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             X29, X30, [SP,#var_30]!                                ; +0x0, 0x7480b0\nMOV             W1, #0                                                 ; +0x4, 0x7480b4\nMOV             X29, SP                                                ; +0x8, 0x7480b8\nLDR             X2, [X0,#0x178]                                        ; +0xc, 0x7480bc\nSTR             X19, [SP,#0x30+var_20]                                 ; +0x10, 0x7480c0\nMOV             X19, X0                                                ; +0x14, 0x7480c4\nMOV             X0, X2                                                 ; +0x18, 0x7480c8\nLDR             X2, [X2]                                               ; +0x1c, 0x7480cc\nLDR             X2, [X2,#0x148]                                        ; +0x20, 0x7480d0\nBLR             X2                                                     ; +0x24, 0x7480d4\nLDR             X0, [X19,#0x1D8]                                       ; +0x28, 0x7480d8\nCBZ             X0, loc_7480F0                                         ; +0x2c, 0x7480dc\nLDR             X2, [X0]                                               ; +0x30, 0x7480e0\nMOV             W1, #0                                                 ; +0x34, 0x7480e4\nLDR             X2, [X2,#0x148]                                        ; +0x38, 0x7480e8\nBLR             X2                                                     ; +0x3c, 0x7480ec\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x40, 0x7480f0\nADRL            X1, a0016; \"0016\"                                      ; +0x44, 0x7480f4\nBL              _ZN11GameManager15getGameVariableEPKc; GameManager::getGameVariable(char const*) ; +0x4c, 0x7480fc\nUXTB            W0, W0; this                                           ; +0x50, 0x748100\nCBZ             W0, loc_748214                                         ; +0x54, 0x748104\nLDRB            W0, [X19,#0x209]                                       ; +0x58, 0x748108\nCBNZ            W0, loc_7481BC                                         ; +0x5c, 0x74810c\nLDR             X0, [X19,#0x150]                                       ; +0x60, 0x748110\nCBZ             X0, loc_748228                                         ; +0x64, 0x748114\nLDR             X2, [X19,#0x1C0]                                       ; +0x68, 0x748118\nMOV             W1, #1                                                 ; +0x6c, 0x74811c\nMOV             X0, X2                                                 ; +0x70, 0x748120\nLDR             X2, [X2]                                               ; +0x74, 0x748124\nLDR             X2, [X2,#0x148]                                        ; +0x78, 0x748128\nBLR             X2                                                     ; +0x7c, 0x74812c\nLDR             X2, [X19,#0x180]                                       ; +0x80, 0x748130\nMOV             W1, #0                                                 ; +0x84, 0x748134\nMOV             X0, X2                                                 ; +0x88, 0x748138\nLDR             X2, [X2]                                               ; +0x8c, 0x74813c\nLDR             X2, [X2,#0x148]                                        ; +0x90, 0x748140\nBLR             X2                                                     ; +0x94, 0x748144\nLDR             X2, [X19,#0x188]                                       ; +0x98, 0x748148\nMOV             W1, #1                                                 ; +0x9c, 0x74814c\nMOV             X0, X2                                                 ; +0xa0, 0x748150\nLDR             X2, [X2]                                               ; +0xa4, 0x748154\nLDR             X2, [X2,#0x148]                                        ; +0xa8, 0x748158\nBLR             X2                                                     ; +0xac, 0x74815c\nLDR             X2, [X19,#0x1B0]                                       ; +0xb0, 0x748160\nMOV             W1, #0                                                 ; +0xb4, 0x748164\nMOV             X0, X2                                                 ; +0xb8, 0x748168\nLDR             X2, [X2]                                               ; +0xbc, 0x74816c\nLDR             X2, [X2,#0x148]                                        ; +0xc0, 0x748170\nBLR             X2                                                     ; +0xc4, 0x748174\nMOV             W0, #0x967F                                            ; +0xc8, 0x748178\nLDR             W1, [X19,#0x1F0]                                       ; +0xcc, 0x74817c\nMOVK            W0, #0x98,LSL#16; this                                 ; +0xd0, 0x748180\nCMP             W1, W0                                                 ; +0xd4, 0x748184\nB.GT            loc_748254                                             ; +0xd8, 0x748188\nLDR             X0, [X19,#0x150]                                       ; +0xdc, 0x74818c\nLDRB            W0, [X0,#0x189]; this                                  ; +0xe0, 0x748190\nCBNZ            W0, loc_748244                                         ; +0xe4, 0x748194\nMOV             W2, #1                                                 ; +0xe8, 0x748198\nSTRB            W2, [X19,#0x1EB]                                       ; +0xec, 0x74819c\nSTR             X2, [X29,#0x30+var_8]                                  ; +0xf0, 0x7481a0\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0xf4, 0x7481a4\nLDR             W1, [X19,#0x1F0]; int                                  ; +0xf8, 0x7481a8\nLDR             X2, [X29,#0x30+var_8]; bool                            ; +0xfc, 0x7481ac\nLDR             X19, [SP,#0x30+var_20]                                 ; +0x100, 0x7481b0\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0x104, 0x7481b4\nB               _ZN20MusicDownloadManager11getSongInfoEib; MusicDownloadManager::getSongInfo(int,bool) ; +0x108, 0x7481b8\nLDR             X2, [X19,#0x180]                                       ; +0x10c, 0x7481bc\nMOV             W1, #0                                                 ; +0x110, 0x7481c0\nMOV             X0, X2                                                 ; +0x114, 0x7481c4\nLDR             X2, [X2]                                               ; +0x118, 0x7481c8\nLDR             X2, [X2,#0x148]                                        ; +0x11c, 0x7481cc\nBLR             X2                                                     ; +0x120, 0x7481d0\nLDR             X2, [X19,#0x188]                                       ; +0x124, 0x7481d4\nMOV             W1, #1                                                 ; +0x128, 0x7481d8\nMOV             X0, X2                                                 ; +0x12c, 0x7481dc\nLDR             X2, [X2]                                               ; +0x130, 0x7481e0\nLDR             X2, [X2,#0x148]                                        ; +0x134, 0x7481e4\nBLR             X2                                                     ; +0x138, 0x7481e8\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0x13c, 0x7481ec\nLDR             X0, [X0,#0x170]                                        ; +0x140, 0x7481f0\nLDUR            X0, [X0,#-0x18]                                        ; +0x144, 0x7481f4\nCBNZ            X0, loc_748234                                         ; +0x148, 0x7481f8\nMOV             W0, #(dword_0+1); this                                 ; +0x14c, 0x7481fc\nSTRB            W0, [X19,#0x208]                                       ; +0x150, 0x748200\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0x154, 0x748204\nLDR             X19, [SP,#0x30+var_20]                                 ; +0x158, 0x748208\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0x15c, 0x74820c\nB               _ZN20MusicDownloadManager19getCustomContentURLEv; MusicDownloadManager::getCustomContentURL(void) ; +0x160, 0x748210\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0x164, 0x748214\nADD             X1, X19, #0x148                                        ; +0x168, 0x748218\nLDR             X19, [SP,#0x30+var_20]                                 ; +0x16c, 0x74821c\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0x170, 0x748220\nB               _ZN20MusicDownloadManager7showTOSEP20FLAlertLayerProtocol; MusicDownloadManager::showTOS(FLAlertLayerProtocol *) ; +0x174, 0x748224\nLDR             X19, [SP,#0x30+var_20]                                 ; +0x178, 0x748228\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0x17c, 0x74822c\nRET                                                                    ; +0x180, 0x748230\nMOV             X0, X19; this                                          ; +0x184, 0x748234\nLDR             X19, [SP,#0x30+var_20]                                 ; +0x188, 0x748238\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0x18c, 0x74823c\nB               _ZN16CustomSongWidget23startMultiAssetDownloadEv; CustomSongWidget::startMultiAssetDownload(void) ; +0x190, 0x748240\nMOV             X0, X19; this                                          ; +0x194, 0x748244\nLDR             X19, [SP,#0x30+var_20]                                 ; +0x198, 0x748248\nLDP             X29, X30, [SP+0x30+var_30],#0x30                       ; +0x19c, 0x74824c\nB               _ZN16CustomSongWidget13startDownloadEv; CustomSongWidget::startDownload(void) ; +0x1a0, 0x748250\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0x1a4, 0x748254\nLDR             X0, [X0,#0x170]                                        ; +0x1a8, 0x748258\nLDUR            X0, [X0,#-0x18]                                        ; +0x1ac, 0x74825c\nCBZ             X0, loc_7481FC                                         ; +0x1b0, 0x748260\nB               loc_74818C                                             ; +0x1b4, 0x748264", "xrefs": ["CustomSongWidget::musicActionFinished @ 0x748284", "CustomSongWidget::FLAlert_Clicked @ 0x74830c", "<???> @ 0x69600", "CustomSongWidget::init @ 0x745a48", "<???> @ 0x122b6d8"], "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"}