{"type": "func", "start": 6442820128, "end": 6442820262, "name": "cocos2d::CCMenuItemToggle::activate", "pseudocode": "// \n// cocos2d::CCMenuItemToggle::activate from 0x18005a220 to 0x18005a2a6 (134 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x1800f8f88\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b2c64\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::activate(cocos2d::CCMenuItemToggle *this)\n{\n  unsigned int v2; // eax\n  cocos2d::CCObject *m_pListener; // rcx\n  void (__cdecl *ptr)(cocos2d::CCObject *); // rax\n  struct cocos2d::CCScriptEngineManager *v5; // rax\n\n  if ( this->m_bEnabled )\n  {\n    v2 = cocos2d::CCArray::count(*((cocos2d::CCArray **)this + 48));\n    ((void (__fastcall *)(cocos2d::CCMenuItemToggle *, _QWORD))this->setSelectedIndex)(\n      this,\n      (this->m_nScriptTapHandler + 1) % v2);\n  }\n  if ( this->m_bEnabled )\n  {\n    m_pListener = this->m_pListener;\n    if ( m_pListener )\n    {\n      ptr = this->m_pfnSelector.ptr;\n      if ( ptr )\n        ((void (__fastcall *)(cocos2d::CCObject *, cocos2d::CCMenuItemToggle *))ptr)(m_pListener, this);\n    }\n    if ( this->m_eScriptType )\n    {\n      v5 = cocos2d::CCScriptEngineManager::sharedManager();\n      (*(void (__fastcall **)(_QWORD, cocos2d::CCMenuItemToggle *))(**(_QWORD **)v5 + 72LL))(*(_QWORD *)v5, this);\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCMenuItemToggle::activate from 0x18005a220 to 0x18005a2a6 (134 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x1800f8f88\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b2c64\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    rbx                                                            ; +0x0, 0x18005a220\nsub     rsp, 20h                                                       ; +0x2, 0x18005a222\ncmp     byte ptr [rcx+159h], 0                                         ; +0x6, 0x18005a226\nmov     rbx, rcx                                                       ; +0xd, 0x18005a22d\njz      short loc_18005A25A                                            ; +0x10, 0x18005a230\nmov     rcx, [rcx+180h]; this                                          ; +0x12, 0x18005a232\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x19, 0x18005a239\nmov     r8d, eax                                                       ; +0x1e, 0x18005a23e\nxor     edx, edx                                                       ; +0x21, 0x18005a241\nmov     eax, [rbx+178h]                                                ; +0x23, 0x18005a243\nmov     rcx, rbx                                                       ; +0x29, 0x18005a249\ninc     eax                                                            ; +0x2c, 0x18005a24c\ndiv     r8d                                                            ; +0x2e, 0x18005a24e\nmov     rax, [rbx]                                                     ; +0x31, 0x18005a251\ncall    qword ptr [rax+3B0h]                                           ; +0x34, 0x18005a254\ncmp     byte ptr [rbx+159h], 0                                         ; +0x3a, 0x18005a25a\njz      short loc_18005A2A0                                            ; +0x41, 0x18005a261\nmov     rcx, [rbx+160h]                                                ; +0x43, 0x18005a263\ntest    rcx, rcx                                                       ; +0x4a, 0x18005a26a\njz      short loc_18005A280                                            ; +0x4d, 0x18005a26d\nmov     rax, [rbx+168h]                                                ; +0x4f, 0x18005a26f\ntest    rax, rax                                                       ; +0x56, 0x18005a276\njz      short loc_18005A280                                            ; +0x59, 0x18005a279\nmov     rdx, rbx                                                       ; +0x5b, 0x18005a27b\ncall    rax                                                            ; +0x5e, 0x18005a27e\ncmp     dword ptr [rbx+12Ch], 0                                        ; +0x60, 0x18005a280\njz      short loc_18005A2A0                                            ; +0x67, 0x18005a287\ncall    ?sharedManager@CCScriptEngineManager@cocos2d@@SAPEAV12@XZ; cocos2d::CCScriptEngineManager::sharedManager(void) ; +0x69, 0x18005a289\nmov     rdx, rbx                                                       ; +0x6e, 0x18005a28e\nmov     rcx, [rax]                                                     ; +0x71, 0x18005a291\nmov     rax, [rcx]                                                     ; +0x74, 0x18005a294\nadd     rsp, 20h                                                       ; +0x77, 0x18005a297\npop     rbx                                                            ; +0x7b, 0x18005a29b\njmp     qword ptr [rax+48h]                                            ; +0x7c, 0x18005a29c\nadd     rsp, 20h                                                       ; +0x80, 0x18005a2a0\npop     rbx                                                            ; +0x84, 0x18005a2a4\nretn                                                                   ; +0x85, 0x18005a2a5", "xrefs": ["<???> @ 0x1800f8f88", "<???> @ 0x1801438a8", "<???> @ 0x1801b2c64"], "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"}