{"type": "func", "start": 4301142384, "end": 4301142726, "name": "CustomSFXWidget::onDownload", "pseudocode": "// \n// CustomSFXWidget::onDownload from 0x1005e3970 to 0x1005e3ac6 (342 bytes)\n// \n// 3 xrefs:\n// > CustomSFXWidget::FLAlert_Clicked @ 0x1005e4ea5\n// > sub_1005E4EC0 @ 0x1005e4f0c\n// > CustomSFXWidget::init @ 0x1005e2f73\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 __fastcall CustomSFXWidget::onDownload(CustomSFXWidget *a1, cocos2d::CCObject *a2)\n{\n  GameManager *v2; // rax\n  MusicDownloadManager *v3; // rax\n  cocos2d::CCSprite *m_progressBarSprite; // r14\n  __m128 width_low; // xmm0\n  __m128 v6; // xmm2\n  MusicDownloadManager *v7; // rax\n  _BYTE v8[40]; // [rsp+8h] [rbp-28h] BYREF\n\n  ((void (__fastcall *)(cocos2d::CCLabelBMFont *, _QWORD))a1->m_errorLabel->setVisible)(a1->m_errorLabel, 0);\n  if ( a1->m_sfxObject )\n  {\n    v2 = GameManager::sharedState();\n    if ( GameManager::getGameVariable(v2, \"0016\") )\n    {\n      CustomSFXWidget::showLoadingArt(a1);\n      ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_downloadButton->setVisible)(a1->m_downloadButton, 0);\n      ((void (__fastcall *)(CCMenuItemSpriteExtra *, __int64))a1->m_cancelButton->setVisible)(a1->m_cancelButton, 1);\n      ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_deleteButton->setVisible)(a1->m_deleteButton, 0);\n      a1->m_showCancel = 0;\n      v3 = MusicDownloadManager::sharedState();\n      MusicDownloadManager::downloadSFX(v3, a1->m_sfxID);\n      m_progressBarSprite = a1->m_progressBarSprite;\n      width_low = (__m128)LODWORD(a1->m_progressOutlineSprite->m_obRect.size.width);\n      width_low.f32[0] = width_low.f32[0] + -4.0;\n      v6 = width_low;\n      v6.f32[0] = fminf(width_low.f32[0] * 0.0, width_low.f32[0]);\n      sub_10028CC00((__int64)v8, 0.0, 0.0, v6, (__m128)0x41000000u);\n      ((void (__fastcall *)(cocos2d::CCSprite *, _BYTE *))m_progressBarSprite->setTextureRect)(m_progressBarSprite, v8);\n      CustomSFXWidget::showLoadingArt(a1);\n      cocos2d::CCNode::unschedule(a1, (cocos2d::SEL_SCHEDULE)(unsigned __int64)CustomSFXWidget::updateDownloadProgress);\n      cocos2d::CCNode::schedule_1(\n        a1,\n        (cocos2d::SEL_SCHEDULE)(unsigned __int64)CustomSFXWidget::updateDownloadProgress,\n        0.033333335);\n    }\n    else\n    {\n      v7 = MusicDownloadManager::sharedState();\n      MusicDownloadManager::showTOS(v7, &a1->FLAlertLayerProtocol);\n    }\n  }\n}", "assembly": "; \n; CustomSFXWidget::onDownload from 0x1005e3970 to 0x1005e3ac6 (342 bytes)\n; \n; 3 xrefs:\n; > CustomSFXWidget::FLAlert_Clicked @ 0x1005e4ea5\n; > sub_1005E4EC0 @ 0x1005e4f0c\n; > CustomSFXWidget::init @ 0x1005e2f73\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    rbp                                                            ; +0x0, 0x1005e3970\nmov     rbp, rsp                                                       ; +0x1, 0x1005e3971\npush    r15                                                            ; +0x4, 0x1005e3974\npush    r14                                                            ; +0x6, 0x1005e3976\npush    rbx                                                            ; +0x8, 0x1005e3978\nsub     rsp, 18h                                                       ; +0x9, 0x1005e3979\nmov     rbx, rdi                                                       ; +0xd, 0x1005e397d\nmov     rdi, [rdi+170h]                                                ; +0x10, 0x1005e3980\nmov     rax, [rdi]                                                     ; +0x17, 0x1005e3987\nxor     esi, esi                                                       ; +0x1a, 0x1005e398a\ncall    qword ptr [rax+148h]                                           ; +0x1c, 0x1005e398c\ncmp     qword ptr [rbx+150h], 0                                        ; +0x22, 0x1005e3992\njz      loc_1005E3A9A                                                  ; +0x2a, 0x1005e399a\ncall    GameManager__sharedState                                       ; +0x30, 0x1005e39a0\nlea     rsi, a0016; \"0016\"                                             ; +0x35, 0x1005e39a5\nmov     rdi, rax                                                       ; +0x3c, 0x1005e39ac\ncall    GameManager__getGameVariable                                   ; +0x3f, 0x1005e39af\ntest    al, al                                                         ; +0x44, 0x1005e39b4\njz      loc_1005E3AA5                                                  ; +0x46, 0x1005e39b6\nmov     rdi, rbx                                                       ; +0x4c, 0x1005e39bc\ncall    CustomSFXWidget__showLoadingArt                                ; +0x4f, 0x1005e39bf\nmov     rdi, [rbx+178h]                                                ; +0x54, 0x1005e39c4\nmov     rax, [rdi]                                                     ; +0x5b, 0x1005e39cb\nxor     esi, esi                                                       ; +0x5e, 0x1005e39ce\ncall    qword ptr [rax+148h]                                           ; +0x60, 0x1005e39d0\nmov     rdi, [rbx+180h]                                                ; +0x66, 0x1005e39d6\nmov     rax, [rdi]                                                     ; +0x6d, 0x1005e39dd\nmov     esi, 1                                                         ; +0x70, 0x1005e39e0\ncall    qword ptr [rax+148h]                                           ; +0x75, 0x1005e39e5\nmov     rdi, [rbx+198h]                                                ; +0x7b, 0x1005e39eb\nmov     rax, [rdi]                                                     ; +0x82, 0x1005e39f2\nxor     esi, esi                                                       ; +0x85, 0x1005e39f5\ncall    qword ptr [rax+148h]                                           ; +0x87, 0x1005e39f7\nmov     byte ptr [rbx+1C3h], 0                                         ; +0x8d, 0x1005e39fd\ncall    MusicDownloadManager__sharedState                              ; +0x94, 0x1005e3a04\nmov     esi, [rbx+1C8h]                                                ; +0x99, 0x1005e3a09\nmov     rdi, rax                                                       ; +0x9f, 0x1005e3a0f\ncall    MusicDownloadManager__downloadSFX                              ; +0xa2, 0x1005e3a12\nmov     rax, [rbx+1A0h]                                                ; +0xa7, 0x1005e3a17\nmov     r14, [rbx+1A8h]                                                ; +0xae, 0x1005e3a1e\nmovss   xmm0, dword ptr [rax+1B0h]                                     ; +0xb5, 0x1005e3a25\naddss   xmm0, cs:dword_100815290                                       ; +0xbd, 0x1005e3a2d\nxorps   xmm1, xmm1                                                     ; +0xc5, 0x1005e3a35\nmovaps  xmm2, xmm0                                                     ; +0xc8, 0x1005e3a38\nmulss   xmm2, xmm1                                                     ; +0xcb, 0x1005e3a3b\nminss   xmm2, xmm0                                                     ; +0xcf, 0x1005e3a3f\nlea     r15, [rbp+var_28]                                              ; +0xd3, 0x1005e3a43\nmovss   xmm3, cs:dword_100815034                                       ; +0xd7, 0x1005e3a47\nxorps   xmm0, xmm0                                                     ; +0xdf, 0x1005e3a4f\nmov     rdi, r15                                                       ; +0xe2, 0x1005e3a52\ncall    sub_10028CC00                                                  ; +0xe5, 0x1005e3a55\nmov     rax, [r14]                                                     ; +0xea, 0x1005e3a5a\nmov     rdi, r14                                                       ; +0xed, 0x1005e3a5d\nmov     rsi, r15                                                       ; +0xf0, 0x1005e3a60\ncall    qword ptr [rax+460h]                                           ; +0xf3, 0x1005e3a63\nmov     rdi, rbx                                                       ; +0xf9, 0x1005e3a69\ncall    CustomSFXWidget__showLoadingArt                                ; +0xfc, 0x1005e3a6c\nlea     r14, CustomSFXWidget__updateDownloadProgress                   ; +0x101, 0x1005e3a71\nmov     rdi, rbx                                                       ; +0x108, 0x1005e3a78\nmov     rsi, r14                                                       ; +0x10b, 0x1005e3a7b\nxor     edx, edx                                                       ; +0x10e, 0x1005e3a7e\ncall    cocos2d__CCNode__unschedule                                    ; +0x110, 0x1005e3a80\nmovss   xmm0, cs:dword_10081646C                                       ; +0x115, 0x1005e3a85\nmov     rdi, rbx                                                       ; +0x11d, 0x1005e3a8d\nmov     rsi, r14                                                       ; +0x120, 0x1005e3a90\nxor     edx, edx                                                       ; +0x123, 0x1005e3a93\ncall    cocos2d__CCNode__schedule_1                                    ; +0x125, 0x1005e3a95\nadd     rsp, 18h                                                       ; +0x12a, 0x1005e3a9a\npop     rbx                                                            ; +0x12e, 0x1005e3a9e\npop     r14                                                            ; +0x12f, 0x1005e3a9f\npop     r15                                                            ; +0x131, 0x1005e3aa1\npop     rbp                                                            ; +0x133, 0x1005e3aa3\nretn                                                                   ; +0x134, 0x1005e3aa4\ncall    MusicDownloadManager__sharedState                              ; +0x135, 0x1005e3aa5\nadd     rbx, 148h                                                      ; +0x13a, 0x1005e3aaa\nmov     rdi, rax                                                       ; +0x141, 0x1005e3ab1\nmov     rsi, rbx                                                       ; +0x144, 0x1005e3ab4\nadd     rsp, 18h                                                       ; +0x147, 0x1005e3ab7\npop     rbx                                                            ; +0x14b, 0x1005e3abb\npop     r14                                                            ; +0x14c, 0x1005e3abc\npop     r15                                                            ; +0x14e, 0x1005e3abe\npop     rbp                                                            ; +0x150, 0x1005e3ac0\njmp     MusicDownloadManager__showTOS                                  ; +0x151, 0x1005e3ac1", "xrefs": ["CustomSFXWidget::FLAlert_Clicked @ 0x1005e4ea5", "sub_1005E4EC0 @ 0x1005e4f0c", "CustomSFXWidget::init @ 0x1005e2f73"], "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"}