{"type": "func", "start": 6442780944, "end": 6442781070, "name": "cocos2d::CCLayer::registerWithTouchDispatcher", "pseudocode": "// \n// cocos2d::CCLayer::registerWithTouchDispatcher from 0x180050910 to 0x18005098e (126 bytes)\n// \n// 7 xrefs:\n// > <???> @ 0x1800ed258\n// > <???> @ 0x1800ed718\n// > <???> @ 0x1800edc50\n// > <???> @ 0x1800ee1b8\n// > <???> @ 0x1800ee790\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b2034\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::CCLayer::registerWithTouchDispatcher(cocos2d::CCLayer *this)\n{\n  struct cocos2d::CCDirector *v2; // rax\n  cocos2d::CCTouchDispatcher *v3; // rax\n  cocos2d::CCTouchScriptHandlerEntry *m_pScriptTouchHandlerEntry; // r8\n  struct cocos2d::CCTouchDelegate *v5; // rdx\n  char m_bSwallowsTouches; // r9\n  int m_nPriority; // r8d\n\n  v2 = cocos2d::CCDirector::sharedDirector();\n  v3 = (cocos2d::CCTouchDispatcher *)((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v2->getTouchDispatcher)(v2);\n  m_pScriptTouchHandlerEntry = this->m_pScriptTouchHandlerEntry;\n  v5 = &this->cocos2d::CCTouchDelegate;\n  if ( m_pScriptTouchHandlerEntry )\n  {\n    if ( !m_pScriptTouchHandlerEntry->m_bIsMultiTouches )\n    {\n      m_bSwallowsTouches = m_pScriptTouchHandlerEntry->m_bSwallowsTouches;\n      m_nPriority = m_pScriptTouchHandlerEntry->m_nPriority;\nLABEL_9:\n      if ( !this )\n        v5 = nullptr;\n      cocos2d::CCTouchDispatcher::addTargetedDelegate(v3, v5, m_nPriority, m_bSwallowsTouches);\n      return;\n    }\n  }\n  else if ( this->m_eTouchMode )\n  {\n    m_nPriority = this->m_nTouchPriority;\n    m_bSwallowsTouches = 1;\n    goto LABEL_9;\n  }\n  if ( !this )\n    v5 = nullptr;\n  cocos2d::CCTouchDispatcher::addStandardDelegate(v3, v5, 0);\n}", "assembly": "; \n; cocos2d::CCLayer::registerWithTouchDispatcher from 0x180050910 to 0x18005098e (126 bytes)\n; \n; 7 xrefs:\n; > <???> @ 0x1800ed258\n; > <???> @ 0x1800ed718\n; > <???> @ 0x1800edc50\n; > <???> @ 0x1800ee1b8\n; > <???> @ 0x1800ee790\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b2034\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, 0x180050910\nsub     rsp, 20h                                                       ; +0x2, 0x180050912\nmov     rbx, rcx                                                       ; +0x6, 0x180050916\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x9, 0x180050919\nmov     rcx, rax                                                       ; +0xe, 0x18005091e\nmov     rdx, [rax]                                                     ; +0x11, 0x180050921\ncall    qword ptr [rdx+90h]                                            ; +0x14, 0x180050924\nmov     r8, [rbx+170h]                                                 ; +0x1a, 0x18005092a\nlea     rdx, [rbx+140h]                                                ; +0x21, 0x180050931\nxor     ecx, ecx                                                       ; +0x28, 0x180050938\ntest    r8, r8                                                         ; +0x2a, 0x18005093a\njz      short loc_180050950                                            ; +0x2d, 0x18005093d\ncmp     [r8+40h], cl                                                   ; +0x2f, 0x18005093f\njnz     short loc_180050959                                            ; +0x33, 0x180050943\nmovzx   r9d, byte ptr [r8+48h]                                         ; +0x35, 0x180050945\nmov     r8d, [r8+44h]                                                  ; +0x3a, 0x18005094a\njmp     short loc_18005097A                                            ; +0x3e, 0x18005094e\ncmp     dword ptr [rbx+18Ch], 0                                        ; +0x40, 0x180050950\njnz     short loc_180050970                                            ; +0x47, 0x180050957\ntest    rbx, rbx                                                       ; +0x49, 0x180050959\ncmovz   rdx, rcx; struct cocos2d::CCTouchDelegate *                    ; +0x4c, 0x18005095c\nxor     r8d, r8d; int                                                  ; +0x50, 0x180050960\nmov     rcx, rax; this                                                 ; +0x53, 0x180050963\nadd     rsp, 20h                                                       ; +0x56, 0x180050966\npop     rbx                                                            ; +0x5a, 0x18005096a\njmp     ?addStandardDelegate@CCTouchDispatcher@cocos2d@@QEAAXPEAVCCTouchDelegate@2@H@Z; cocos2d::CCTouchDispatcher::addStandardDelegate(cocos2d::CCTouchDelegate *,int) ; +0x5b, 0x18005096b\nmov     r8d, [rbx+188h]; int                                           ; +0x60, 0x180050970\nmov     r9b, 1; bool                                                   ; +0x67, 0x180050977\ntest    rbx, rbx                                                       ; +0x6a, 0x18005097a\ncmovz   rdx, rcx; struct cocos2d::CCTouchDelegate *                    ; +0x6d, 0x18005097d\nmov     rcx, rax; this                                                 ; +0x71, 0x180050981\nadd     rsp, 20h                                                       ; +0x74, 0x180050984\npop     rbx                                                            ; +0x78, 0x180050988\njmp     ?addTargetedDelegate@CCTouchDispatcher@cocos2d@@QEAAXPEAVCCTouchDelegate@2@H_N@Z; cocos2d::CCTouchDispatcher::addTargetedDelegate(cocos2d::CCTouchDelegate *,int,bool) ; +0x79, 0x180050989", "xrefs": ["<???> @ 0x1800ed258", "<???> @ 0x1800ed718", "<???> @ 0x1800edc50", "<???> @ 0x1800ee1b8", "<???> @ 0x1800ee790", "<???> @ 0x1801438a8", "<???> @ 0x1801b2034"], "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"}