{"type": "func", "start": 5369505664, "end": 5369506173, "name": "CustomSFXWidget::FLAlert_Clicked", "pseudocode": "// \n// CustomSFXWidget::FLAlert_Clicked from 0x1400c2780 to 0x1400c297d (509 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x14054ca68\n// > <???> @ 0x1406c7fe0\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=3\nvoid CustomSFXWidget::FLAlert_Clicked(CustomSFXWidget *a1, FLAlertLayer *a2, bool a3)\n{\n  int v5; // eax\n  CustomSFXWidget *v6; // rdi\n  SFXInfoObject *m_sfxObject; // rbx\n  MusicDownloadManager *v8; // rax\n  FMODAudioEngine *v9; // rcx\n  unsigned int m_sfxID; // ebx\n  MusicDownloadManager *v11; // rax\n  const char *v12; // rcx\n  _BOOL8 v13; // rdx\n  GameManager *v14; // rcx\n  __int16 v15; // [rsp+20h] [rbp-68h] BYREF\n  char v16; // [rsp+22h] [rbp-66h]\n  FMODAudioEngine *v17; // [rsp+28h] [rbp-60h]\n  char *FileName[4]; // [rsp+30h] [rbp-58h] BYREF\n  _BYTE v19[32]; // [rsp+50h] [rbp-38h] BYREF\n\n  v5 = ((__int64 (__fastcall *)(FLAlertLayer *))a2->getTag)(a2) - 1;\n  if ( v5 )\n  {\n    if ( v5 == 2 && a3 )\n    {\n      v6 = (CustomSFXWidget *)((char *)a1 - 328);\n      m_sfxObject = v6->m_sfxObject;\n      if ( m_sfxObject )\n      {\n        v8 = MusicDownloadManager::sharedState();\n        MusicDownloadManager::pathForSFX(v8, v19, (unsigned int)m_sfxObject->m_sfxID);\n        v9 = (FMODAudioEngine *)qword_1406C2E88;\n        if ( !qword_1406C2E88 )\n        {\n          v17 = (FMODAudioEngine *)operator new(0x888u);\n          qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v17);\n          (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n          v9 = (FMODAudioEngine *)qword_1406C2E88;\n        }\n        FMODAudioEngine::stopAllEffects(v9);\n        m_sfxID = v6->m_sfxObject->m_sfxID;\n        v11 = MusicDownloadManager::sharedState();\n        MusicDownloadManager::pathForSFX(v11, FileName, m_sfxID);\n        v12 = (const char *)FileName;\n        if ( FileName[3] > (char *)0xF )\n          v12 = FileName[0];\n        remove(v12);\n        sub_14003A830((__int64)FileName);\n        CustomSFXWidget::updateSFXInfo(v6);\n        LOBYTE(v13) = 1;\n        v6->m_errorLabel->setVisible(v6->m_errorLabel, v13);\n        v15 = 25855;\n        v16 = 0;\n        v6->m_errorLabel->setColor(&v6->m_errorLabel->cocos2d::CCRGBAProtocol, (const cocos2d::ccColor3B *)&v15);\n        v6->m_errorLabel->setString(&v6->m_errorLabel->cocos2d::CCLabelProtocol, \"SFX Deleted\");\n        cocos2d::CCLabelBMFont::limitLabelWidth(v6->m_errorLabel, 230.0, 0.40000001, 0.0);\n        sub_14003A830((__int64)v19);\n      }\n    }\n  }\n  else if ( a3 )\n  {\n    v14 = (GameManager *)qword_1406C2ED8;\n    if ( !qword_1406C2ED8 )\n    {\n      v17 = (FMODAudioEngine *)operator new(0x668u);\n      qword_1406C2ED8 = sub_14017AB00(v17);\n      (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n      v14 = (GameManager *)qword_1406C2ED8;\n    }\n    GameManager::setGameVariable(v14, \"0016\", 1);\n    CustomSFXWidget::onDownload((CustomSFXWidget *)((char *)a1 - 328), nullptr);\n  }\n}", "assembly": "; \n; CustomSFXWidget::FLAlert_Clicked from 0x1400c2780 to 0x1400c297d (509 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x14054ca68\n; > <???> @ 0x1406c7fe0\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\nmov     [rsp+arg_10], rbx                                              ; +0x0, 0x1400c2780\npush    rdi                                                            ; +0x5, 0x1400c2785\nsub     rsp, 80h                                                       ; +0x6, 0x1400c2786\nmov     rax, cs:__security_cookie                                      ; +0xd, 0x1400c278d\nxor     rax, rsp                                                       ; +0x14, 0x1400c2794\nmov     [rsp+88h+var_18], rax                                          ; +0x17, 0x1400c2797\nmovzx   ebx, r8b                                                       ; +0x1c, 0x1400c279c\nmov     rdi, rcx                                                       ; +0x20, 0x1400c27a0\nmov     rax, [rdx]                                                     ; +0x23, 0x1400c27a3\nmov     rcx, rdx                                                       ; +0x26, 0x1400c27a6\ncall    qword ptr [rax+38h]                                            ; +0x29, 0x1400c27a9\nsub     eax, 1                                                         ; +0x2c, 0x1400c27ac\njz      loc_1400C2903                                                  ; +0x2f, 0x1400c27af\ncmp     eax, 2                                                         ; +0x35, 0x1400c27b5\njnz     loc_1400C295F                                                  ; +0x38, 0x1400c27b8\ntest    bl, bl                                                         ; +0x3e, 0x1400c27be\njz      loc_1400C295F                                                  ; +0x40, 0x1400c27c0\nadd     rdi, 0FFFFFFFFFFFFFEB8h                                        ; +0x46, 0x1400c27c6\nmov     rbx, [rdi+150h]                                                ; +0x4d, 0x1400c27cd\ntest    rbx, rbx                                                       ; +0x54, 0x1400c27d4\njz      loc_1400C295F                                                  ; +0x57, 0x1400c27d7\ncall    MusicDownloadManager__sharedState                              ; +0x5d, 0x1400c27dd\nmov     rcx, rax                                                       ; +0x62, 0x1400c27e2\nmov     r8d, [rbx+38h]                                                 ; +0x65, 0x1400c27e5\nlea     rdx, [rsp+88h+var_38]                                          ; +0x69, 0x1400c27e9\ncall    MusicDownloadManager__pathForSFX                               ; +0x6e, 0x1400c27ee\nnop                                                                    ; +0x73, 0x1400c27f3\nmov     rcx, cs:qword_1406C2E88                                        ; +0x74, 0x1400c27f4\ntest    rcx, rcx                                                       ; +0x7b, 0x1400c27fb\njnz     short loc_1400C282F                                            ; +0x7e, 0x1400c27fe\nmov     ecx, 888h; Size                                                ; +0x80, 0x1400c2800\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x85, 0x1400c2805\nmov     [rsp+88h+var_60], rax                                          ; +0x8a, 0x1400c280a\nmov     rcx, rax                                                       ; +0x8f, 0x1400c280f\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0x92, 0x1400c2812\nnop                                                                    ; +0x97, 0x1400c2817\nmov     cs:qword_1406C2E88, rax                                        ; +0x98, 0x1400c2818\nmov     rdx, [rax]                                                     ; +0x9f, 0x1400c281f\nmov     rcx, rax                                                       ; +0xa2, 0x1400c2822\ncall    qword ptr [rdx+48h]                                            ; +0xa5, 0x1400c2825\nmov     rcx, cs:qword_1406C2E88                                        ; +0xa8, 0x1400c2828\ncall    FMODAudioEngine__stopAllEffects                                ; +0xaf, 0x1400c282f\nmov     rax, [rdi+150h]                                                ; +0xb4, 0x1400c2834\nmov     ebx, [rax+38h]                                                 ; +0xbb, 0x1400c283b\ncall    MusicDownloadManager__sharedState                              ; +0xbe, 0x1400c283e\nmov     r8d, ebx                                                       ; +0xc3, 0x1400c2843\nlea     rdx, [rsp+88h+FileName]                                        ; +0xc6, 0x1400c2846\nmov     rcx, rax                                                       ; +0xcb, 0x1400c284b\ncall    MusicDownloadManager__pathForSFX                               ; +0xce, 0x1400c284e\nlea     rcx, [rsp+88h+FileName]                                        ; +0xd3, 0x1400c2853\ncmp     [rsp+88h+var_40], 0Fh                                          ; +0xd8, 0x1400c2858\ncmova   rcx, [rsp+88h+FileName]; FileName                              ; +0xde, 0x1400c285e\ncall    cs:remove                                                      ; +0xe4, 0x1400c2864\nlea     rcx, [rsp+88h+FileName]                                        ; +0xea, 0x1400c286a\ncall    sub_14003A830                                                  ; +0xef, 0x1400c286f\nmov     rcx, rdi                                                       ; +0xf4, 0x1400c2874\ncall    CustomSFXWidget__updateSFXInfo                                 ; +0xf7, 0x1400c2877\nmov     rcx, [rdi+170h]                                                ; +0xfc, 0x1400c287c\nmov     rax, [rcx]                                                     ; +0x103, 0x1400c2883\nmov     dl, 1                                                          ; +0x106, 0x1400c2886\ncall    qword ptr [rax+140h]                                           ; +0x108, 0x1400c2888\nmov     [rsp+88h+var_68], 64FFh                                        ; +0x10e, 0x1400c288e\nmovzx   eax, [rsp+88h+var_68]                                          ; +0x115, 0x1400c2895\nmov     [rsp+88h+var_68], ax                                           ; +0x11a, 0x1400c289a\nmov     [rsp+88h+var_66], 0                                            ; +0x11f, 0x1400c289f\nmov     rcx, [rdi+170h]                                                ; +0x124, 0x1400c28a4\nadd     rcx, 170h                                                      ; +0x12b, 0x1400c28ab\nmov     rax, [rcx]                                                     ; +0x132, 0x1400c28b2\nlea     rdx, [rsp+88h+var_68]                                          ; +0x135, 0x1400c28b5\ncall    qword ptr [rax]                                                ; +0x13a, 0x1400c28ba\nmov     rcx, [rdi+170h]                                                ; +0x13c, 0x1400c28bc\nadd     rcx, 168h                                                      ; +0x143, 0x1400c28c3\nmov     rax, [rcx]                                                     ; +0x14a, 0x1400c28ca\nlea     rdx, aSfxDeleted; \"SFX Deleted\"                                ; +0x14d, 0x1400c28cd\ncall    qword ptr [rax]                                                ; +0x154, 0x1400c28d4\nxorps   xmm3, xmm3                                                     ; +0x156, 0x1400c28d6\nmovss   xmm2, cs:dword_140622AD0                                       ; +0x159, 0x1400c28d9\nmovss   xmm1, cs:dword_140623400                                       ; +0x161, 0x1400c28e1\nmov     rcx, [rdi+170h]                                                ; +0x169, 0x1400c28e9\ncall    cs:?limitLabelWidth@CCLabelBMFont@cocos2d@@QEAAXMMM@Z; cocos2d::CCLabelBMFont::limitLabelWidth(float,float,float) ; +0x170, 0x1400c28f0\nnop                                                                    ; +0x176, 0x1400c28f6\nlea     rcx, [rsp+88h+var_38]                                          ; +0x177, 0x1400c28f7\ncall    sub_14003A830                                                  ; +0x17c, 0x1400c28fc\njmp     short loc_1400C295F                                            ; +0x181, 0x1400c2901\ntest    bl, bl                                                         ; +0x183, 0x1400c2903\njz      short loc_1400C295F                                            ; +0x185, 0x1400c2905\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x187, 0x1400c2907\ntest    rcx, rcx                                                       ; +0x18e, 0x1400c290e\njnz     short loc_1400C2942                                            ; +0x191, 0x1400c2911\nmov     ecx, 668h; Size                                                ; +0x193, 0x1400c2913\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x198, 0x1400c2918\nmov     [rsp+88h+var_60], rax                                          ; +0x19d, 0x1400c291d\nmov     rcx, rax                                                       ; +0x1a2, 0x1400c2922\ncall    sub_14017AB00                                                  ; +0x1a5, 0x1400c2925\nnop                                                                    ; +0x1aa, 0x1400c292a\nmov     cs:qword_1406C2ED8, rax                                        ; +0x1ab, 0x1400c292b\nmov     rdx, [rax]                                                     ; +0x1b2, 0x1400c2932\nmov     rcx, rax                                                       ; +0x1b5, 0x1400c2935\ncall    qword ptr [rdx+48h]                                            ; +0x1b8, 0x1400c2938\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x1bb, 0x1400c293b\nmov     r8b, 1                                                         ; +0x1c2, 0x1400c2942\nlea     rdx, a0016; \"0016\"                                             ; +0x1c5, 0x1400c2945\ncall    GameManager__setGameVariable                                   ; +0x1cc, 0x1400c294c\nlea     rcx, [rdi-148h]                                                ; +0x1d1, 0x1400c2951\nxor     edx, edx                                                       ; +0x1d8, 0x1400c2958\ncall    CustomSFXWidget__onDownload                                    ; +0x1da, 0x1400c295a\nmov     rcx, [rsp+88h+var_18]                                          ; +0x1df, 0x1400c295f\nxor     rcx, rsp; StackCookie                                          ; +0x1e4, 0x1400c2964\ncall    __security_check_cookie                                        ; +0x1e7, 0x1400c2967\nmov     rbx, [rsp+88h+arg_10]                                          ; +0x1ec, 0x1400c296c\nadd     rsp, 80h                                                       ; +0x1f4, 0x1400c2974\npop     rdi                                                            ; +0x1fb, 0x1400c297b\nretn                                                                   ; +0x1fc, 0x1400c297c", "xrefs": ["<???> @ 0x14054ca68", "<???> @ 0x1406c7fe0"], "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"}