{"type": "func", "start": 7632072, "end": 7632524, "name": "CustomSongWidget::deleteSong", "pseudocode": "// \n// CustomSongWidget::deleteSong from 0x7474c8 to 0x74768c (452 bytes)\n// \n// 2 xrefs:\n// > CustomSongWidget::FLAlert_Clicked @ 0x748320\n// > <???> @ 0x536a0\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::deleteSong(CustomSongWidget *a1)\n{\n  FMODAudioEngine *v2; // x22\n  MusicDownloadManager *v3; // x0\n  _BOOL4 isMusicPlaying; // w22\n  void *v5; // x0\n  MusicDownloadManager *v6; // x0\n  cocos2d::CCLabelBMFont *m_errorLabel; // x0\n  void (__fastcall *setColor)(cocos2d::CCLabelBMFont *__hidden, const cocos2d::ccColor3B *); // x2\n  FMODAudioEngine *v9; // x0\n  unsigned int *v10; // x2\n  int v11; // w1\n  __int64 v12; // [xsp+0h] [xbp+0h] BYREF\n  __int64 v13; // [xsp+40h] [xbp+40h] BYREF\n\n  if ( a1->m_songInfoObject )\n  {\n    v2 = FMODAudioEngine::sharedEngine();\n    v3 = MusicDownloadManager::sharedState();\n    MusicDownloadManager::pathForSong(&v13, v3, a1->m_songInfoObject->m_songID);\n    isMusicPlaying = FMODAudioEngine::isMusicPlaying(v2, (unsigned int)&v12 + 64);\n    v5 = (void *)(v13 - 24);\n    if ( (__int64 *)(v13 - 24) != &qword_124B6B0 )\n    {\n      if ( &pthread_create )\n      {\n        v10 = (unsigned int *)(v13 - 8);\n        do\n          v11 = __ldaxr(v10);\n        while ( __stlxr(v11 - 1, v10) );\n      }\n      else\n      {\n        v11 = *(_DWORD *)(v13 - 8);\n        *(_DWORD *)(v13 - 8) = v11 - 1;\n      }\n      if ( v11 <= 0 )\n        operator delete(v5);\n    }\n    if ( isMusicPlaying )\n    {\n      v9 = FMODAudioEngine::sharedEngine();\n      FMODAudioEngine::stopAllMusic(v9, 1);\n    }\n    v6 = MusicDownloadManager::sharedState();\n    MusicDownloadManager::deleteSong(v6, a1->m_songInfoObject->m_songID);\n    CustomSongWidget::updateSongInfo(a1);\n    m_errorLabel = a1->m_errorLabel;\n    setColor = m_errorLabel->setColor;\n    LOBYTE(v13) = -1;\n    *(_WORD *)((char *)&v13 + 1) = 100;\n    setColor(m_errorLabel, (const cocos2d::ccColor3B *)&v13);\n    a1->m_errorLabel->setString(a1->m_errorLabel, \"Song Deleted\");\n    if ( a1->m_isMusicLibrary )\n      cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_errorLabel, 140.0, 0.35, 0.0);\n    else\n      cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_errorLabel, 230.0, 0.4, 0.0);\n    CustomSongWidget::showError(a1, 1);\n  }\n}", "assembly": "; \n; CustomSongWidget::deleteSong from 0x7474c8 to 0x74768c (452 bytes)\n; \n; 2 xrefs:\n; > CustomSongWidget::FLAlert_Clicked @ 0x748320\n; > <???> @ 0x536a0\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_50]!                                ; +0x0, 0x7474c8\nMOV             X29, SP                                                ; +0x4, 0x7474cc\nSTP             X19, X20, [SP,#0x50+var_40]                            ; +0x8, 0x7474d0\nADRP            X20, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x7474d4\nMOV             X19, X0                                                ; +0x10, 0x7474d8\nLDR             X0, [X0,#0x150]; this                                  ; +0x14, 0x7474dc\nSTP             X21, X22, [SP,#0x50+var_30]                            ; +0x18, 0x7474e0\nLDR             X1, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x7474e4\nLDR             X1, [X1]                                               ; +0x20, 0x7474e8\nSTR             X1, [X29,#0x50+var_8]                                  ; +0x24, 0x7474ec\nCBZ             X0, loc_7475CC                                         ; +0x28, 0x7474f0\nBL              _ZN15FMODAudioEngine12sharedEngineEv; FMODAudioEngine::sharedEngine(void) ; +0x2c, 0x7474f4\nMOV             X22, X0                                                ; +0x30, 0x7474f8\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0x34, 0x7474fc\nADD             X21, X29, #0x50+var_10                                 ; +0x38, 0x747500\nLDR             X1, [X19,#0x150]                                       ; +0x3c, 0x747504\nMOV             X8, X21                                                ; +0x40, 0x747508\nLDR             W1, [X1,#0x13C]; int                                   ; +0x44, 0x74750c\nBL              _ZN20MusicDownloadManager11pathForSongEi; MusicDownloadManager::pathForSong(int) ; +0x48, 0x747510\nMOV             X0, X22; int                                           ; +0x4c, 0x747514\nMOV             X1, X21; int                                           ; +0x50, 0x747518\nMOV             W2, #0; int                                            ; +0x54, 0x74751c\nBL              _ZN15FMODAudioEngine14isMusicPlayingESsi; FMODAudioEngine::isMusicPlaying(std::string,int) ; +0x58, 0x747520\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x5c, 0x747524\nLDR             X2, [X29,#0x50+var_10]                                 ; +0x60, 0x747528\nUXTB            W22, W0                                                ; +0x64, 0x74752c\nSUB             X0, X2, #0x18; this                                    ; +0x68, 0x747530\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x6c, 0x747534\nCMP             X0, X1                                                 ; +0x70, 0x747538\nB.NE            loc_747618                                             ; +0x74, 0x74753c\nCBNZ            W22, loc_747608                                        ; +0x78, 0x747540\nBL              _ZN20MusicDownloadManager11sharedStateEv; MusicDownloadManager::sharedState(void) ; +0x7c, 0x747544\nLDR             X1, [X19,#0x150]                                       ; +0x80, 0x747548\nLDR             W1, [X1,#0x13C]; int                                   ; +0x84, 0x74754c\nBL              _ZN20MusicDownloadManager10deleteSongEi; MusicDownloadManager::deleteSong(int) ; +0x88, 0x747550\nMOV             X0, X19; this                                          ; +0x8c, 0x747554\nBL              _ZN16CustomSongWidget14updateSongInfoEv; CustomSongWidget::updateSongInfo(void) ; +0x90, 0x747558\nLDR             X2, [X19,#0x178]                                       ; +0x94, 0x74755c\nMOV             W3, #0xFFFFFFFF                                        ; +0x98, 0x747560\nMOV             X1, X21                                                ; +0x9c, 0x747564\nMOV             X0, X2                                                 ; +0xa0, 0x747568\nLDR             X2, [X2]                                               ; +0xa4, 0x74756c\nLDR             X2, [X2,#0x420]                                        ; +0xa8, 0x747570\nSTRB            W3, [X29,#0x50+var_10]                                 ; +0xac, 0x747574\nMOV             W3, #0x64 ; 'd'                                        ; +0xb0, 0x747578\nSTRB            WZR, [X29,#0x50+var_10+2]                              ; +0xb4, 0x74757c\nSTRB            W3, [X29,#0x50+var_10+1]                               ; +0xb8, 0x747580\nBLR             X2                                                     ; +0xbc, 0x747584\nLDR             X2, [X19,#0x178]                                       ; +0xc0, 0x747588\nADRL            X1, aSongDeleted; \"Song Deleted\"                       ; +0xc4, 0x74758c\nMOV             X0, X2                                                 ; +0xcc, 0x747594\nLDR             X2, [X2]                                               ; +0xd0, 0x747598\nLDR             X2, [X2,#0x390]                                        ; +0xd4, 0x74759c\nBLR             X2                                                     ; +0xd8, 0x7475a0\nLDRB            W0, [X19,#0x1ED]                                       ; +0xdc, 0x7475a4\nCBNZ            W0, loc_7475F0                                         ; +0xe0, 0x7475a8\nLDR             S0, flt_747694; float                                  ; +0xe4, 0x7475ac\nLDR             X0, [X19,#0x178]; this                                 ; +0xe8, 0x7475b0\nLDR             S1, flt_747698; float                                  ; +0xec, 0x7475b4\nFMOV            S2, WZR; float                                         ; +0xf0, 0x7475b8\nBL              _ZN7cocos2d13CCLabelBMFont15limitLabelWidthEfff; cocos2d::CCLabelBMFont::limitLabelWidth(float,float,float) ; +0xf4, 0x7475bc\nMOV             X0, X19; this                                          ; +0xf8, 0x7475c0\nMOV             W1, #1; bool                                           ; +0xfc, 0x7475c4\nBL              _ZN16CustomSongWidget9showErrorEb; CustomSongWidget::showError(bool) ; +0x100, 0x7475c8\nLDR             X20, [X20,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x104, 0x7475cc\nLDR             X1, [X29,#0x50+var_8]                                  ; +0x108, 0x7475d0\nLDR             X0, [X20]                                              ; +0x10c, 0x7475d4\nCMP             X1, X0                                                 ; +0x110, 0x7475d8\nB.NE            loc_74765C                                             ; +0x114, 0x7475dc\nLDP             X19, X20, [SP,#0x50+var_40]                            ; +0x118, 0x7475e0\nLDP             X21, X22, [SP,#0x50+var_30]                            ; +0x11c, 0x7475e4\nLDP             X29, X30, [SP+0x50+var_50],#0x50                       ; +0x120, 0x7475e8\nRET                                                                    ; +0x124, 0x7475ec\nLDR             S0, flt_74768C; float                                  ; +0x128, 0x7475f0\nLDR             X0, [X19,#0x178]; this                                 ; +0x12c, 0x7475f4\nLDR             S1, flt_747690; float                                  ; +0x130, 0x7475f8\nFMOV            S2, WZR; float                                         ; +0x134, 0x7475fc\nBL              _ZN7cocos2d13CCLabelBMFont15limitLabelWidthEfff; cocos2d::CCLabelBMFont::limitLabelWidth(float,float,float) ; +0x138, 0x747600\nB               loc_7475C0                                             ; +0x13c, 0x747604\nBL              _ZN15FMODAudioEngine12sharedEngineEv; FMODAudioEngine::sharedEngine(void) ; +0x140, 0x747608\nMOV             W1, #1; bool                                           ; +0x144, 0x74760c\nBL              _ZN15FMODAudioEngine12stopAllMusicEb; FMODAudioEngine::stopAllMusic(bool) ; +0x148, 0x747610\nB               loc_747544                                             ; +0x14c, 0x747614\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x150, 0x747618\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x154, 0x74761c\nCBZ             X1, loc_74764C                                         ; +0x158, 0x747620\nSUB             X2, X2, #8                                             ; +0x15c, 0x747624\nLDAXR           W1, [X2]                                               ; +0x160, 0x747628\nSUB             W3, W1, #1                                             ; +0x164, 0x74762c\nSTLXR           W4, W3, [X2]                                           ; +0x168, 0x747630\nCBNZ            W4, loc_747628                                         ; +0x16c, 0x747634\nCMP             W1, WZR                                                ; +0x170, 0x747638\nB.GT            loc_747540                                             ; +0x174, 0x74763c\nADD             X1, X29, #0x50+var_18                                  ; +0x178, 0x747640\nBL              j__ZdlPv; operator delete(void *)                      ; +0x17c, 0x747644\nB               loc_747540                                             ; +0x180, 0x747648\nLDUR            W1, [X2,#-8]                                           ; +0x184, 0x74764c\nSUB             W3, W1, #1                                             ; +0x188, 0x747650\nSTUR            W3, [X2,#-8]                                           ; +0x18c, 0x747654\nB               loc_747638                                             ; +0x190, 0x747658\nBL              .__stack_chk_fail                                      ; +0x194, 0x74765c\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x198, 0x747660\nMOV             X19, X0                                                ; +0x19c, 0x747664\nLDR             X0, [X29,#0x50+var_10]                                 ; +0x1a0, 0x747668\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x1a4, 0x74766c\nSUB             X0, X0, #0x18                                          ; +0x1a8, 0x747670\nCMP             X0, X1                                                 ; +0x1ac, 0x747674\nB.EQ            loc_747684                                             ; +0x1b0, 0x747678\nADD             X1, X29, #0x50+var_18                                  ; +0x1b4, 0x74767c\nBL              sub_4DBA38                                             ; +0x1b8, 0x747680\nMOV             X0, X19                                                ; +0x1bc, 0x747684\nBL              _Unwind_Resume                                         ; +0x1c0, 0x747688", "xrefs": ["CustomSongWidget::FLAlert_Clicked @ 0x748320", "<???> @ 0x536a0"], "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"}