{"type": "func", "start": 5369502256, "end": 5369502501, "name": "CustomSFXWidget::onDownload", "pseudocode": "// \n// CustomSFXWidget::onDownload from 0x1400c1a30 to 0x1400c1b25 (245 bytes)\n// \n// 3 xrefs:\n// > CustomSFXWidget::FLAlert_Clicked @ 0x1400c295a\n// > CustomSFXWidget::init @ 0x1400c0d69\n// > <???> @ 0x1406c7f80\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=1\nvoid CustomSFXWidget::onDownload(CustomSFXWidget *a1, cocos2d::CCObject *a2)\n{\n  GameManager *v3; // rcx\n  MusicDownloadManager *v4; // rcx\n  _BOOL8 v5; // rdx\n  MusicDownloadManager *v6; // rax\n  void *v7; // [rsp+30h] [rbp+8h]\n\n  a1->m_errorLabel->setVisible(a1->m_errorLabel, 0);\n  if ( a1->m_sfxObject )\n  {\n    v3 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v7 = operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00(v7);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v3 = (GameManager *)qword_1406C2ED8;\n    }\n    if ( GameManager::getGameVariable(v3, \"0016\") )\n    {\n      CustomSFXWidget::showLoadingArt(a1);\n      a1->m_downloadButton->setVisible(a1->m_downloadButton, 0);\n      LOBYTE(v5) = 1;\n      a1->m_cancelButton->setVisible(a1->m_cancelButton, v5);\n      a1->m_deleteButton->setVisible(a1->m_deleteButton, 0);\n      a1->m_showCancel = 0;\n      v6 = MusicDownloadManager::sharedState();\n      MusicDownloadManager::downloadSFX(v6, a1->m_sfxID);\n      CustomSFXWidget::startMonitorDownload(a1);\n    }\n    else\n    {\n      MusicDownloadManager::sharedState();\n      MusicDownloadManager::showTOS(v4, &a1->FLAlertLayerProtocol);\n    }\n  }\n}", "assembly": "; \n; CustomSFXWidget::onDownload from 0x1400c1a30 to 0x1400c1b25 (245 bytes)\n; \n; 3 xrefs:\n; > CustomSFXWidget::FLAlert_Clicked @ 0x1400c295a\n; > CustomSFXWidget::init @ 0x1400c0d69\n; > <???> @ 0x1406c7f80\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    rbx                                                            ; +0x0, 0x1400c1a30\nsub     rsp, 20h                                                       ; +0x2, 0x1400c1a32\nmov     rbx, rcx                                                       ; +0x6, 0x1400c1a36\nmov     rcx, [rcx+170h]                                                ; +0x9, 0x1400c1a39\nmov     rax, [rcx]                                                     ; +0x10, 0x1400c1a40\nxor     edx, edx                                                       ; +0x13, 0x1400c1a43\ncall    qword ptr [rax+140h]                                           ; +0x15, 0x1400c1a45\ncmp     qword ptr [rbx+150h], 0                                        ; +0x1b, 0x1400c1a4b\njz      loc_1400C1B1F                                                  ; +0x23, 0x1400c1a53\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x29, 0x1400c1a59\ntest    rcx, rcx                                                       ; +0x30, 0x1400c1a60\njnz     short loc_1400C1A94                                            ; +0x33, 0x1400c1a63\nmov     ecx, 668h; Size                                                ; +0x35, 0x1400c1a65\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x3a, 0x1400c1a6a\nmov     [rsp+28h+arg_0], rax                                           ; +0x3f, 0x1400c1a6f\nmov     rcx, rax                                                       ; +0x44, 0x1400c1a74\ncall    sub_14017AB00                                                  ; +0x47, 0x1400c1a77\nnop                                                                    ; +0x4c, 0x1400c1a7c\nmov     cs:qword_1406C2ED8, rax                                        ; +0x4d, 0x1400c1a7d\nmov     rdx, [rax]                                                     ; +0x54, 0x1400c1a84\nmov     rcx, rax                                                       ; +0x57, 0x1400c1a87\ncall    qword ptr [rdx+48h]                                            ; +0x5a, 0x1400c1a8a\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x5d, 0x1400c1a8d\nlea     rdx, a0016; \"0016\"                                             ; +0x64, 0x1400c1a94\ncall    GameManager__getGameVariable                                   ; +0x6b, 0x1400c1a9b\ntest    al, al                                                         ; +0x70, 0x1400c1aa0\njnz     short loc_1400C1ABA                                            ; +0x72, 0x1400c1aa2\ncall    MusicDownloadManager__sharedState                              ; +0x74, 0x1400c1aa4\nlea     rdx, [rbx+148h]                                                ; +0x79, 0x1400c1aa9\nadd     rsp, 20h                                                       ; +0x80, 0x1400c1ab0\npop     rbx                                                            ; +0x84, 0x1400c1ab4\njmp     MusicDownloadManager__showTOS                                  ; +0x85, 0x1400c1ab5\nmov     rcx, rbx                                                       ; +0x8a, 0x1400c1aba\ncall    CustomSFXWidget__showLoadingArt                                ; +0x8d, 0x1400c1abd\nmov     rcx, [rbx+178h]                                                ; +0x92, 0x1400c1ac2\nmov     rax, [rcx]                                                     ; +0x99, 0x1400c1ac9\nxor     edx, edx                                                       ; +0x9c, 0x1400c1acc\ncall    qword ptr [rax+140h]                                           ; +0x9e, 0x1400c1ace\nmov     rcx, [rbx+180h]                                                ; +0xa4, 0x1400c1ad4\nmov     rax, [rcx]                                                     ; +0xab, 0x1400c1adb\nmov     dl, 1                                                          ; +0xae, 0x1400c1ade\ncall    qword ptr [rax+140h]                                           ; +0xb0, 0x1400c1ae0\nmov     rcx, [rbx+198h]                                                ; +0xb6, 0x1400c1ae6\nmov     rax, [rcx]                                                     ; +0xbd, 0x1400c1aed\nxor     edx, edx                                                       ; +0xc0, 0x1400c1af0\ncall    qword ptr [rax+140h]                                           ; +0xc2, 0x1400c1af2\nmov     byte ptr [rbx+1C3h], 0                                         ; +0xc8, 0x1400c1af8\ncall    MusicDownloadManager__sharedState                              ; +0xcf, 0x1400c1aff\nmov     rcx, rax                                                       ; +0xd4, 0x1400c1b04\nmov     edx, [rbx+1C8h]                                                ; +0xd7, 0x1400c1b07\ncall    MusicDownloadManager__downloadSFX                              ; +0xdd, 0x1400c1b0d\nmov     rcx, rbx                                                       ; +0xe2, 0x1400c1b12\nadd     rsp, 20h                                                       ; +0xe5, 0x1400c1b15\npop     rbx                                                            ; +0xe9, 0x1400c1b19\njmp     CustomSFXWidget__startMonitorDownload                          ; +0xea, 0x1400c1b1a\nadd     rsp, 20h                                                       ; +0xef, 0x1400c1b1f\npop     rbx                                                            ; +0xf3, 0x1400c1b23\nretn                                                                   ; +0xf4, 0x1400c1b24", "xrefs": ["CustomSFXWidget::FLAlert_Clicked @ 0x1400c295a", "CustomSFXWidget::init @ 0x1400c0d69", "<???> @ 0x1406c7f80"], "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"}