{"type": "func", "start": 4297551648, "end": 4297552252, "name": "CCMenuItemSpriteExtra::selected", "pseudocode": "// \n// CCMenuItemSpriteExtra::selected from 0x100276f20 to 0x10027717c (604 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x1008b1ea0\n// > <???> @ 0x1008ef670\n// > <???> @ 0x1009657e8\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\nvoid __fastcall CCMenuItemSpriteExtra::selected(CCMenuItemSpriteExtra *a1)\n{\n  double v1; // xmm0_8\n  unsigned int sizex2; // eax\n  FMODAudioEngine *v3; // r14\n  std::array<char, 23> *longStorage; // r15\n  size_t v5; // rax\n  size_t v6; // r12\n  char *v7; // r13\n  size_t v8; // r14\n  __int64 v9; // rax\n  MenuAnimationType m_animationType; // eax\n  cocos2d::CCScaleTo *v11; // rax\n  cocos2d::CCEaseBounceOut *v12; // r14\n  cocos2d::CCAction *v13; // rsi\n  CCMenuItemSpriteExtra *v14; // r14\n  cocos2d::CCMoveTo *v15; // rax\n  cocos2d::CCEaseInOut *v16; // rbx\n  _QWORD __dst[2]; // [rsp+0h] [rbp-50h] BYREF\n  void *__p; // [rsp+10h] [rbp-40h]\n  cocos2d::CCPoint v19; // [rsp+18h] [rbp-38h] BYREF\n  FMODAudioEngine *v20; // [rsp+20h] [rbp-30h]\n\n  if ( !a1->m_bEnabled )\n    return;\n  cocos2d::CCMenuItemSprite::selected(a1);\n  sizex2 = a1->m_selectSound.m_data.m_short.sizex2;\n  if ( (sizex2 & 1) != 0 )\n  {\n    if ( !a1->m_selectSound.m_data.m_long.size )\n      goto LABEL_19;\n  }\n  else if ( !(sizex2 >> 1) )\n  {\n    goto LABEL_19;\n  }\n  v3 = FMODAudioEngine::sharedEngine();\n  if ( (a1->m_selectSound.m_data.m_short.sizex2 & 1) != 0 )\n    longStorage = (std::array<char, 23> *)a1->m_selectSound.m_data.m_long.longStorage;\n  else\n    longStorage = &a1->m_selectSound.m_data.m_short.shortStorage;\n  v5 = strlen(longStorage->__elems_);\n  if ( v5 >= 0xFFFFFFFFFFFFFFF8LL )\n    sub_100006BF0(v1);\n  v6 = v5;\n  if ( v5 >= 0x17 )\n  {\n    v20 = v3;\n    v8 = 26;\n    if ( (v5 | 7) != 0x17 )\n      v8 = (v5 | 7) + 1;\n    v7 = (char *)operator new(v8);\n    __p = v7;\n    __dst[0] = v8 + 1;\n    v3 = v20;\n    __dst[1] = v6;\n    goto LABEL_16;\n  }\n  LOBYTE(__dst[0]) = 2 * v5;\n  v7 = (char *)__dst + 1;\n  if ( v5 )\nLABEL_16:\n    memmove(v7, longStorage, v6);\n  v7[v6] = 0;\n  FMODAudioEngine::playEffect(v3, __dst, 1.0, 0.0, a1->m_volume);\n  if ( (__dst[0] & 1) != 0 )\n    operator delete(__p);\nLABEL_19:\n  if ( a1->m_colorEnabled )\n  {\n    *(float *)&v20 = a1->m_colorDip * 255.0;\n    v9 = ((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->getNormalImage)(a1);\n    LOWORD(v19.x) = 257 * (unsigned __int8)(int)*(float *)&v20;\n    BYTE2(v19.x) = (65793 * (unsigned int)(unsigned __int8)(int)*(float *)&v20) >> 16;\n    (*(void (__fastcall **)(__int64, cocos2d::CCPoint *))(*(_QWORD *)v9 + 944LL))(v9, &v19);\n  }\n  if ( a1->m_animationEnabled )\n  {\n    m_animationType = a1->m_animationType;\n    if ( m_animationType == Move )\n    {\n      v14 = (CCMenuItemSpriteExtra *)((__int64 (__fastcall *)(CCMenuItemSpriteExtra *))a1->getNormalImage)(a1);\n      cocos2d::CCNode::stopActionByTag(v14, 0);\n      *(float *)&v20 = a1->m_duration;\n      sub_10028CCE0(&v19, &a1->m_startPosition);\n      v15 = cocos2d::CCMoveTo::create(*(float *)&v20, &v19);\n      v16 = cocos2d::CCEaseInOut::create(v15, 1.5);\n      ((void (__fastcall *)(cocos2d::CCEaseInOut *, _QWORD))v16->setTag)(v16, 0);\n      a1 = v14;\n      v13 = v16;\n    }\n    else\n    {\n      if ( m_animationType )\n        return;\n      cocos2d::CCNode::stopActionByTag(a1, 0);\n      v11 = cocos2d::CCScaleTo::create_1(a1->m_duration, a1->m_baseScale * a1->m_scaleMultiplier);\n      v12 = cocos2d::CCEaseBounceOut::create(v11);\n      ((void (__fastcall *)(cocos2d::CCEaseBounceOut *, _QWORD))v12->setTag)(v12, 0);\n      v13 = v12;\n    }\n    cocos2d::CCNode::runAction(a1, v13);\n  }\n}", "assembly": "; \n; CCMenuItemSpriteExtra::selected from 0x100276f20 to 0x10027717c (604 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x1008b1ea0\n; > <???> @ 0x1008ef670\n; > <???> @ 0x1009657e8\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\npush    rbp                                                            ; +0x0, 0x100276f20\nmov     rbp, rsp                                                       ; +0x1, 0x100276f21\npush    r15                                                            ; +0x4, 0x100276f24\npush    r14                                                            ; +0x6, 0x100276f26\npush    r13                                                            ; +0x8, 0x100276f28\npush    r12                                                            ; +0xa, 0x100276f2a\npush    rbx                                                            ; +0xc, 0x100276f2c\nsub     rsp, 28h                                                       ; +0xd, 0x100276f2d\ncmp     byte ptr [rdi+153h], 1                                         ; +0x11, 0x100276f31\njnz     loc_100277168                                                  ; +0x18, 0x100276f38\nmov     rbx, rdi                                                       ; +0x1e, 0x100276f3e\ncall    cocos2d__CCMenuItemSprite__selected                            ; +0x21, 0x100276f41\nmovzx   eax, byte ptr [rbx+1B8h]                                       ; +0x26, 0x100276f46\ntest    al, 1                                                          ; +0x2d, 0x100276f4d\njnz     short loc_100276F5D                                            ; +0x2f, 0x100276f4f\nshr     eax, 1                                                         ; +0x31, 0x100276f51\ntest    rax, rax                                                       ; +0x33, 0x100276f53\njnz     short loc_100276F6D                                            ; +0x36, 0x100276f56\njmp     loc_100277038                                                  ; +0x38, 0x100276f58\nmov     rax, [rbx+1C0h]                                                ; +0x3d, 0x100276f5d\ntest    rax, rax                                                       ; +0x44, 0x100276f64\njz      loc_100277038                                                  ; +0x47, 0x100276f67\ncall    FMODAudioEngine__sharedEngine                                  ; +0x4d, 0x100276f6d\nmov     r14, rax                                                       ; +0x52, 0x100276f72\ntest    byte ptr [rbx+1B8h], 1                                         ; +0x55, 0x100276f75\njnz     short loc_100276F87                                            ; +0x5c, 0x100276f7c\nlea     r15, [rbx+1B9h]                                                ; +0x5e, 0x100276f7e\njmp     short loc_100276F8E                                            ; +0x65, 0x100276f85\nmov     r15, [rbx+1C8h]                                                ; +0x67, 0x100276f87\nmov     rdi, r15; __s                                                  ; +0x6e, 0x100276f8e\ncall    _strlen                                                        ; +0x71, 0x100276f91\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x76, 0x100276f96\njnb     loc_100277177                                                  ; +0x7a, 0x100276f9a\nmov     r12, rax                                                       ; +0x80, 0x100276fa0\ncmp     rax, 17h                                                       ; +0x83, 0x100276fa3\njnb     short loc_100276FBB                                            ; +0x87, 0x100276fa7\nlea     eax, [r12+r12]                                                 ; +0x89, 0x100276fa9\nmov     byte ptr [rbp+__dst], al                                       ; +0x8d, 0x100276fad\nlea     r13, [rbp+__dst+1]                                             ; +0x90, 0x100276fb0\ntest    r12, r12                                                       ; +0x94, 0x100276fb4\njnz     short loc_100276FF6                                            ; +0x97, 0x100276fb7\njmp     short loc_100277004                                            ; +0x99, 0x100276fb9\nmov     rax, r12                                                       ; +0x9b, 0x100276fbb\nor      rax, 7                                                         ; +0x9e, 0x100276fbe\nlea     rcx, [rax+1]                                                   ; +0xa2, 0x100276fc2\ncmp     rax, 17h                                                       ; +0xa6, 0x100276fc6\nmov     [rbp+var_30], r14                                              ; +0xaa, 0x100276fca\nmov     r14d, 1Ah                                                      ; +0xae, 0x100276fce\ncmovnz  r14, rcx                                                       ; +0xb4, 0x100276fd4\nmov     rdi, r14; __sz                                                 ; +0xb8, 0x100276fd8\ncall    __Znwm; operator new(ulong)                                    ; +0xbb, 0x100276fdb\nmov     r13, rax                                                       ; +0xc0, 0x100276fe0\nmov     [rbp+__p], rax                                                 ; +0xc3, 0x100276fe3\ninc     r14                                                            ; +0xc7, 0x100276fe7\nmov     [rbp+__dst], r14                                               ; +0xca, 0x100276fea\nmov     r14, [rbp+var_30]                                              ; +0xce, 0x100276fee\nmov     [rbp+var_48], r12                                              ; +0xd2, 0x100276ff2\nmov     rdi, r13; __dst                                                ; +0xd6, 0x100276ff6\nmov     rsi, r15; __src                                                ; +0xd9, 0x100276ff9\nmov     rdx, r12; __len                                                ; +0xdc, 0x100276ffc\ncall    _memmove                                                       ; +0xdf, 0x100276fff\nmov     byte ptr [r13+r12+0], 0                                        ; +0xe4, 0x100277004\nmovss   xmm2, dword ptr [rbx+19Ch]                                     ; +0xea, 0x10027700a\nlea     rsi, [rbp+__dst]                                               ; +0xf2, 0x100277012\nmovss   xmm0, cs:alpha                                                 ; +0xf6, 0x100277016\nxorps   xmm1, xmm1                                                     ; +0xfe, 0x10027701e\nmov     rdi, r14                                                       ; +0x101, 0x100277021\ncall    FMODAudioEngine__playEffect                                    ; +0x104, 0x100277024\ntest    byte ptr [rbp+__dst], 1                                        ; +0x109, 0x100277029\njz      short loc_100277038                                            ; +0x10d, 0x10027702d\nmov     rdi, [rbp+__p]; __p                                            ; +0x10f, 0x10027702f\ncall    __ZdlPv; operator delete(void *)                               ; +0x113, 0x100277033\ncmp     byte ptr [rbx+199h], 1                                         ; +0x118, 0x100277038\njnz     short loc_10027708A                                            ; +0x11f, 0x10027703f\nmovss   xmm0, dword ptr [rbx+1D0h]                                     ; +0x121, 0x100277041\nmulss   xmm0, cs:dword_100815C10                                       ; +0x129, 0x100277049\nmovss   dword ptr [rbp+var_30], xmm0                                   ; +0x131, 0x100277051\nmov     rax, [rbx]                                                     ; +0x136, 0x100277056\nmov     rdi, rbx                                                       ; +0x139, 0x100277059\ncall    qword ptr [rax+420h]                                           ; +0x13c, 0x10027705c\ncvttss2si ecx, dword ptr [rbp+var_30]                                  ; +0x142, 0x100277062\nmovzx   ecx, cl                                                        ; +0x147, 0x100277067\nimul    ecx, 10101h                                                    ; +0x14a, 0x10027706a\nmov     [rbp+var_38], cx                                               ; +0x150, 0x100277070\nshr     ecx, 10h                                                       ; +0x154, 0x100277074\nmov     [rbp+var_36], cl                                               ; +0x157, 0x100277077\nmov     rcx, [rax]                                                     ; +0x15a, 0x10027707a\nlea     rsi, [rbp+var_38]                                              ; +0x15d, 0x10027707d\nmov     rdi, rax                                                       ; +0x161, 0x100277081\ncall    qword ptr [rcx+3B0h]                                           ; +0x164, 0x100277084\ncmp     byte ptr [rbx+198h], 1                                         ; +0x16a, 0x10027708a\njnz     loc_100277168                                                  ; +0x171, 0x100277091\nmov     eax, [rbx+1E4h]                                                ; +0x177, 0x100277097\ncmp     eax, 1                                                         ; +0x17d, 0x10027709d\njz      short loc_1002770EF                                            ; +0x180, 0x1002770a0\ntest    eax, eax                                                       ; +0x182, 0x1002770a2\njnz     loc_100277168                                                  ; +0x184, 0x1002770a4\nmov     rdi, rbx                                                       ; +0x18a, 0x1002770aa\nxor     esi, esi                                                       ; +0x18d, 0x1002770ad\ncall    cocos2d__CCNode__stopActionByTag                               ; +0x18f, 0x1002770af\nmovss   xmm1, dword ptr [rbx+194h]                                     ; +0x194, 0x1002770b4\nmovss   xmm0, dword ptr [rbx+1DCh]                                     ; +0x19c, 0x1002770bc\nmulss   xmm1, dword ptr [rbx+190h]                                     ; +0x1a4, 0x1002770c4\ncall    cocos2d__CCScaleTo__create_1                                   ; +0x1ac, 0x1002770cc\nmov     rdi, rax                                                       ; +0x1b1, 0x1002770d1\ncall    cocos2d__CCEaseBounceOut__create                               ; +0x1b4, 0x1002770d4\nmov     r14, rax                                                       ; +0x1b9, 0x1002770d9\nmov     rax, [rax]                                                     ; +0x1bc, 0x1002770dc\nmov     rdi, r14                                                       ; +0x1bf, 0x1002770df\nxor     esi, esi                                                       ; +0x1c2, 0x1002770e2\ncall    qword ptr [rax+48h]                                            ; +0x1c4, 0x1002770e4\nmov     rdi, rbx                                                       ; +0x1c7, 0x1002770e7\nmov     rsi, r14                                                       ; +0x1ca, 0x1002770ea\njmp     short loc_100277163                                            ; +0x1cd, 0x1002770ed\nmov     rax, [rbx]                                                     ; +0x1cf, 0x1002770ef\nmov     rdi, rbx                                                       ; +0x1d2, 0x1002770f2\ncall    qword ptr [rax+420h]                                           ; +0x1d5, 0x1002770f5\nmov     r14, rax                                                       ; +0x1db, 0x1002770fb\nmov     rdi, rax                                                       ; +0x1de, 0x1002770fe\nxor     esi, esi                                                       ; +0x1e1, 0x100277101\ncall    cocos2d__CCNode__stopActionByTag                               ; +0x1e3, 0x100277103\nmovss   xmm0, dword ptr [rbx+1DCh]                                     ; +0x1e8, 0x100277108\nmovss   dword ptr [rbp+var_30], xmm0                                   ; +0x1f0, 0x100277110\nlea     rsi, [rbx+1E8h]                                                ; +0x1f5, 0x100277115\nadd     rbx, 1D4h                                                      ; +0x1fc, 0x10027711c\nlea     r15, [rbp+var_38]                                              ; +0x203, 0x100277123\nmov     rdi, r15                                                       ; +0x207, 0x100277127\nmov     rdx, rbx                                                       ; +0x20a, 0x10027712a\ncall    sub_10028CCE0                                                  ; +0x20d, 0x10027712d\nmovss   xmm0, dword ptr [rbp+var_30]                                   ; +0x212, 0x100277132\nmov     rdi, r15                                                       ; +0x217, 0x100277137\ncall    cocos2d__CCMoveTo__create                                      ; +0x21a, 0x10027713a\nmovss   xmm0, cs:dword_100815000                                       ; +0x21f, 0x10027713f\nmov     rdi, rax                                                       ; +0x227, 0x100277147\ncall    cocos2d__CCEaseInOut__create                                   ; +0x22a, 0x10027714a\nmov     rbx, rax                                                       ; +0x22f, 0x10027714f\nmov     rax, [rax]                                                     ; +0x232, 0x100277152\nmov     rdi, rbx                                                       ; +0x235, 0x100277155\nxor     esi, esi                                                       ; +0x238, 0x100277158\ncall    qword ptr [rax+48h]                                            ; +0x23a, 0x10027715a\nmov     rdi, r14                                                       ; +0x23d, 0x10027715d\nmov     rsi, rbx                                                       ; +0x240, 0x100277160\ncall    cocos2d__CCNode__runAction                                     ; +0x243, 0x100277163\nadd     rsp, 28h                                                       ; +0x248, 0x100277168\npop     rbx                                                            ; +0x24c, 0x10027716c\npop     r12                                                            ; +0x24d, 0x10027716d\npop     r13                                                            ; +0x24f, 0x10027716f\npop     r14                                                            ; +0x251, 0x100277171\npop     r15                                                            ; +0x253, 0x100277173\npop     rbp                                                            ; +0x255, 0x100277175\nretn                                                                   ; +0x256, 0x100277176\ncall    sub_100006BF0                                                  ; +0x257, 0x100277177", "xrefs": ["<???> @ 0x1008b1ea0", "<???> @ 0x1008ef670", "<???> @ 0x1009657e8"], "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"}