{"type": "func", "start": 6442826640, "end": 6442826883, "name": "cocos2d::CCMenuItemToggle::setSelectedIndex", "pseudocode": "// \n// cocos2d::CCMenuItemToggle::setSelectedIndex from 0x18005bb90 to 0x18005bc83 (243 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x1800f8fd0\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b2f64\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 cocos2d::CCMenuItemToggle::setSelectedIndex(cocos2d::CCMenuItemToggle *this, int a2)\n{\n  cocos2d::CCMenuItemToggle_vtbl *v4; // rax\n  __int64 v5; // rax\n  struct cocos2d::CCString *v6; // rdi\n  _DWORD *v7; // rax\n  cocos2d::CCString_vtbl *v8; // rbx\n  float *v9; // rax\n  float v10; // [rsp+30h] [rbp+8h] BYREF\n  float v11; // [rsp+34h] [rbp+Ch]\n  float v12; // [rsp+40h] [rbp+18h] BYREF\n\n  if ( a2 != this->m_nScriptTapHandler && (unsigned int)cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 48)) )\n  {\n    v4 = this->cocos2d::CCMenuItem::cocos2d::CCNodeRGBA::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n    this->m_nScriptTapHandler = a2;\n    v5 = ((__int64 (__fastcall *)(cocos2d::CCMenuItemToggle *, __int64))v4->getChildByTag)(this, 3233828865LL);\n    if ( v5 )\n      (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v5 + 504LL))(v5, 0);\n    v6 = cocos2d::CCArray::stringAtIndex(*((cocos2d::CCArray **)this + 48), this->m_nScriptTapHandler);\n    ((void (__fastcall *)(cocos2d::CCMenuItemToggle *, struct cocos2d::CCString *, _QWORD, __int64))this->addChild)(\n      this,\n      v6,\n      0,\n      3233828865LL);\n    v7 = (_DWORD *)((__int64 (__fastcall *)(struct cocos2d::CCString *))v6->__vftable[4].isEqual)(v6);\n    cocos2d::cc_timeval::operator=(&v10, v7);\n    ((void (__fastcall *)(cocos2d::CCMenuItemToggle *, float *))this->setContentSize)(this, &v10);\n    v8 = v6->__vftable;\n    v9 = kmVec2Fill(&v12, v10 * 0.5, v11 * 0.5);\n    ((void (__fastcall *)(struct cocos2d::CCString *, float *))v8[2].encodeWithCoder)(v6, v9);\n  }\n}", "assembly": "; \n; cocos2d::CCMenuItemToggle::setSelectedIndex from 0x18005bb90 to 0x18005bc83 (243 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x1800f8fd0\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b2f64\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_8], rbx                                               ; +0x0, 0x18005bb90\npush    rdi                                                            ; +0x5, 0x18005bb95\nsub     rsp, 20h                                                       ; +0x6, 0x18005bb96\nmov     edi, edx                                                       ; +0xa, 0x18005bb9a\nmov     rbx, rcx                                                       ; +0xc, 0x18005bb9c\ncmp     edx, [rcx+178h]                                                ; +0xf, 0x18005bb9f\njz      loc_18005BC78                                                  ; +0x15, 0x18005bba5\nmov     rcx, [rcx+180h]; this                                          ; +0x1b, 0x18005bbab\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x22, 0x18005bbb2\ntest    eax, eax                                                       ; +0x27, 0x18005bbb7\njz      loc_18005BC78                                                  ; +0x29, 0x18005bbb9\nmov     rax, [rbx]                                                     ; +0x2f, 0x18005bbbf\nmov     edx, 0C0C05001h                                                ; +0x32, 0x18005bbc2\nmov     rcx, rbx                                                       ; +0x37, 0x18005bbc7\nmov     [rbx+178h], edi                                                ; +0x3a, 0x18005bbca\ncall    qword ptr [rax+1C8h]                                           ; +0x40, 0x18005bbd0\ntest    rax, rax                                                       ; +0x46, 0x18005bbd6\njz      short loc_18005BBEA                                            ; +0x49, 0x18005bbd9\nmov     r8, [rax]                                                      ; +0x4b, 0x18005bbdb\nxor     edx, edx                                                       ; +0x4e, 0x18005bbde\nmov     rcx, rax                                                       ; +0x50, 0x18005bbe0\ncall    qword ptr [r8+1F8h]                                            ; +0x53, 0x18005bbe3\nmov     edx, [rbx+178h]; unsigned int                                  ; +0x5a, 0x18005bbea\nmov     rcx, [rbx+180h]; this                                          ; +0x60, 0x18005bbf0\ncall    ?stringAtIndex@CCArray@cocos2d@@QEAAPEAVCCString@2@I@Z; cocos2d::CCArray::stringAtIndex(uint) ; +0x67, 0x18005bbf7\nmov     r10, [rbx]                                                     ; +0x6c, 0x18005bbfc\nmov     r9d, 0C0C05001h                                                ; +0x6f, 0x18005bbff\nxor     r8d, r8d                                                       ; +0x75, 0x18005bc05\nmov     rdx, rax                                                       ; +0x78, 0x18005bc08\nmov     rcx, rbx                                                       ; +0x7b, 0x18005bc0b\nmov     rdi, rax                                                       ; +0x7e, 0x18005bc0e\ncall    qword ptr [r10+1B0h]                                           ; +0x81, 0x18005bc11\nmov     rdx, [rdi]                                                     ; +0x88, 0x18005bc18\nmov     rcx, rdi                                                       ; +0x8b, 0x18005bc1b\ncall    qword ptr [rdx+130h]                                           ; +0x8e, 0x18005bc1e\nmov     rdx, rax                                                       ; +0x94, 0x18005bc24\nlea     rcx, [rsp+28h+arg_0]                                           ; +0x97, 0x18005bc27\ncall    ??4cc_timeval@cocos2d@@QEAAAEAU01@$$QEAU01@@Z; cocos2d::cc_timeval::operator=(cocos2d::cc_timeval &&) ; +0x9c, 0x18005bc2c\nmov     r8, [rbx]                                                      ; +0xa1, 0x18005bc31\nlea     rdx, [rsp+28h+arg_0]                                           ; +0xa4, 0x18005bc34\nmov     rcx, rbx                                                       ; +0xa9, 0x18005bc39\ncall    qword ptr [r8+128h]                                            ; +0xac, 0x18005bc3c\nmovss   xmm2, [rsp+28h+arg_4]                                          ; +0xb3, 0x18005bc43\nlea     rcx, [rsp+28h+arg_10]                                          ; +0xb9, 0x18005bc49\nmovss   xmm1, [rsp+28h+arg_0]                                          ; +0xbe, 0x18005bc4e\nmulss   xmm2, cs:dword_1800E6308                                       ; +0xc4, 0x18005bc54\nmov     rbx, [rdi]                                                     ; +0xcc, 0x18005bc5c\nmulss   xmm1, cs:dword_1800E6308                                       ; +0xcf, 0x18005bc5f\ncall    kmVec2Fill                                                     ; +0xd7, 0x18005bc67\nmov     rdx, rax                                                       ; +0xdc, 0x18005bc6c\nmov     rcx, rdi                                                       ; +0xdf, 0x18005bc6f\ncall    qword ptr [rbx+0B8h]                                           ; +0xe2, 0x18005bc72\nmov     rbx, [rsp+28h+arg_8]                                           ; +0xe8, 0x18005bc78\nadd     rsp, 20h                                                       ; +0xed, 0x18005bc7d\npop     rdi                                                            ; +0xf1, 0x18005bc81\nretn                                                                   ; +0xf2, 0x18005bc82", "xrefs": ["<???> @ 0x1800f8fd0", "<???> @ 0x1801438a8", "<???> @ 0x1801b2f64"], "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"}