{"type": "func", "start": 5370158672, "end": 5370159023, "name": "CustomSFXWidget::onDownload", "pseudocode": "// \n// CustomSFXWidget::onDownload from 0x140161e50 to 0x140161faf (351 bytes)\n// \n// 3 xrefs:\n// > CustomSFXWidget::FLAlert_Clicked @ 0x140163a08\n// > CustomSFXWidget::init @ 0x14016092f\n// > <???> @ 0x140917d68\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 11:27:25 +0000\n// \n\n// Hidden C++ exception states: #wind=3\n__int64 __fastcall CustomSFXWidget::onDownload(__int64 a1)\n{\n  __int64 result; // rax\n  __int64 v3; // rcx\n  __int64 v4; // rdx\n  __int64 v5; // rcx\n  __int64 v6; // rdx\n  __int64 v7; // rcx\n  void *v8; // [rsp+30h] [rbp+8h]\n  void *v9; // [rsp+30h] [rbp+8h]\n  void *v10; // [rsp+30h] [rbp+8h]\n\n  result = (*(__int64 (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 368) + 336LL))(*(_QWORD *)(a1 + 368), 0);\n  if ( *(_QWORD *)(a1 + 336) )\n  {\n    v3 = qword_14090BFD0;\n    if ( !qword_14090BFD0 )\n    {\n      v8 = operator new(0x6E8u);\n      qword_14090BFD0 = GameManager::GameManager(v8);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n      v3 = qword_14090BFD0;\n    }\n    if ( (unsigned __int8)GameManager::getGameVariable(v3, \"0016\") )\n    {\n      CustomSFXWidget::showLoadingArt(a1, v4);\n      (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 376) + 336LL))(*(_QWORD *)(a1 + 376), 0);\n      LOBYTE(v6) = 1;\n      (*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 384) + 336LL))(*(_QWORD *)(a1 + 384), v6);\n      (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 408) + 336LL))(*(_QWORD *)(a1 + 408), 0);\n      *(_BYTE *)(a1 + 491) = 0;\n      v7 = qword_14090C070;\n      if ( !qword_14090C070 )\n      {\n        v10 = operator new(0x3D0u);\n        qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v10);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);\n        v7 = qword_14090C070;\n      }\n      MusicDownloadManager::downloadSFX(v7, *(unsigned int *)(a1 + 496));\n      return CustomSFXWidget::startMonitorDownload(a1);\n    }\n    else\n    {\n      if ( !qword_14090C070 )\n      {\n        v9 = operator new(0x3D0u);\n        qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v9);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);\n      }\n      return MusicDownloadManager::showTOS(v5, a1 + 328);\n    }\n  }\n  return result;\n}", "assembly": "; \n; CustomSFXWidget::onDownload from 0x140161e50 to 0x140161faf (351 bytes)\n; \n; 3 xrefs:\n; > CustomSFXWidget::FLAlert_Clicked @ 0x140163a08\n; > CustomSFXWidget::init @ 0x14016092f\n; > <???> @ 0x140917d68\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 11:27:25 +0000\n; \npush    rbx                                                            ; +0x0, 0x140161e50\nsub     rsp, 20h                                                       ; +0x2, 0x140161e52\nmov     rbx, rcx                                                       ; +0x6, 0x140161e56\nmov     rcx, [rcx+170h]                                                ; +0x9, 0x140161e59\nmov     rax, [rcx]                                                     ; +0x10, 0x140161e60\nxor     edx, edx                                                       ; +0x13, 0x140161e63\ncall    qword ptr [rax+150h]                                           ; +0x15, 0x140161e65\ncmp     qword ptr [rbx+150h], 0                                        ; +0x1b, 0x140161e6b\njz      loc_140161FA9                                                  ; +0x23, 0x140161e73\nmov     rcx, cs:qword_14090BFD0                                        ; +0x29, 0x140161e79\ntest    rcx, rcx                                                       ; +0x30, 0x140161e80\njnz     short loc_140161EB7                                            ; +0x33, 0x140161e83\nmov     ecx, 6E8h; Size                                                ; +0x35, 0x140161e85\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x3a, 0x140161e8a\nmov     [rsp+28h+arg_0], rax                                           ; +0x3f, 0x140161e8f\nmov     rcx, rax                                                       ; +0x44, 0x140161e94\ncall    GameManager__GameManager                                       ; +0x47, 0x140161e97\nnop                                                                    ; +0x4c, 0x140161e9c\nmov     cs:qword_14090BFD0, rax                                        ; +0x4d, 0x140161e9d\nmov     rcx, [rax]                                                     ; +0x54, 0x140161ea4\nmov     rdx, [rcx+48h]                                                 ; +0x57, 0x140161ea7\nmov     rcx, rax                                                       ; +0x5b, 0x140161eab\ncall    rdx                                                            ; +0x5e, 0x140161eae\nmov     rcx, cs:qword_14090BFD0                                        ; +0x60, 0x140161eb0\nlea     rdx, a0016; \"0016\"                                             ; +0x67, 0x140161eb7\ncall    GameManager__getGameVariable                                   ; +0x6e, 0x140161ebe\ntest    al, al                                                         ; +0x73, 0x140161ec3\njnz     short loc_140161F0E                                            ; +0x75, 0x140161ec5\ncmp     cs:qword_14090C070, 0                                          ; +0x77, 0x140161ec7\njnz     short loc_140161EFD                                            ; +0x7f, 0x140161ecf\nmov     ecx, 3D0h; Size                                                ; +0x81, 0x140161ed1\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x86, 0x140161ed6\nmov     [rsp+28h+arg_0], rax                                           ; +0x8b, 0x140161edb\nmov     rcx, rax                                                       ; +0x90, 0x140161ee0\ncall    MusicDownloadManager__MusicDownloadManager                     ; +0x93, 0x140161ee3\nnop                                                                    ; +0x98, 0x140161ee8\nmov     cs:qword_14090C070, rax                                        ; +0x99, 0x140161ee9\nmov     rcx, [rax]                                                     ; +0xa0, 0x140161ef0\nmov     r8, [rcx+48h]                                                  ; +0xa3, 0x140161ef3\nmov     rcx, rax                                                       ; +0xa7, 0x140161ef7\ncall    r8                                                             ; +0xaa, 0x140161efa\nlea     rdx, [rbx+148h]                                                ; +0xad, 0x140161efd\nadd     rsp, 20h                                                       ; +0xb4, 0x140161f04\npop     rbx                                                            ; +0xb8, 0x140161f08\njmp     MusicDownloadManager__showTOS                                  ; +0xb9, 0x140161f09\nmov     rcx, rbx                                                       ; +0xbe, 0x140161f0e\ncall    CustomSFXWidget__showLoadingArt                                ; +0xc1, 0x140161f11\nmov     rcx, [rbx+178h]                                                ; +0xc6, 0x140161f16\nmov     rax, [rcx]                                                     ; +0xcd, 0x140161f1d\nxor     edx, edx                                                       ; +0xd0, 0x140161f20\ncall    qword ptr [rax+150h]                                           ; +0xd2, 0x140161f22\nmov     rcx, [rbx+180h]                                                ; +0xd8, 0x140161f28\nmov     rax, [rcx]                                                     ; +0xdf, 0x140161f2f\nmov     dl, 1                                                          ; +0xe2, 0x140161f32\ncall    qword ptr [rax+150h]                                           ; +0xe4, 0x140161f34\nmov     rcx, [rbx+198h]                                                ; +0xea, 0x140161f3a\nmov     rax, [rcx]                                                     ; +0xf1, 0x140161f41\nxor     edx, edx                                                       ; +0xf4, 0x140161f44\ncall    qword ptr [rax+150h]                                           ; +0xf6, 0x140161f46\nmov     byte ptr [rbx+1EBh], 0                                         ; +0xfc, 0x140161f4c\nmov     rcx, cs:qword_14090C070                                        ; +0x103, 0x140161f53\ntest    rcx, rcx                                                       ; +0x10a, 0x140161f5a\njnz     short loc_140161F91                                            ; +0x10d, 0x140161f5d\nmov     ecx, 3D0h; Size                                                ; +0x10f, 0x140161f5f\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x114, 0x140161f64\nmov     [rsp+28h+arg_0], rax                                           ; +0x119, 0x140161f69\nmov     rcx, rax                                                       ; +0x11e, 0x140161f6e\ncall    MusicDownloadManager__MusicDownloadManager                     ; +0x121, 0x140161f71\nnop                                                                    ; +0x126, 0x140161f76\nmov     cs:qword_14090C070, rax                                        ; +0x127, 0x140161f77\nmov     rcx, [rax]                                                     ; +0x12e, 0x140161f7e\nmov     rdx, [rcx+48h]                                                 ; +0x131, 0x140161f81\nmov     rcx, rax                                                       ; +0x135, 0x140161f85\ncall    rdx                                                            ; +0x138, 0x140161f88\nmov     rcx, cs:qword_14090C070                                        ; +0x13a, 0x140161f8a\nmov     edx, [rbx+1F0h]                                                ; +0x141, 0x140161f91\ncall    MusicDownloadManager__downloadSFX                              ; +0x147, 0x140161f97\nmov     rcx, rbx                                                       ; +0x14c, 0x140161f9c\nadd     rsp, 20h                                                       ; +0x14f, 0x140161f9f\npop     rbx                                                            ; +0x153, 0x140161fa3\njmp     CustomSFXWidget__startMonitorDownload                          ; +0x154, 0x140161fa4\nadd     rsp, 20h                                                       ; +0x159, 0x140161fa9\npop     rbx                                                            ; +0x15d, 0x140161fad\nretn                                                                   ; +0x15e, 0x140161fae", "xrefs": ["CustomSFXWidget::FLAlert_Clicked @ 0x140163a08", "CustomSFXWidget::init @ 0x14016092f", "<???> @ 0x140917d68"], "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"}