{"type": "func", "start": 6442816448, "end": 6442816579, "name": "cocos2d::CCMenu::giveMenuTouchPriority", "pseudocode": "// \n// cocos2d::CCMenu::giveMenuTouchPriority from 0x1800593c0 to 0x180059443 (131 bytes)\n// \n// 2 xrefs:\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b2af0\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::CCMenu::giveMenuTouchPriority(cocos2d::CCMenu *this)\n{\n  cocos2d::CCMenuItem *m_pSelectedItem; // rcx\n  struct cocos2d::CCDirector *v3; // rax\n  cocos2d::CCMenu_vtbl *v4; // rbx\n  __int64 v5; // rax\n  __int64 v6; // rdx\n\n  if ( this->m_eState == kCCMenuStateTrackingTouch )\n  {\n    m_pSelectedItem = this->m_pSelectedItem;\n    if ( m_pSelectedItem )\n    {\n      ((void (__fastcall *)(cocos2d::CCMenuItem *))m_pSelectedItem->unselected)(m_pSelectedItem);\n      this->m_pSelectedItem = nullptr;\n    }\n    this->m_eState = kCCMenuStateWaiting;\n  }\n  ((void (__fastcall *)(cocos2d::CCMenu *, _QWORD))this->setTouchEnabled)(this, 0);\n  v3 = cocos2d::CCDirector::sharedDirector();\n  v4 = this->cocos2d::CCLayerRGBA::cocos2d::CCLayer::cocos2d::CCNode::cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n  v5 = ((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v3->getTouchDispatcher)(v3);\n  ((void (__fastcall *)(cocos2d::CCMenu *, _QWORD))v4->setTouchPriority)(\n    this,\n    (unsigned int)(*(_DWORD *)(v5 + 124) - 1));\n  LOBYTE(v6) = 1;\n  ((void (__fastcall *)(cocos2d::CCMenu *, __int64))this->setTouchEnabled)(this, v6);\n}", "assembly": "; \n; cocos2d::CCMenu::giveMenuTouchPriority from 0x1800593c0 to 0x180059443 (131 bytes)\n; \n; 2 xrefs:\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b2af0\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_0], rbx                                               ; +0x0, 0x1800593c0\npush    rdi                                                            ; +0x5, 0x1800593c5\nsub     rsp, 20h                                                       ; +0x6, 0x1800593c6\ncmp     dword ptr [rcx+1B4h], 1                                        ; +0xa, 0x1800593ca\nmov     rdi, rcx                                                       ; +0x11, 0x1800593d1\njnz     short loc_1800593FA                                            ; +0x14, 0x1800593d4\nmov     rcx, [rcx+1B8h]                                                ; +0x16, 0x1800593d6\nxor     ebx, ebx                                                       ; +0x1d, 0x1800593dd\ntest    rcx, rcx                                                       ; +0x1f, 0x1800593df\njz      short loc_1800593F4                                            ; +0x22, 0x1800593e2\nmov     rax, [rcx]                                                     ; +0x24, 0x1800593e4\ncall    qword ptr [rax+378h]                                           ; +0x27, 0x1800593e7\nmov     [rdi+1B8h], rbx                                                ; +0x2d, 0x1800593ed\nmov     [rdi+1B4h], ebx                                                ; +0x34, 0x1800593f4\nmov     rax, [rdi]                                                     ; +0x3a, 0x1800593fa\nxor     edx, edx                                                       ; +0x3d, 0x1800593fd\nmov     rcx, rdi                                                       ; +0x3f, 0x1800593ff\ncall    qword ptr [rax+388h]                                           ; +0x42, 0x180059402\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x48, 0x180059408\nmov     rbx, [rdi]                                                     ; +0x4d, 0x18005940d\nmov     rcx, rax                                                       ; +0x50, 0x180059410\nmov     rdx, [rax]                                                     ; +0x53, 0x180059413\ncall    qword ptr [rdx+90h]                                            ; +0x56, 0x180059416\nmov     rcx, rdi                                                       ; +0x5c, 0x18005941c\nmov     edx, [rax+7Ch]                                                 ; +0x5f, 0x18005941f\ndec     edx                                                            ; +0x62, 0x180059422\ncall    qword ptr [rbx+3A0h]                                           ; +0x64, 0x180059424\nmov     rax, [rdi]                                                     ; +0x6a, 0x18005942a\nmov     dl, 1                                                          ; +0x6d, 0x18005942d\nmov     rcx, rdi                                                       ; +0x6f, 0x18005942f\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x72, 0x180059432\nadd     rsp, 20h                                                       ; +0x77, 0x180059437\npop     rdi                                                            ; +0x7b, 0x18005943b\njmp     qword ptr [rax+388h]                                           ; +0x7c, 0x18005943c", "xrefs": ["<???> @ 0x1801438a8", "<???> @ 0x1801b2af0"], "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"}