{"type": "func", "start": 5370198160, "end": 5370198796, "name": "CustomSongWidget::onDownload", "pseudocode": "// \n// CustomSongWidget::onDownload from 0x14016b890 to 0x14016bb0c (636 bytes)\n// \n// 4 xrefs:\n// > CustomSongWidget::musicActionFinished @ 0x14016e991\n// > CustomSongWidget::FLAlert_Clicked @ 0x14016edb8\n// > CustomSongWidget::init @ 0x1401696b8\n// > <???> @ 0x14091811c\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:29 +0000\n// \n\n// Hidden C++ exception states: #wind=7\n__int64 __fastcall CustomSongWidget::onDownload(__int64 a1)\n{\n  __int64 v2; // rcx\n  __int64 v3; // rcx\n  __int64 result; // rax\n  __int64 v5; // rdx\n  __int64 v6; // rcx\n  __int64 v7; // rdx\n  __int64 v8; // rcx\n  __int64 v9; // rdx\n  __int64 v10; // r8\n  __int64 v11; // rcx\n  void *v12; // [rsp+30h] [rbp+8h]\n  void *v13; // [rsp+30h] [rbp+8h]\n  void *v14; // [rsp+30h] [rbp+8h]\n  void *v15; // [rsp+30h] [rbp+8h]\n  void *v16; // [rsp+30h] [rbp+8h]\n\n  (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 376) + 336LL))(*(_QWORD *)(a1 + 376), 0);\n  v2 = *(_QWORD *)(a1 + 480);\n  if ( v2 )\n    (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v2 + 336LL))(v2, 0);\n  v3 = qword_14090BFD0;\n  if ( !qword_14090BFD0 )\n  {\n    v12 = operator new(0x6E8u);\n    qword_14090BFD0 = GameManager::GameManager(v12);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    v3 = qword_14090BFD0;\n  }\n  result = GameManager::getGameVariable(v3, \"0016\");\n  if ( !(_BYTE)result )\n  {\n    if ( !qword_14090C070 )\n    {\n      v13 = operator new(0x3D0u);\n      qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v13);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);\n    }\n    return MusicDownloadManager::showTOS(v6, a1 + 328);\n  }\n  if ( *(_BYTE *)(a1 + 529) )\n  {\n    (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 384) + 336LL))(*(_QWORD *)(a1 + 384), 0);\n    LOBYTE(v7) = 1;\n    (*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 392) + 336LL))(*(_QWORD *)(a1 + 392), v7);\n    v8 = qword_14090C070;\n    if ( !qword_14090C070 )\n    {\n      v14 = operator new(0x3D0u);\n      qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v14);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);\n      v8 = qword_14090C070;\n    }\n    if ( *(_QWORD *)(v8 + 384) )\n      return CustomSongWidget::startMultiAssetDownload(a1);\nLABEL_19:\n    *(_BYTE *)(a1 + 528) = 1;\n    return MusicDownloadManager::getCustomContentURL();\n  }\n  if ( !*(_QWORD *)(a1 + 336) )\n    return result;\n  LOBYTE(v5) = 1;\n  (*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 456) + 336LL))(*(_QWORD *)(a1 + 456), v5);\n  (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 384) + 336LL))(*(_QWORD *)(a1 + 384), 0);\n  LOBYTE(v9) = 1;\n  (*(void (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 392) + 336LL))(*(_QWORD *)(a1 + 392), v9);\n  (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(a1 + 432) + 336LL))(*(_QWORD *)(a1 + 432), 0);\n  v11 = qword_14090C070;\n  if ( *(int *)(a1 + 504) >= 10000000 )\n  {\n    if ( !qword_14090C070 )\n    {\n      v15 = operator new(0x3D0u);\n      qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v15);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);\n      v11 = qword_14090C070;\n    }\n    if ( !*(_QWORD *)(v11 + 384) )\n      goto LABEL_19;\n  }\n  if ( *(_BYTE *)(*(_QWORD *)(a1 + 336) + 473LL) )\n    return CustomSongWidget::startDownload(a1);\n  *(_BYTE *)(a1 + 499) = 1;\n  if ( !v11 )\n  {\n    v16 = operator new(0x3D0u);\n    qword_14090C070 = MusicDownloadManager::MusicDownloadManager(v16);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090C070 + 72LL))(qword_14090C070);\n    v11 = qword_14090C070;\n  }\n  LOBYTE(v10) = 1;\n  return MusicDownloadManager::getSongInfo(v11, *(unsigned int *)(a1 + 504), v10);\n}", "assembly": "; \n; CustomSongWidget::onDownload from 0x14016b890 to 0x14016bb0c (636 bytes)\n; \n; 4 xrefs:\n; > CustomSongWidget::musicActionFinished @ 0x14016e991\n; > CustomSongWidget::FLAlert_Clicked @ 0x14016edb8\n; > CustomSongWidget::init @ 0x1401696b8\n; > <???> @ 0x14091811c\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:29 +0000\n; \npush    rbx                                                            ; +0x0, 0x14016b890\nsub     rsp, 20h                                                       ; +0x2, 0x14016b892\nmov     rbx, rcx                                                       ; +0x6, 0x14016b896\nmov     rcx, [rcx+178h]                                                ; +0x9, 0x14016b899\nmov     rax, [rcx]                                                     ; +0x10, 0x14016b8a0\nxor     edx, edx                                                       ; +0x13, 0x14016b8a3\ncall    qword ptr [rax+150h]                                           ; +0x15, 0x14016b8a5\nmov     rcx, [rbx+1E0h]                                                ; +0x1b, 0x14016b8ab\ntest    rcx, rcx                                                       ; +0x22, 0x14016b8b2\njz      short loc_14016B8C2                                            ; +0x25, 0x14016b8b5\nmov     rax, [rcx]                                                     ; +0x27, 0x14016b8b7\nxor     edx, edx                                                       ; +0x2a, 0x14016b8ba\ncall    qword ptr [rax+150h]                                           ; +0x2c, 0x14016b8bc\nmov     rcx, cs:qword_14090BFD0                                        ; +0x32, 0x14016b8c2\ntest    rcx, rcx                                                       ; +0x39, 0x14016b8c9\njnz     short loc_14016B900                                            ; +0x3c, 0x14016b8cc\nmov     ecx, 6E8h; Size                                                ; +0x3e, 0x14016b8ce\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x43, 0x14016b8d3\nmov     [rsp+28h+arg_0], rax                                           ; +0x48, 0x14016b8d8\nmov     rcx, rax                                                       ; +0x4d, 0x14016b8dd\ncall    GameManager__GameManager                                       ; +0x50, 0x14016b8e0\nnop                                                                    ; +0x55, 0x14016b8e5\nmov     cs:qword_14090BFD0, rax                                        ; +0x56, 0x14016b8e6\nmov     rcx, [rax]                                                     ; +0x5d, 0x14016b8ed\nmov     rdx, [rcx+48h]                                                 ; +0x60, 0x14016b8f0\nmov     rcx, rax                                                       ; +0x64, 0x14016b8f4\ncall    rdx                                                            ; +0x67, 0x14016b8f7\nmov     rcx, cs:qword_14090BFD0                                        ; +0x69, 0x14016b8f9\nlea     rdx, a0016; \"0016\"                                             ; +0x70, 0x14016b900\ncall    GameManager__getGameVariable                                   ; +0x77, 0x14016b907\ntest    al, al                                                         ; +0x7c, 0x14016b90c\njnz     short loc_14016B957                                            ; +0x7e, 0x14016b90e\ncmp     cs:qword_14090C070, 0                                          ; +0x80, 0x14016b910\njnz     short loc_14016B946                                            ; +0x88, 0x14016b918\nmov     ecx, 3D0h; Size                                                ; +0x8a, 0x14016b91a\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x8f, 0x14016b91f\nmov     [rsp+28h+arg_0], rax                                           ; +0x94, 0x14016b924\nmov     rcx, rax                                                       ; +0x99, 0x14016b929\ncall    MusicDownloadManager__MusicDownloadManager                     ; +0x9c, 0x14016b92c\nnop                                                                    ; +0xa1, 0x14016b931\nmov     cs:qword_14090C070, rax                                        ; +0xa2, 0x14016b932\nmov     rcx, [rax]                                                     ; +0xa9, 0x14016b939\nmov     r8, [rcx+48h]                                                  ; +0xac, 0x14016b93c\nmov     rcx, rax                                                       ; +0xb0, 0x14016b940\ncall    r8                                                             ; +0xb3, 0x14016b943\nlea     rdx, [rbx+148h]                                                ; +0xb6, 0x14016b946\nadd     rsp, 20h                                                       ; +0xbd, 0x14016b94d\npop     rbx                                                            ; +0xc1, 0x14016b951\njmp     MusicDownloadManager__showTOS                                  ; +0xc2, 0x14016b952\ncmp     byte ptr [rbx+211h], 0                                         ; +0xc7, 0x14016b957\njz      short loc_14016B9DD                                            ; +0xce, 0x14016b95e\nmov     rcx, [rbx+180h]                                                ; +0xd0, 0x14016b960\nmov     rax, [rcx]                                                     ; +0xd7, 0x14016b967\nxor     edx, edx                                                       ; +0xda, 0x14016b96a\ncall    qword ptr [rax+150h]                                           ; +0xdc, 0x14016b96c\nmov     rcx, [rbx+188h]                                                ; +0xe2, 0x14016b972\nmov     rax, [rcx]                                                     ; +0xe9, 0x14016b979\nmov     dl, 1                                                          ; +0xec, 0x14016b97c\ncall    qword ptr [rax+150h]                                           ; +0xee, 0x14016b97e\nmov     rcx, cs:qword_14090C070                                        ; +0xf4, 0x14016b984\ntest    rcx, rcx                                                       ; +0xfb, 0x14016b98b\njnz     short loc_14016B9C2                                            ; +0xfe, 0x14016b98e\nmov     ecx, 3D0h; Size                                                ; +0x100, 0x14016b990\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x105, 0x14016b995\nmov     [rsp+28h+arg_0], rax                                           ; +0x10a, 0x14016b99a\nmov     rcx, rax                                                       ; +0x10f, 0x14016b99f\ncall    MusicDownloadManager__MusicDownloadManager                     ; +0x112, 0x14016b9a2\nnop                                                                    ; +0x117, 0x14016b9a7\nmov     cs:qword_14090C070, rax                                        ; +0x118, 0x14016b9a8\nmov     rcx, [rax]                                                     ; +0x11f, 0x14016b9af\nmov     rdx, [rcx+48h]                                                 ; +0x122, 0x14016b9b2\nmov     rcx, rax                                                       ; +0x126, 0x14016b9b6\ncall    rdx                                                            ; +0x129, 0x14016b9b9\nmov     rcx, cs:qword_14090C070                                        ; +0x12b, 0x14016b9bb\ncmp     qword ptr [rcx+180h], 0                                        ; +0x132, 0x14016b9c2\njz      loc_14016BA87                                                  ; +0x13a, 0x14016b9ca\nmov     rcx, rbx                                                       ; +0x140, 0x14016b9d0\nadd     rsp, 20h                                                       ; +0x143, 0x14016b9d3\npop     rbx                                                            ; +0x147, 0x14016b9d7\njmp     CustomSongWidget__startMultiAssetDownload                      ; +0x148, 0x14016b9d8\ncmp     qword ptr [rbx+150h], 0                                        ; +0x14d, 0x14016b9dd\njz      loc_14016BB06                                                  ; +0x155, 0x14016b9e5\nmov     rcx, [rbx+1C8h]                                                ; +0x15b, 0x14016b9eb\nmov     rax, [rcx]                                                     ; +0x162, 0x14016b9f2\nmov     dl, 1                                                          ; +0x165, 0x14016b9f5\ncall    qword ptr [rax+150h]                                           ; +0x167, 0x14016b9f7\nmov     rcx, [rbx+180h]                                                ; +0x16d, 0x14016b9fd\nmov     rax, [rcx]                                                     ; +0x174, 0x14016ba04\nxor     edx, edx                                                       ; +0x177, 0x14016ba07\ncall    qword ptr [rax+150h]                                           ; +0x179, 0x14016ba09\nmov     rcx, [rbx+188h]                                                ; +0x17f, 0x14016ba0f\nmov     rax, [rcx]                                                     ; +0x186, 0x14016ba16\nmov     dl, 1                                                          ; +0x189, 0x14016ba19\ncall    qword ptr [rax+150h]                                           ; +0x18b, 0x14016ba1b\nmov     rcx, [rbx+1B0h]                                                ; +0x191, 0x14016ba21\nmov     rax, [rcx]                                                     ; +0x198, 0x14016ba28\nxor     edx, edx                                                       ; +0x19b, 0x14016ba2b\ncall    qword ptr [rax+150h]                                           ; +0x19d, 0x14016ba2d\nmov     rcx, cs:qword_14090C070                                        ; +0x1a3, 0x14016ba33\ncmp     dword ptr [rbx+1F8h], 989680h                                  ; +0x1aa, 0x14016ba3a\njl      short loc_14016BA98                                            ; +0x1b4, 0x14016ba44\ntest    rcx, rcx                                                       ; +0x1b6, 0x14016ba46\njnz     short loc_14016BA7D                                            ; +0x1b9, 0x14016ba49\nmov     ecx, 3D0h; Size                                                ; +0x1bb, 0x14016ba4b\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x1c0, 0x14016ba50\nmov     [rsp+28h+arg_0], rax                                           ; +0x1c5, 0x14016ba55\nmov     rcx, rax                                                       ; +0x1ca, 0x14016ba5a\ncall    MusicDownloadManager__MusicDownloadManager                     ; +0x1cd, 0x14016ba5d\nnop                                                                    ; +0x1d2, 0x14016ba62\nmov     cs:qword_14090C070, rax                                        ; +0x1d3, 0x14016ba63\nmov     rcx, [rax]                                                     ; +0x1da, 0x14016ba6a\nmov     rdx, [rcx+48h]                                                 ; +0x1dd, 0x14016ba6d\nmov     rcx, rax                                                       ; +0x1e1, 0x14016ba71\ncall    rdx                                                            ; +0x1e4, 0x14016ba74\nmov     rcx, cs:qword_14090C070                                        ; +0x1e6, 0x14016ba76\ncmp     qword ptr [rcx+180h], 0                                        ; +0x1ed, 0x14016ba7d\njnz     short loc_14016BA98                                            ; +0x1f5, 0x14016ba85\nmov     byte ptr [rbx+210h], 1                                         ; +0x1f7, 0x14016ba87\nadd     rsp, 20h                                                       ; +0x1fe, 0x14016ba8e\npop     rbx                                                            ; +0x202, 0x14016ba92\njmp     MusicDownloadManager__getCustomContentURL                      ; +0x203, 0x14016ba93\nmov     rax, [rbx+150h]                                                ; +0x208, 0x14016ba98\ncmp     byte ptr [rax+1D9h], 0                                         ; +0x20f, 0x14016ba9f\njz      short loc_14016BAB5                                            ; +0x216, 0x14016baa6\nmov     rcx, rbx                                                       ; +0x218, 0x14016baa8\nadd     rsp, 20h                                                       ; +0x21b, 0x14016baab\npop     rbx                                                            ; +0x21f, 0x14016baaf\njmp     CustomSongWidget__startDownload                                ; +0x220, 0x14016bab0\nmov     byte ptr [rbx+1F3h], 1                                         ; +0x225, 0x14016bab5\ntest    rcx, rcx                                                       ; +0x22c, 0x14016babc\njnz     short loc_14016BAF3                                            ; +0x22f, 0x14016babf\nmov     ecx, 3D0h; Size                                                ; +0x231, 0x14016bac1\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x236, 0x14016bac6\nmov     [rsp+28h+arg_0], rax                                           ; +0x23b, 0x14016bacb\nmov     rcx, rax                                                       ; +0x240, 0x14016bad0\ncall    MusicDownloadManager__MusicDownloadManager                     ; +0x243, 0x14016bad3\nnop                                                                    ; +0x248, 0x14016bad8\nmov     cs:qword_14090C070, rax                                        ; +0x249, 0x14016bad9\nmov     rcx, [rax]                                                     ; +0x250, 0x14016bae0\nmov     rdx, [rcx+48h]                                                 ; +0x253, 0x14016bae3\nmov     rcx, rax                                                       ; +0x257, 0x14016bae7\ncall    rdx                                                            ; +0x25a, 0x14016baea\nmov     rcx, cs:qword_14090C070                                        ; +0x25c, 0x14016baec\nmov     r8b, 1                                                         ; +0x263, 0x14016baf3\nmov     edx, [rbx+1F8h]                                                ; +0x266, 0x14016baf6\nadd     rsp, 20h                                                       ; +0x26c, 0x14016bafc\npop     rbx                                                            ; +0x270, 0x14016bb00\njmp     MusicDownloadManager__getSongInfo                              ; +0x271, 0x14016bb01\nadd     rsp, 20h                                                       ; +0x276, 0x14016bb06\npop     rbx                                                            ; +0x27a, 0x14016bb0a\nretn                                                                   ; +0x27b, 0x14016bb0b", "xrefs": ["CustomSongWidget::musicActionFinished @ 0x14016e991", "CustomSongWidget::FLAlert_Clicked @ 0x14016edb8", "CustomSongWidget::init @ 0x1401696b8", "<???> @ 0x14091811c"], "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"}