{"type": "func", "start": 5368991424, "end": 5368991958, "name": "CCMenuItemSpriteExtra::selected", "pseudocode": "// \n// CCMenuItemSpriteExtra::selected from 0x140044ec0 to 0x1400450d6 (534 bytes)\n// \n// 4 xrefs:\n// > <???> @ 0x14052ec80\n// > <???> @ 0x1405539c0\n// > <???> @ 0x140580eb8\n// > <???> @ 0x1406c4698\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=2\nvoid CCMenuItemSpriteExtra::selected(CCMenuItemSpriteExtra *a1)\n{\n  float v1; // xmm3_4\n  std::size_t *p_m_capacity; // rdx\n  size_t v4; // r8\n  int v5; // r8d\n  int v6; // r9d\n  int v7; // ecx\n  cocos2d::CCNode *v8; // rax\n  float m_duration; // eax\n  struct cocos2d::CCScaleTo *v10; // rax\n  struct cocos2d::CCEaseInOut *v11; // rbx\n  cocos2d::ccColor3B *v12; // r8\n  CCMenuItemSpriteExtra *v13; // rcx\n  cocos2d::CCNode *v14; // rdi\n  struct cocos2d::CCMoveTo *v15; // rax\n  float v16; // [rsp+20h] [rbp-38h]\n  __int128 v17; // [rsp+30h] [rbp-28h] BYREF\n  __int64 v18; // [rsp+40h] [rbp-18h]\n  __int64 v19; // [rsp+48h] [rbp-10h]\n  __int128 *v20; // [rsp+60h] [rbp+8h] BYREF\n  FMODAudioEngine *v21; // [rsp+68h] [rbp+10h]\n\n  if ( a1->m_bEnabled )\n  {\n    cocos2d::CCMenuItemSprite::selected(a1);\n    if ( *((_QWORD *)&a1->m_selectSound.m_data.m_bigStorage + 1) )\n    {\n      v20 = &v17;\n      p_m_capacity = &a1->m_activateSound.m_data.m_capacity;\n      if ( a1->m_selectSound.m_data.m_size > 0xF )\n        p_m_capacity = (std::size_t *)*p_m_capacity;\n      v17 = 0;\n      v18 = 0;\n      v19 = 0;\n      v4 = -1;\n      do\n        ++v4;\n      while ( *((_BYTE *)p_m_capacity + v4) );\n      sub_14003A930(&v17, p_m_capacity, v4);\n      v7 = qword_1406C2E88;\n      if ( !qword_1406C2E88 )\n      {\n        v21 = (FMODAudioEngine *)operator new(0x888u);\n        qword_1406C2E88 = (__int64)FMODAudioEngine::FMODAudioEngine(v21);\n        (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2E88 + 72LL))(qword_1406C2E88);\n        v7 = qword_1406C2E88;\n      }\n      v1 = 0.0;\n      FMODAudioEngine::playEffect(v7, (unsigned int)&v17, v5, v6, LODWORD(a1->m_baseScale));\n    }\n    if ( BYTE1(a1->m_scaleMultiplier) )\n    {\n      LOBYTE(v20) = (int)(float)(*(float *)&a1->m_selectSound.m_data.m_capacity * 255.0);\n      BYTE1(v20) = (_BYTE)v20;\n      BYTE2(v20) = (_BYTE)v20;\n      v8 = a1->getNormalImage(a1);\n      v8[1].copyWithZone(v8 + 1, (cocos2d::CCZone *)&v20);\n    }\n    if ( LOBYTE(a1->m_scaleMultiplier) )\n    {\n      m_duration = a1->m_duration;\n      if ( m_duration == 0.0 )\n      {\n        cocos2d::CCNode::stopActionByTag(a1, 0);\n        v10 = cocos2d::CCScaleTo::create(\n                a1->m_offset.x,\n                *((float *)&a1->m_pDisabledImage + 1) * *(float *)&a1->m_pDisabledImage);\n        v11 = (struct cocos2d::CCEaseInOut *)cocos2d::CCEaseBounceOut::create(v10);\n        v11->setTag(v11, 0);\n        v13 = a1;\n      }\n      else\n      {\n        if ( LODWORD(m_duration) != 1 )\n          return;\n        v14 = a1->getNormalImage(a1);\n        cocos2d::CCNode::stopActionByTag(v14, 0);\n        cocos2d::CCPoint::operator+(&a1->m_unselectedDuration, &v20);\n        v15 = cocos2d::CCMoveTo::create(a1->m_offset.x, (const struct cocos2d::CCPoint *)&v20);\n        v11 = cocos2d::CCEaseInOut::create(v15, 1.5);\n        v11->setTag(v11, 0);\n        v13 = (CCMenuItemSpriteExtra *)v14;\n      }\n      cocos2d::CCNode::runAction((CCLightFlash *)v13, (cocos2d::CCPoint)v11, v12, v1, v16);\n    }\n  }\n}", "assembly": "; \n; CCMenuItemSpriteExtra::selected from 0x140044ec0 to 0x1400450d6 (534 bytes)\n; \n; 4 xrefs:\n; > <???> @ 0x14052ec80\n; > <???> @ 0x1405539c0\n; > <???> @ 0x140580eb8\n; > <???> @ 0x1406c4698\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, 0x140044ec0\nmov     [rsp+arg_18], rsi                                              ; +0x5, 0x140044ec5\npush    rdi                                                            ; +0xa, 0x140044eca\nsub     rsp, 50h                                                       ; +0xb, 0x140044ecb\nmov     rsi, rcx                                                       ; +0xf, 0x140044ecf\ncmp     byte ptr [rcx+159h], 0                                         ; +0x12, 0x140044ed2\njz      loc_1400450C6                                                  ; +0x19, 0x140044ed9\ncall    cs:__imp_?selected@CCMenuItemSprite@cocos2d@@UEAAXXZ; cocos2d::CCMenuItemSprite::selected(void) ; +0x1f, 0x140044edf\ncmp     qword ptr [rsi+1D0h], 0                                        ; +0x25, 0x140044ee5\njz      loc_140044FA2                                                  ; +0x2d, 0x140044eed\nlea     rax, [rsp+58h+var_28]                                          ; +0x33, 0x140044ef3\nmov     [rsp+58h+arg_0], rax                                           ; +0x38, 0x140044ef8\nlea     rdx, [rsi+1C0h]                                                ; +0x3d, 0x140044efd\ncmp     qword ptr [rdx+18h], 0Fh                                       ; +0x44, 0x140044f04\njbe     short loc_140044F0E                                            ; +0x49, 0x140044f09\nmov     rdx, [rdx]                                                     ; +0x4b, 0x140044f0b\nxorps   xmm0, xmm0                                                     ; +0x4e, 0x140044f0e\nmovups  [rsp+58h+var_28], xmm0                                         ; +0x51, 0x140044f11\nxor     eax, eax                                                       ; +0x56, 0x140044f16\nmov     [rsp+58h+var_18], rax                                          ; +0x58, 0x140044f18\nmov     [rsp+58h+var_10], rax                                          ; +0x5d, 0x140044f1d\nmov     r8, 0FFFFFFFFFFFFFFFFh                                         ; +0x62, 0x140044f22\nnop     dword ptr [rax+00000000h]                                      ; +0x69, 0x140044f29\ninc     r8                                                             ; +0x70, 0x140044f30\ncmp     [rdx+r8], al                                                   ; +0x73, 0x140044f33\njnz     short loc_140044F30                                            ; +0x77, 0x140044f37\nlea     rcx, [rsp+58h+var_28]                                          ; +0x79, 0x140044f39\ncall    sub_14003A930                                                  ; +0x7e, 0x140044f3e\nnop                                                                    ; +0x83, 0x140044f43\nmov     rcx, cs:qword_1406C2E88                                        ; +0x84, 0x140044f44\ntest    rcx, rcx                                                       ; +0x8b, 0x140044f4b\njnz     short loc_140044F7F                                            ; +0x8e, 0x140044f4e\nmov     ecx, 888h; Size                                                ; +0x90, 0x140044f50\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x95, 0x140044f55\nmov     [rsp+58h+arg_8], rax                                           ; +0x9a, 0x140044f5a\nmov     rcx, rax                                                       ; +0x9f, 0x140044f5f\ncall    FMODAudioEngine__FMODAudioEngine                               ; +0xa2, 0x140044f62\nnop                                                                    ; +0xa7, 0x140044f67\nmov     cs:qword_1406C2E88, rax                                        ; +0xa8, 0x140044f68\nmov     rdx, [rax]                                                     ; +0xaf, 0x140044f6f\nmov     rcx, rax                                                       ; +0xb2, 0x140044f72\ncall    qword ptr [rdx+48h]                                            ; +0xb5, 0x140044f75\nmov     rcx, cs:qword_1406C2E88                                        ; +0xb8, 0x140044f78\nmovss   xmm0, dword ptr [rsi+19Ch]                                     ; +0xbf, 0x140044f7f\nmovss   [rsp+58h+var_38], xmm0                                         ; +0xc7, 0x140044f87\nxorps   xmm3, xmm3                                                     ; +0xcd, 0x140044f8d\nmovss   xmm2, cs:flt_140622C24                                         ; +0xd0, 0x140044f90\nlea     rdx, [rsp+58h+var_28]                                          ; +0xd8, 0x140044f98\ncall    FMODAudioEngine__playEffect                                    ; +0xdd, 0x140044f9d\ncmp     byte ptr [rsi+199h], 0                                         ; +0xe2, 0x140044fa2\njz      short loc_140044FF2                                            ; +0xe9, 0x140044fa9\nmovss   xmm0, dword ptr [rsi+1E0h]                                     ; +0xeb, 0x140044fab\nmulss   xmm0, cs:dword_140623418                                       ; +0xf3, 0x140044fb3\ncvttss2si ecx, xmm0                                                    ; +0xfb, 0x140044fbb\nmov     byte ptr [rsp+58h+arg_0], cl                                   ; +0xff, 0x140044fbf\nmov     byte ptr [rsp+58h+arg_0+1], cl                                 ; +0x103, 0x140044fc3\nmovzx   eax, word ptr [rsp+58h+arg_0]                                  ; +0x107, 0x140044fc7\nmov     word ptr [rsp+58h+arg_0], ax                                   ; +0x10c, 0x140044fcc\nmov     byte ptr [rsp+58h+arg_0+2], cl                                 ; +0x111, 0x140044fd1\nmov     rax, [rsi]                                                     ; +0x115, 0x140044fd5\nmov     rcx, rsi                                                       ; +0x118, 0x140044fd8\ncall    qword ptr [rax+3A8h]                                           ; +0x11b, 0x140044fdb\nlea     rcx, [rax+140h]                                                ; +0x121, 0x140044fe1\nmov     rax, [rcx]                                                     ; +0x128, 0x140044fe8\nlea     rdx, [rsp+58h+arg_0]                                           ; +0x12b, 0x140044feb\ncall    qword ptr [rax]                                                ; +0x130, 0x140044ff0\ncmp     byte ptr [rsi+198h], 0                                         ; +0x132, 0x140044ff2\njz      loc_1400450C6                                                  ; +0x139, 0x140044ff9\nmov     eax, [rsi+1F4h]                                                ; +0x13f, 0x140044fff\ntest    eax, eax                                                       ; +0x145, 0x140045005\njnz     short loc_14004504F                                            ; +0x147, 0x140045007\nxor     edx, edx                                                       ; +0x149, 0x140045009\nmov     rcx, rsi                                                       ; +0x14b, 0x14004500b\ncall    cs:?stopActionByTag@CCNode@cocos2d@@QEAAXH@Z; cocos2d::CCNode::stopActionByTag(int) ; +0x14e, 0x14004500e\nmovss   xmm1, dword ptr [rsi+194h]                                     ; +0x154, 0x140045014\nmulss   xmm1, dword ptr [rsi+190h]                                     ; +0x15c, 0x14004501c\nmovss   xmm0, dword ptr [rsi+1ECh]                                     ; +0x164, 0x140045024\ncall    cs:?create@CCScaleTo@cocos2d@@SAPEAV12@MM@Z; cocos2d::CCScaleTo::create(float,float) ; +0x16c, 0x14004502c\nmov     rcx, rax                                                       ; +0x172, 0x140045032\ncall    cs:?create@CCEaseBounceOut@cocos2d@@SAPEAV12@PEAVCCActionInterval@2@@Z; cocos2d::CCEaseBounceOut::create(cocos2d::CCActionInterval *) ; +0x175, 0x140045035\nmov     rbx, rax                                                       ; +0x17b, 0x14004503b\nmov     r8, [rax]                                                      ; +0x17e, 0x14004503e\nxor     edx, edx                                                       ; +0x181, 0x140045041\nmov     rcx, rax                                                       ; +0x183, 0x140045043\ncall    qword ptr [r8+40h]                                             ; +0x186, 0x140045046\nmov     rcx, rsi                                                       ; +0x18a, 0x14004504a\njmp     short loc_1400450BD                                            ; +0x18d, 0x14004504d\ncmp     eax, 1                                                         ; +0x18f, 0x14004504f\njnz     short loc_1400450C6                                            ; +0x192, 0x140045052\nmov     rax, [rsi]                                                     ; +0x194, 0x140045054\nmov     rcx, rsi                                                       ; +0x197, 0x140045057\ncall    qword ptr [rax+3A8h]                                           ; +0x19a, 0x14004505a\nmov     rdi, rax                                                       ; +0x1a0, 0x140045060\nxor     edx, edx                                                       ; +0x1a3, 0x140045063\nmov     rcx, rax                                                       ; +0x1a5, 0x140045065\ncall    cs:?stopActionByTag@CCNode@cocos2d@@QEAAXH@Z; cocos2d::CCNode::stopActionByTag(int) ; +0x1a8, 0x140045068\nlea     r8, [rsi+1E4h]                                                 ; +0x1ae, 0x14004506e\nlea     rcx, [rsi+1F8h]                                                ; +0x1b5, 0x140045075\nlea     rdx, [rsp+58h+arg_0]                                           ; +0x1bc, 0x14004507c\ncall    cs:??HCCPoint@cocos2d@@QEBA?AV01@AEBV01@@Z; cocos2d::CCPoint::operator+(cocos2d::CCPoint const &) ; +0x1c1, 0x140045081\nlea     rdx, [rsp+58h+arg_0]                                           ; +0x1c7, 0x140045087\nmovss   xmm0, dword ptr [rsi+1ECh]                                     ; +0x1cc, 0x14004508c\ncall    cs:?create@CCMoveTo@cocos2d@@SAPEAV12@MAEBVCCPoint@2@@Z; cocos2d::CCMoveTo::create(float,cocos2d::CCPoint const &) ; +0x1d4, 0x140045094\nmovss   xmm1, cs:dword_140622D04                                       ; +0x1da, 0x14004509a\nmov     rcx, rax                                                       ; +0x1e2, 0x1400450a2\ncall    cs:?create@CCEaseInOut@cocos2d@@SAPEAV12@PEAVCCActionInterval@2@M@Z; cocos2d::CCEaseInOut::create(cocos2d::CCActionInterval *,float) ; +0x1e5, 0x1400450a5\nmov     rbx, rax                                                       ; +0x1eb, 0x1400450ab\nmov     r8, [rax]                                                      ; +0x1ee, 0x1400450ae\nxor     edx, edx                                                       ; +0x1f1, 0x1400450b1\nmov     rcx, rax                                                       ; +0x1f3, 0x1400450b3\ncall    qword ptr [r8+40h]                                             ; +0x1f6, 0x1400450b6\nmov     rcx, rdi                                                       ; +0x1fa, 0x1400450ba\nmov     rdx, rbx                                                       ; +0x1fd, 0x1400450bd\ncall    cs:?runAction@CCNode@cocos2d@@QEAAPEAVCCAction@2@PEAV32@@Z; cocos2d::CCNode::runAction(cocos2d::CCAction *) ; +0x200, 0x1400450c0\nmov     rbx, [rsp+58h+arg_10]                                          ; +0x206, 0x1400450c6\nmov     rsi, [rsp+58h+arg_18]                                          ; +0x20b, 0x1400450cb\nadd     rsp, 50h                                                       ; +0x210, 0x1400450d0\npop     rdi                                                            ; +0x214, 0x1400450d4\nretn                                                                   ; +0x215, 0x1400450d5", "xrefs": ["<???> @ 0x14052ec80", "<???> @ 0x1405539c0", "<???> @ 0x140580eb8", "<???> @ 0x1406c4698"], "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"}