{"type": "func", "start": 4063664, "end": 4063938, "name": "CustomSongWidget::onDownload", "pseudocode": "// \n// CustomSongWidget::onDownload from 0x3e01b0 to 0x3e02c2 (274 bytes)\n// \n// 2 xrefs:\n// > CustomSongWidget::musicActionFinished @ 0x3e02dc\n// > CustomSongWidget::FLAlert_Clicked @ 0x3e031e\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; // r0\n  GameManager *v4; // r0\n  MusicDownloadManager *v5; // r0\n  _BOOL4 m_hasSFX; // r5\n  MusicDownloadManager *v7; // r0\n  MusicDownloadManager *v8; // r0\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    v5 = MusicDownloadManager::sharedState();\n    MusicDownloadManager::showTOS(v5, &a1->FLAlertLayerProtocol);\n    return;\n  }\n  m_hasSFX = a1->m_hasSFX;\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 ( *((_DWORD *)MusicDownloadManager::sharedState()->m_customContentURL.m_data.m_data - 3) )\n    {\n      CustomSongWidget::startMultiAssetDownload(a1);\n      return;\n    }\nLABEL_11:\n    a1->m_hasLibrarySongs = 1;\n    v7 = MusicDownloadManager::sharedState();\n    MusicDownloadManager::getCustomContentURL(v7);\n    return;\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, m_hasSFX);\n  a1->m_cancelDownloadBtn->setVisible(a1->m_cancelDownloadBtn, 1);\n  a1->m_deleteBtn->setVisible(a1->m_deleteBtn, m_hasSFX);\n  if ( a1->m_customSongID > (int)\"s of X position. These triggers need to use <cg>Group ID</c> and have <cy>Spawn Trigger</c> enabled.\\n<cl>Preview Disable</c> disables activation while not playtesting in editor.\\n<cp>Spawn Ordered</c> spawns the triggers in order from left to right.\\nUse remapping (page 2) to copy a Spawn setup to another group.\"\n    && !*((_DWORD *)MusicDownloadManager::sharedState()->m_customContentURL.m_data.m_data - 3) )\n  {\n    goto LABEL_11;\n  }\n  if ( a1->m_songInfoObject->m_verified )\n  {\n    CustomSongWidget::startDownload(a1);\n  }\n  else\n  {\n    a1->m_isNotDownloading = 1;\n    v8 = MusicDownloadManager::sharedState();\n    MusicDownloadManager::getSongInfo(v8, a1->m_customSongID, 1);\n  }\n}", "assembly": "; \n; CustomSongWidget::onDownload from 0x3e01b0 to 0x3e02c2 (274 bytes)\n; \n; 2 xrefs:\n; > CustomSongWidget::musicActionFinished @ 0x3e02dc\n; > CustomSongWidget::FLAlert_Clicked @ 0x3e031e\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            {R3-R5,LR}                                             ; +0x0, 0x3e01b0\nMOV             R4, R0                                                 ; +0x2, 0x3e01b2\nLDR.W           R0, [R0,#0x124]                                        ; +0x4, 0x3e01b4\nMOVS            R1, #0                                                 ; +0x8, 0x3e01b8\nLDR             R3, [R0]                                               ; +0xa, 0x3e01ba\nLDR.W           R3, [R3,#0xA4]                                         ; +0xc, 0x3e01bc\nBLX             R3                                                     ; +0x10, 0x3e01c0\nLDR.W           R0, [R4,#0x154]                                        ; +0x12, 0x3e01c2\nCBZ             R0, loc_3E01D2                                         ; +0x16, 0x3e01c6\nLDR             R3, [R0]                                               ; +0x18, 0x3e01c8\nMOVS            R1, #0                                                 ; +0x1a, 0x3e01ca\nLDR.W           R3, [R3,#0xA4]                                         ; +0x1c, 0x3e01cc\nBLX             R3                                                     ; +0x20, 0x3e01d0\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x22, 0x3e01d2\nLDR             R1, =(a0016 - 0x3E01DC); \"0016\"                        ; +0x26, 0x3e01d6\nADD             R1, PC; \"0016\"                                         ; +0x28, 0x3e01d8\nBL              _ZN11GameManager15getGameVariableEPKc; GameManager::getGameVariable(char const*) ; +0x2a, 0x3e01da\nCBNZ            R0, loc_3E01F0                                         ; +0x2e, 0x3e01de\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0x30, 0x3e01e0\nADD.W           R1, R4, #0x10C                                         ; +0x34, 0x3e01e4\nPOP.W           {R3-R5,LR}                                             ; +0x38, 0x3e01e8\nB.W             _ZN20MusicDownloadManager7showTOSEP20FLAlertLayerProtocol; MusicDownloadManager::showTOS(FLAlertLayerProtocol *) ; +0x3c, 0x3e01ec\nLDRB.W          R5, [R4,#0x175]                                        ; +0x40, 0x3e01f0\nCBZ             R5, loc_3E022A                                         ; +0x44, 0x3e01f4\nLDR.W           R0, [R4,#0x128]                                        ; +0x46, 0x3e01f6\nMOVS            R1, #0                                                 ; +0x4a, 0x3e01fa\nLDR             R3, [R0]                                               ; +0x4c, 0x3e01fc\nLDR.W           R3, [R3,#0xA4]                                         ; +0x4e, 0x3e01fe\nBLX             R3                                                     ; +0x52, 0x3e0202\nLDR.W           R0, [R4,#0x12C]                                        ; +0x54, 0x3e0204\nMOVS            R1, #1                                                 ; +0x58, 0x3e0208\nLDR             R3, [R0]                                               ; +0x5a, 0x3e020a\nLDR.W           R3, [R3,#0xA4]                                         ; +0x5c, 0x3e020c\nBLX             R3                                                     ; +0x60, 0x3e0210\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0x62, 0x3e0212\nLDR.W           R3, [R0,#0x120]                                        ; +0x66, 0x3e0216\nLDR.W           R3, [R3,#-0xC]                                         ; +0x6a, 0x3e021a\nCBZ             R3, loc_3E0282                                         ; +0x6e, 0x3e021e\nMOV             R0, R4; this                                           ; +0x70, 0x3e0220\nPOP.W           {R3-R5,LR}                                             ; +0x72, 0x3e0222\nB.W             _ZN16CustomSongWidget23startMultiAssetDownloadEv; CustomSongWidget::startMultiAssetDownload(void) ; +0x76, 0x3e0226\nLDR.W           R3, [R4,#0x110]                                        ; +0x7a, 0x3e022a\nCMP             R3, #0                                                 ; +0x7e, 0x3e022e\nBEQ             locret_3E02C0                                          ; +0x80, 0x3e0230\nLDR.W           R0, [R4,#0x148]                                        ; +0x82, 0x3e0232\nMOVS            R1, #1                                                 ; +0x86, 0x3e0236\nLDR             R3, [R0]                                               ; +0x88, 0x3e0238\nLDR.W           R3, [R3,#0xA4]                                         ; +0x8a, 0x3e023a\nBLX             R3                                                     ; +0x8e, 0x3e023e\nLDR.W           R0, [R4,#0x128]                                        ; +0x90, 0x3e0240\nMOV             R1, R5                                                 ; +0x94, 0x3e0244\nLDR             R3, [R0]                                               ; +0x96, 0x3e0246\nLDR.W           R3, [R3,#0xA4]                                         ; +0x98, 0x3e0248\nBLX             R3                                                     ; +0x9c, 0x3e024c\nLDR.W           R0, [R4,#0x12C]                                        ; +0x9e, 0x3e024e\nMOVS            R1, #1                                                 ; +0xa2, 0x3e0252\nLDR             R3, [R0]                                               ; +0xa4, 0x3e0254\nLDR.W           R3, [R3,#0xA4]                                         ; +0xa6, 0x3e0256\nBLX             R3                                                     ; +0xaa, 0x3e025a\nLDR.W           R0, [R4,#0x140]                                        ; +0xac, 0x3e025c\nMOV             R1, R5                                                 ; +0xb0, 0x3e0260\nLDR             R3, [R0]                                               ; +0xb2, 0x3e0262\nLDR.W           R3, [R3,#0xA4]                                         ; +0xb4, 0x3e0264\nBLX             R3                                                     ; +0xb8, 0x3e0268\nLDR.W           R2, [R4,#0x164]                                        ; +0xba, 0x3e026a\nLDR             R3, =(aActivatesOther+0x31); \"s of X position. These triggers need to\"... ; +0xbe, 0x3e026e\nCMP             R2, R3                                                 ; +0xc0, 0x3e0270\nBLE             loc_3E0294                                             ; +0xc2, 0x3e0272\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0xc4, 0x3e0274\nLDR.W           R3, [R0,#0x120]                                        ; +0xc8, 0x3e0278\nLDR.W           R3, [R3,#-0xC]                                         ; +0xcc, 0x3e027c\nCBNZ            R3, loc_3E0294                                         ; +0xd0, 0x3e0280\nMOVS            R3, #1                                                 ; +0xd2, 0x3e0282\nSTRB.W          R3, [R4,#0x174]                                        ; +0xd4, 0x3e0284\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0xd8, 0x3e0288\nPOP.W           {R3-R5,LR}                                             ; +0xdc, 0x3e028c\nB.W             _ZN20MusicDownloadManager19getCustomContentURLEv; MusicDownloadManager::getCustomContentURL(void) ; +0xe0, 0x3e0290\nLDR.W           R3, [R4,#0x110]                                        ; +0xe4, 0x3e0294\nLDRB.W          R3, [R3,#0x135]                                        ; +0xe8, 0x3e0298\nCBZ             R3, loc_3E02A8                                         ; +0xec, 0x3e029c\nMOV             R0, R4; this                                           ; +0xee, 0x3e029e\nPOP.W           {R3-R5,LR}                                             ; +0xf0, 0x3e02a0\nB.W             _ZN16CustomSongWidget13startDownloadEv; CustomSongWidget::startDownload(void) ; +0xf4, 0x3e02a4\nMOVS            R5, #1                                                 ; +0xf8, 0x3e02a8\nSTRB.W          R5, [R4,#0x15F]                                        ; +0xfa, 0x3e02aa\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0xfe, 0x3e02ae\nLDR.W           R1, [R4,#0x164]; int                                   ; +0x102, 0x3e02b2\nMOV             R2, R5; bool                                           ; +0x106, 0x3e02b6\nPOP.W           {R3-R5,LR}                                             ; +0x108, 0x3e02b8\nB.W             _ZN20MusicDownloadManager11getSongInfoEib; MusicDownloadManager::getSongInfo(int,bool) ; +0x10c, 0x3e02bc\nPOP             {R3-R5,PC}                                             ; +0x110, 0x3e02c0", "xrefs": ["CustomSongWidget::musicActionFinished @ 0x3e02dc", "CustomSongWidget::FLAlert_Clicked @ 0x3e031e"], "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"}