{"type": "func", "start": 4302006560, "end": 4302006902, "name": "CustomSFXWidget::onDownload", "pseudocode": "// \n// CustomSFXWidget::onDownload from 0x1006b6920 to 0x1006b6a76 (342 bytes)\n// \n// 3 xrefs:\n// > CustomSFXWidget::FLAlert_Clicked @ 0x1006b8a55\n// > sub_1006B8A70 @ 0x1006b8abc\n// > CustomSFXWidget::init @ 0x1006b5a43\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 12:35:27 +0000\n// \n\n__int64 __fastcall CustomSFXWidget::onDownload(__int64 a1)\n{\n  __int64 result; // rax\n  __int64 v2; // rax\n  __int64 v3; // rax\n  __int64 v4; // r14\n  __m128 v5; // xmm0\n  __m128 v6; // xmm2\n  __int64 v7; // rax\n  _BYTE v8[40]; // [rsp+8h] [rbp-28h] BYREF\n\n  result = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 368) + 344LL))(*(_QWORD *)(a1 + 368), 0);\n  if ( *(_QWORD *)(a1 + 336) )\n  {\n    v2 = GameManager::sharedState();\n    if ( (unsigned __int8)GameManager::getGameVariable(v2, \"0016\") )\n    {\n      CustomSFXWidget::showLoadingArt(a1);\n      (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 376) + 344LL))(*(_QWORD *)(a1 + 376), 0);\n      (*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 384) + 344LL))(*(_QWORD *)(a1 + 384), 1);\n      (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 408) + 344LL))(*(_QWORD *)(a1 + 408), 0);\n      *(_BYTE *)(a1 + 491) = 0;\n      v3 = MusicDownloadManager::sharedState();\n      MusicDownloadManager::downloadSFX(v3, *(_DWORD *)(a1 + 496));\n      v4 = *(_QWORD *)(a1 + 464);\n      v5 = (__m128)*(unsigned int *)(*(_QWORD *)(a1 + 456) + 432LL);\n      v5.f32[0] = v5.f32[0] + -4.0;\n      v6 = v5;\n      v6.f32[0] = fminf(v5.f32[0] * 0.0, v5.f32[0]);\n      sub_100278270((__int64)v8, 0.0, 0.0, v6, (__m128)0x41000000u);\n      (*(void (__fastcall **)(__int64, _BYTE *))(*(_QWORD *)v4 + 1136LL))(v4, v8);\n      CustomSFXWidget::showLoadingArt(a1);\n      cocos2d::CCNode::unschedule(a1, (__int64)CustomSFXWidget::updateDownloadProgress, 0);\n      return cocos2d::CCNode::schedule_1(\n               a1,\n               (__int64)CustomSFXWidget::updateDownloadProgress,\n               0,\n               COERCE_DOUBLE(1023969417));\n    }\n    else\n    {\n      v7 = MusicDownloadManager::sharedState();\n      return MusicDownloadManager::showTOS(v7, (int)a1 + 328);\n    }\n  }\n  return result;\n}", "assembly": "; \n; CustomSFXWidget::onDownload from 0x1006b6920 to 0x1006b6a76 (342 bytes)\n; \n; 3 xrefs:\n; > CustomSFXWidget::FLAlert_Clicked @ 0x1006b8a55\n; > sub_1006B8A70 @ 0x1006b8abc\n; > CustomSFXWidget::init @ 0x1006b5a43\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 12:35:27 +0000\n; \npush    rbp                                                            ; +0x0, 0x1006b6920\nmov     rbp, rsp                                                       ; +0x1, 0x1006b6921\npush    r15                                                            ; +0x4, 0x1006b6924\npush    r14                                                            ; +0x6, 0x1006b6926\npush    rbx                                                            ; +0x8, 0x1006b6928\nsub     rsp, 18h                                                       ; +0x9, 0x1006b6929\nmov     rbx, rdi                                                       ; +0xd, 0x1006b692d\nmov     rdi, [rdi+170h]                                                ; +0x10, 0x1006b6930\nmov     rax, [rdi]                                                     ; +0x17, 0x1006b6937\nxor     esi, esi                                                       ; +0x1a, 0x1006b693a\ncall    qword ptr [rax+158h]                                           ; +0x1c, 0x1006b693c\ncmp     qword ptr [rbx+150h], 0                                        ; +0x22, 0x1006b6942\njz      loc_1006B6A4A                                                  ; +0x2a, 0x1006b694a\ncall    GameManager__sharedState                                       ; +0x30, 0x1006b6950\nlea     rsi, a0016; \"0016\"                                             ; +0x35, 0x1006b6955\nmov     rdi, rax                                                       ; +0x3c, 0x1006b695c\ncall    GameManager__getGameVariable                                   ; +0x3f, 0x1006b695f\ntest    al, al                                                         ; +0x44, 0x1006b6964\njz      loc_1006B6A55                                                  ; +0x46, 0x1006b6966\nmov     rdi, rbx                                                       ; +0x4c, 0x1006b696c\ncall    CustomSFXWidget__showLoadingArt                                ; +0x4f, 0x1006b696f\nmov     rdi, [rbx+178h]                                                ; +0x54, 0x1006b6974\nmov     rax, [rdi]                                                     ; +0x5b, 0x1006b697b\nxor     esi, esi                                                       ; +0x5e, 0x1006b697e\ncall    qword ptr [rax+158h]                                           ; +0x60, 0x1006b6980\nmov     rdi, [rbx+180h]                                                ; +0x66, 0x1006b6986\nmov     rax, [rdi]                                                     ; +0x6d, 0x1006b698d\nmov     esi, 1                                                         ; +0x70, 0x1006b6990\ncall    qword ptr [rax+158h]                                           ; +0x75, 0x1006b6995\nmov     rdi, [rbx+198h]                                                ; +0x7b, 0x1006b699b\nmov     rax, [rdi]                                                     ; +0x82, 0x1006b69a2\nxor     esi, esi                                                       ; +0x85, 0x1006b69a5\ncall    qword ptr [rax+158h]                                           ; +0x87, 0x1006b69a7\nmov     byte ptr [rbx+1EBh], 0                                         ; +0x8d, 0x1006b69ad\ncall    MusicDownloadManager__sharedState                              ; +0x94, 0x1006b69b4\nmov     esi, [rbx+1F0h]                                                ; +0x99, 0x1006b69b9\nmov     rdi, rax                                                       ; +0x9f, 0x1006b69bf\ncall    MusicDownloadManager__downloadSFX                              ; +0xa2, 0x1006b69c2\nmov     rax, [rbx+1C8h]                                                ; +0xa7, 0x1006b69c7\nmov     r14, [rbx+1D0h]                                                ; +0xae, 0x1006b69ce\nmovss   xmm0, dword ptr [rax+1B0h]                                     ; +0xb5, 0x1006b69d5\naddss   xmm0, cs:dword_100A03FD4                                       ; +0xbd, 0x1006b69dd\nxorps   xmm1, xmm1                                                     ; +0xc5, 0x1006b69e5\nmovaps  xmm2, xmm0                                                     ; +0xc8, 0x1006b69e8\nmulss   xmm2, xmm1                                                     ; +0xcb, 0x1006b69eb\nminss   xmm2, xmm0                                                     ; +0xcf, 0x1006b69ef\nlea     r15, [rbp+var_28]                                              ; +0xd3, 0x1006b69f3\nmovss   xmm3, cs:dword_100A03D64                                       ; +0xd7, 0x1006b69f7\nxorps   xmm0, xmm0                                                     ; +0xdf, 0x1006b69ff\nmov     rdi, r15                                                       ; +0xe2, 0x1006b6a02\ncall    sub_100278270                                                  ; +0xe5, 0x1006b6a05\nmov     rax, [r14]                                                     ; +0xea, 0x1006b6a0a\nmov     rdi, r14                                                       ; +0xed, 0x1006b6a0d\nmov     rsi, r15                                                       ; +0xf0, 0x1006b6a10\ncall    qword ptr [rax+470h]                                           ; +0xf3, 0x1006b6a13\nmov     rdi, rbx                                                       ; +0xf9, 0x1006b6a19\ncall    CustomSFXWidget__showLoadingArt                                ; +0xfc, 0x1006b6a1c\nlea     r14, CustomSFXWidget__updateDownloadProgress                   ; +0x101, 0x1006b6a21\nmov     rdi, rbx                                                       ; +0x108, 0x1006b6a28\nmov     rsi, r14                                                       ; +0x10b, 0x1006b6a2b\nxor     edx, edx                                                       ; +0x10e, 0x1006b6a2e\ncall    cocos2d__CCNode__unschedule                                    ; +0x110, 0x1006b6a30\nmovss   xmm0, cs:dword_100A0485C                                       ; +0x115, 0x1006b6a35\nmov     rdi, rbx                                                       ; +0x11d, 0x1006b6a3d\nmov     rsi, r14                                                       ; +0x120, 0x1006b6a40\nxor     edx, edx                                                       ; +0x123, 0x1006b6a43\ncall    cocos2d__CCNode__schedule_1                                    ; +0x125, 0x1006b6a45\nadd     rsp, 18h                                                       ; +0x12a, 0x1006b6a4a\npop     rbx                                                            ; +0x12e, 0x1006b6a4e\npop     r14                                                            ; +0x12f, 0x1006b6a4f\npop     r15                                                            ; +0x131, 0x1006b6a51\npop     rbp                                                            ; +0x133, 0x1006b6a53\nretn                                                                   ; +0x134, 0x1006b6a54\ncall    MusicDownloadManager__sharedState                              ; +0x135, 0x1006b6a55\nadd     rbx, 148h                                                      ; +0x13a, 0x1006b6a5a\nmov     rdi, rax                                                       ; +0x141, 0x1006b6a61\nmov     rsi, rbx                                                       ; +0x144, 0x1006b6a64\nadd     rsp, 18h                                                       ; +0x147, 0x1006b6a67\npop     rbx                                                            ; +0x14b, 0x1006b6a6b\npop     r14                                                            ; +0x14c, 0x1006b6a6c\npop     r15                                                            ; +0x14e, 0x1006b6a6e\npop     rbp                                                            ; +0x150, 0x1006b6a70\njmp     MusicDownloadManager__showTOS                                  ; +0x151, 0x1006b6a71", "xrefs": ["CustomSFXWidget::FLAlert_Clicked @ 0x1006b8a55", "sub_1006B8A70 @ 0x1006b8abc", "CustomSFXWidget::init @ 0x1006b5a43"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}