{"type": "func", "start": 5369536544, "end": 5369537055, "name": "CustomSongWidget::deleteSong", "pseudocode": "// \n// CustomSongWidget::deleteSong from 0x1400ca020 to 0x1400ca21f (511 bytes)\n// \n// 2 xrefs:\n// > CustomSongWidget::FLAlert_Clicked @ 0x1400cda09\n// > <???> @ 0x1406c82bc\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\n// Hidden C++ exception states: #wind=4\nvoid CustomSongWidget::deleteSong(CustomSongWidget *a1)\n{\n  SongInfoObject *m_songInfoObject; // rbx\n  MusicDownloadManager *v3; // rax\n  _QWORD *v4; // rbx\n  FMODAudioEngine *v5; // rcx\n  __int64 v6; // rbx\n  unsigned int m_songID; // ebx\n  MusicDownloadManager *v8; // rax\n  const char *v9; // rcx\n  float v10; // xmm2_4\n  float v11; // xmm1_4\n  __int16 v12; // [rsp+20h] [rbp-48h] BYREF\n  char v13; // [rsp+22h] [rbp-46h]\n  FMODAudioEngine *v14; // [rsp+28h] [rbp-40h]\n  char **v15; // [rsp+30h] [rbp-38h]\n  char *FileName[4]; // [rsp+38h] [rbp-30h] BYREF\n\n  m_songInfoObject = a1->m_songInfoObject;\n  if ( m_songInfoObject )\n  {\n    v15 = FileName;\n    v3 = MusicDownloadManager::sharedState();\n    v4 = (_QWORD *)MusicDownloadManager::pathForSong(v3, FileName, (unsigned int)m_songInfoObject->m_songID);\n    v5 = (FMODAudioEngine *)qword_1406C2E88;\n    if ( !qword_1406C2E88 )\n    {\n      v14 = (FMODAudioEngine *)operator new(0x888u);\n      qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v14);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n      v5 = (FMODAudioEngine *)qword_1406C2E88;\n    }\n    if ( FMODAudioEngine::isMusicPlaying(v5, v4) )\n    {\n      v6 = qword_1406C2E88;\n      if ( !qword_1406C2E88 )\n      {\n        v14 = (FMODAudioEngine *)operator new(0x888u);\n        qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v14);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n        v6 = qword_1406C2E88;\n      }\n      if ( *(_QWORD *)(v6 + 552) )\n        FMOD::ChannelControl::stop(*(FMOD::ChannelControl **)(v6 + 552));\n      sub_14005E0D0((_QWORD *)(v6 + 1064));\n      sub_14005E0D0((_QWORD *)(v6 + 1128));\n      sub_14005E0D0((_QWORD *)(v6 + 1192));\n    }\n    m_songID = a1->m_songInfoObject->m_songID;\n    v8 = MusicDownloadManager::sharedState();\n    MusicDownloadManager::pathForSong(v8, FileName, m_songID);\n    v9 = (const char *)FileName;\n    if ( FileName[3] > (char *)0xF )\n      v9 = FileName[0];\n    remove(v9);\n    sub_14003A830((__int64)FileName);\n    CustomSongWidget::updateSongInfo(a1);\n    v12 = 25855;\n    v13 = 0;\n    a1->m_errorLabel->setColor(&a1->m_errorLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v12);\n    a1->m_errorLabel->setString(&a1->m_errorLabel->cocos2d::CCLabelProtocol, \"Song Deleted\");\n    if ( a1->m_isMusicLibrary )\n    {\n      v10 = 0.34999999;\n      v11 = 140.0;\n    }\n    else\n    {\n      v10 = 0.40000001;\n      v11 = 230.0;\n    }\n    cocos2d::CCLabelBMFont::limitLabelWidth(a1->m_errorLabel, v11, v10, 0.0);\n    CustomSongWidget::showError(a1, 1);\n  }\n}", "assembly": "; \n; CustomSongWidget::deleteSong from 0x1400ca020 to 0x1400ca21f (511 bytes)\n; \n; 2 xrefs:\n; > CustomSongWidget::FLAlert_Clicked @ 0x1400cda09\n; > <???> @ 0x1406c82bc\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\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1400ca020\npush    rdi                                                            ; +0x5, 0x1400ca025\nsub     rsp, 60h                                                       ; +0x6, 0x1400ca026\nmov     rax, cs:__security_cookie                                      ; +0xa, 0x1400ca02a\nxor     rax, rsp                                                       ; +0x11, 0x1400ca031\nmov     [rsp+68h+var_10], rax                                          ; +0x14, 0x1400ca034\nmov     rdi, rcx                                                       ; +0x19, 0x1400ca039\nmov     rbx, [rcx+150h]                                                ; +0x1c, 0x1400ca03c\ntest    rbx, rbx                                                       ; +0x23, 0x1400ca043\njz      loc_1400CA207                                                  ; +0x26, 0x1400ca046\nlea     rax, [rsp+68h+FileName]                                        ; +0x2c, 0x1400ca04c\nmov     [rsp+68h+var_38], rax                                          ; +0x31, 0x1400ca051\ncall    MusicDownloadManager__sharedState                              ; +0x36, 0x1400ca056\nmov     rcx, rax                                                       ; +0x3b, 0x1400ca05b\nmov     r8d, [rbx+140h]                                                ; +0x3e, 0x1400ca05e\nlea     rdx, [rsp+68h+FileName]                                        ; +0x45, 0x1400ca065\ncall    MusicDownloadManager__pathForSong                              ; +0x4a, 0x1400ca06a\nmov     rbx, rax                                                       ; +0x4f, 0x1400ca06f\nmov     rcx, cs:qword_1406C2E88                                        ; +0x52, 0x1400ca072\ntest    rcx, rcx                                                       ; +0x59, 0x1400ca079\njnz     short loc_1400CA0AD                                            ; +0x5c, 0x1400ca07c\nmov     ecx, 888h; Size                                                ; +0x5e, 0x1400ca07e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x63, 0x1400ca083\nmov     [rsp+68h+var_40], rax                                          ; +0x68, 0x1400ca088\nmov     rcx, rax                                                       ; +0x6d, 0x1400ca08d\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x70, 0x1400ca090\nnop                                                                    ; +0x75, 0x1400ca095\nmov     cs:qword_1406C2E88, rax                                        ; +0x76, 0x1400ca096\nmov     rdx, [rax]                                                     ; +0x7d, 0x1400ca09d\nmov     rcx, rax                                                       ; +0x80, 0x1400ca0a0\ncall    qword ptr [rdx+48h]                                            ; +0x83, 0x1400ca0a3\nmov     rcx, cs:qword_1406C2E88                                        ; +0x86, 0x1400ca0a6\nmov     rdx, rbx                                                       ; +0x8d, 0x1400ca0ad\ncall    FMODAudioEngine__isMusicPlaying                                ; +0x90, 0x1400ca0b0\ntest    al, al                                                         ; +0x95, 0x1400ca0b5\njz      short loc_1400CA12F                                            ; +0x97, 0x1400ca0b7\nmov     rbx, cs:qword_1406C2E88                                        ; +0x99, 0x1400ca0b9\ntest    rbx, rbx                                                       ; +0xa0, 0x1400ca0c0\njnz     short loc_1400CA0F4                                            ; +0xa3, 0x1400ca0c3\nmov     ecx, 888h; Size                                                ; +0xa5, 0x1400ca0c5\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0xaa, 0x1400ca0ca\nmov     [rsp+68h+var_40], rax                                          ; +0xaf, 0x1400ca0cf\nmov     rcx, rax                                                       ; +0xb4, 0x1400ca0d4\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0xb7, 0x1400ca0d7\nnop                                                                    ; +0xbc, 0x1400ca0dc\nmov     cs:qword_1406C2E88, rax                                        ; +0xbd, 0x1400ca0dd\nmov     rdx, [rax]                                                     ; +0xc4, 0x1400ca0e4\nmov     rcx, rax                                                       ; +0xc7, 0x1400ca0e7\ncall    qword ptr [rdx+48h]                                            ; +0xca, 0x1400ca0ea\nmov     rbx, cs:qword_1406C2E88                                        ; +0xcd, 0x1400ca0ed\ncmp     qword ptr [rbx+228h], 0                                        ; +0xd4, 0x1400ca0f4\njz      short loc_1400CA10B                                            ; +0xdc, 0x1400ca0fc\nmov     rcx, [rbx+228h]                                                ; +0xde, 0x1400ca0fe\ncall    cs:?stop@ChannelControl@FMOD@@QEAA?AW4FMOD_RESULT@@XZ; FMOD::ChannelControl::stop(void) ; +0xe5, 0x1400ca105\nlea     rcx, [rbx+428h]                                                ; +0xeb, 0x1400ca10b\ncall    sub_14005E0D0                                                  ; +0xf2, 0x1400ca112\nlea     rcx, [rbx+468h]                                                ; +0xf7, 0x1400ca117\ncall    sub_14005E0D0                                                  ; +0xfe, 0x1400ca11e\nlea     rcx, [rbx+4A8h]                                                ; +0x103, 0x1400ca123\ncall    sub_14005E0D0                                                  ; +0x10a, 0x1400ca12a\nmov     rax, [rdi+150h]                                                ; +0x10f, 0x1400ca12f\nmov     ebx, [rax+140h]                                                ; +0x116, 0x1400ca136\ncall    MusicDownloadManager__sharedState                              ; +0x11c, 0x1400ca13c\nmov     r8d, ebx                                                       ; +0x121, 0x1400ca141\nlea     rdx, [rsp+68h+FileName]                                        ; +0x124, 0x1400ca144\nmov     rcx, rax                                                       ; +0x129, 0x1400ca149\ncall    MusicDownloadManager__pathForSong                              ; +0x12c, 0x1400ca14c\nlea     rcx, [rsp+68h+FileName]                                        ; +0x131, 0x1400ca151\ncmp     [rsp+68h+var_18], 0Fh                                          ; +0x136, 0x1400ca156\ncmova   rcx, [rsp+68h+FileName]; FileName                              ; +0x13c, 0x1400ca15c\ncall    cs:remove                                                      ; +0x142, 0x1400ca162\nlea     rcx, [rsp+68h+FileName]                                        ; +0x148, 0x1400ca168\ncall    sub_14003A830                                                  ; +0x14d, 0x1400ca16d\nmov     rcx, rdi                                                       ; +0x152, 0x1400ca172\ncall    CustomSongWidget__updateSongInfo                               ; +0x155, 0x1400ca175\nmov     [rsp+68h+var_48], 64FFh                                        ; +0x15a, 0x1400ca17a\nmovzx   eax, [rsp+68h+var_48]                                          ; +0x161, 0x1400ca181\nmov     [rsp+68h+var_48], ax                                           ; +0x166, 0x1400ca186\nmov     [rsp+68h+var_46], 0                                            ; +0x16b, 0x1400ca18b\nmov     rcx, [rdi+178h]                                                ; +0x170, 0x1400ca190\nadd     rcx, 170h                                                      ; +0x177, 0x1400ca197\nmov     rax, [rcx]                                                     ; +0x17e, 0x1400ca19e\nlea     rdx, [rsp+68h+var_48]                                          ; +0x181, 0x1400ca1a1\ncall    qword ptr [rax]                                                ; +0x186, 0x1400ca1a6\nmov     rcx, [rdi+178h]                                                ; +0x188, 0x1400ca1a8\nadd     rcx, 168h                                                      ; +0x18f, 0x1400ca1af\nmov     rax, [rcx]                                                     ; +0x196, 0x1400ca1b6\nlea     rdx, aSongDeleted; \"Song Deleted\"                              ; +0x199, 0x1400ca1b9\ncall    qword ptr [rax]                                                ; +0x1a0, 0x1400ca1c0\nxorps   xmm3, xmm3                                                     ; +0x1a2, 0x1400ca1c2\nmov     rcx, [rdi+178h]                                                ; +0x1a5, 0x1400ca1c5\ncmp     byte ptr [rdi+1EDh], 0                                         ; +0x1ac, 0x1400ca1cc\njz      short loc_1400CA1E7                                            ; +0x1b3, 0x1400ca1d3\nmovss   xmm2, cs:dword_140622ABC                                       ; +0x1b5, 0x1400ca1d5\nmovss   xmm1, cs:dword_140623338                                       ; +0x1bd, 0x1400ca1dd\njmp     short loc_1400CA1F7                                            ; +0x1c5, 0x1400ca1e5\nmovss   xmm2, cs:dword_140622AD0                                       ; +0x1c7, 0x1400ca1e7\nmovss   xmm1, cs:dword_140623400                                       ; +0x1cf, 0x1400ca1ef\ncall    cs:?limitLabelWidth@CCLabelBMFont@cocos2d@@QEAAXMMM@Z; cocos2d::CCLabelBMFont::limitLabelWidth(float,float,float) ; +0x1d7, 0x1400ca1f7\nmov     dl, 1                                                          ; +0x1dd, 0x1400ca1fd\nmov     rcx, rdi                                                       ; +0x1df, 0x1400ca1ff\ncall    CustomSongWidget__showError                                    ; +0x1e2, 0x1400ca202\nmov     rcx, [rsp+68h+var_10]                                          ; +0x1e7, 0x1400ca207\nxor     rcx, rsp; StackCookie                                          ; +0x1ec, 0x1400ca20c\ncall    __security_check_cookie                                        ; +0x1ef, 0x1400ca20f\nmov     rbx, [rsp+68h+arg_8]                                           ; +0x1f4, 0x1400ca214\nadd     rsp, 60h                                                       ; +0x1f9, 0x1400ca219\npop     rdi                                                            ; +0x1fd, 0x1400ca21d\nretn                                                                   ; +0x1fe, 0x1400ca21e", "xrefs": ["CustomSongWidget::FLAlert_Clicked @ 0x1400cda09", "<???> @ 0x1406c82bc"], "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"}