{"type": "func", "start": 6443182880, "end": 6443183088, "name": "cocos2d::CCTouchDispatcher::addTargetedDelegate", "pseudocode": "// \n// cocos2d::CCTouchDispatcher::addTargetedDelegate from 0x1800b2b20 to 0x1800b2bf0 (208 bytes)\n// \n// 5 xrefs:\n// > cocos2d::CCLayer::registerWithTouchDispatcher @ 0x180050989\n// > cocos2d::CCMenu::registerWithTouchDispatcher @ 0x1800598fa\n// > cocos2d::CCTouchDispatcher::addPrioTargetedDelegate @ 0x1800b2a70\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b8634\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::CCTouchDispatcher::addTargetedDelegate(\n        cocos2d::CCTouchDispatcher *this,\n        struct cocos2d::CCTouchDelegate *a2,\n        int a3,\n        bool a4)\n{\n  unsigned int m_targetPrio; // esi\n  struct cocos2d::CCTargetedTouchHandler *v8; // rax\n  struct cocos2d::CCObject *v9; // rsi\n\n  m_targetPrio = a3;\n  if ( this->m_forcePrio <= 0\n    || a3 <= this->m_targetPrio\n    || ((unsigned int (__fastcall *)(struct cocos2d::CCTouchDelegate *))a2->getPreviousPriority)(a2) )\n  {\n    if ( ((unsigned int (__fastcall *)(struct cocos2d::CCTouchDelegate *))a2->getPreviousPriority)(a2) )\n      m_targetPrio = ((__int64 (__fastcall *)(struct cocos2d::CCTouchDelegate *))a2->getPreviousPriority)(a2);\n  }\n  else\n  {\n    m_targetPrio = this->m_targetPrio;\n  }\n  ((void (__fastcall *)(struct cocos2d::CCTouchDelegate *, _QWORD))a2->setPreviousPriority)(a2, m_targetPrio);\n  v8 = cocos2d::CCTargetedTouchHandler::handlerWithDelegate(a2, m_targetPrio, a4);\n  v9 = v8;\n  if ( this->m_bLocked )\n  {\n    if ( sub_18009E1B0((__int64)this->m_pHandlersToRemove, (__int64)a2) )\n    {\n      sub_18009E300((__int64)this->m_pHandlersToRemove, (__int64)a2);\n    }\n    else\n    {\n      cocos2d::CCArray::addObject(this->m_pHandlersToAdd, v9);\n      this->m_bToAdd = 1;\n    }\n  }\n  else\n  {\n    cocos2d::CCTouchDispatcher::forceAddHandler(this, v8, this->m_pTargetedHandlers);\n  }\n}", "assembly": "; \n; cocos2d::CCTouchDispatcher::addTargetedDelegate from 0x1800b2b20 to 0x1800b2bf0 (208 bytes)\n; \n; 5 xrefs:\n; > cocos2d::CCLayer::registerWithTouchDispatcher @ 0x180050989\n; > cocos2d::CCMenu::registerWithTouchDispatcher @ 0x1800598fa\n; > cocos2d::CCTouchDispatcher::addPrioTargetedDelegate @ 0x1800b2a70\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b8634\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, 0x1800b2b20\nmov     [rsp+arg_8], rbp                                               ; +0x5, 0x1800b2b25\nmov     [rsp+arg_10], rsi                                              ; +0xa, 0x1800b2b2a\npush    rdi                                                            ; +0xf, 0x1800b2b2f\nsub     rsp, 20h                                                       ; +0x10, 0x1800b2b30\ncmp     dword ptr [rcx+88h], 0                                         ; +0x14, 0x1800b2b34\nmovzx   ebp, r9b                                                       ; +0x1b, 0x1800b2b3b\nmov     esi, r8d                                                       ; +0x1f, 0x1800b2b3f\nmov     rdi, rdx                                                       ; +0x22, 0x1800b2b42\nmov     rbx, rcx                                                       ; +0x25, 0x1800b2b45\njle     short loc_1800B2B62                                            ; +0x28, 0x1800b2b48\ncmp     r8d, [rcx+7Ch]                                                 ; +0x2a, 0x1800b2b4a\njle     short loc_1800B2B62                                            ; +0x2e, 0x1800b2b4e\nmov     rax, [rdx]                                                     ; +0x30, 0x1800b2b50\nmov     rcx, rdx                                                       ; +0x33, 0x1800b2b53\ncall    qword ptr [rax+50h]                                            ; +0x36, 0x1800b2b56\ntest    eax, eax                                                       ; +0x39, 0x1800b2b59\njnz     short loc_1800B2B62                                            ; +0x3b, 0x1800b2b5b\nmov     esi, [rbx+7Ch]                                                 ; +0x3d, 0x1800b2b5d\njmp     short loc_1800B2B7A                                            ; +0x40, 0x1800b2b60\nmov     rax, [rdi]                                                     ; +0x42, 0x1800b2b62\nmov     rcx, rdi                                                       ; +0x45, 0x1800b2b65\ncall    qword ptr [rax+50h]                                            ; +0x48, 0x1800b2b68\ntest    eax, eax                                                       ; +0x4b, 0x1800b2b6b\njz      short loc_1800B2B7A                                            ; +0x4d, 0x1800b2b6d\nmov     rax, [rdi]                                                     ; +0x4f, 0x1800b2b6f\nmov     rcx, rdi                                                       ; +0x52, 0x1800b2b72\ncall    qword ptr [rax+50h]                                            ; +0x55, 0x1800b2b75\nmov     esi, eax                                                       ; +0x58, 0x1800b2b78\nmov     rax, [rdi]                                                     ; +0x5a, 0x1800b2b7a\nmov     edx, esi                                                       ; +0x5d, 0x1800b2b7d\nmov     rcx, rdi                                                       ; +0x5f, 0x1800b2b7f\ncall    qword ptr [rax+48h]                                            ; +0x62, 0x1800b2b82\nmovzx   r8d, bpl; bool                                                 ; +0x65, 0x1800b2b85\nmov     edx, esi; int                                                  ; +0x69, 0x1800b2b89\nmov     rcx, rdi; struct cocos2d::CCTouchDelegate *                    ; +0x6b, 0x1800b2b8b\ncall    ?handlerWithDelegate@CCTargetedTouchHandler@cocos2d@@SAPEAV12@PEAVCCTouchDelegate@2@H_N@Z; cocos2d::CCTargetedTouchHandler::handlerWithDelegate(cocos2d::CCTouchDelegate *,int,bool) ; +0x6e, 0x1800b2b8e\ncmp     byte ptr [rbx+50h], 0                                          ; +0x73, 0x1800b2b93\nmov     rsi, rax                                                       ; +0x77, 0x1800b2b97\njnz     short loc_1800B2BAD                                            ; +0x7a, 0x1800b2b9a\nmov     r8, [rbx+40h]; struct cocos2d::CCArray *                       ; +0x7c, 0x1800b2b9c\nmov     rdx, rax; struct cocos2d::CCTouchHandler *                     ; +0x80, 0x1800b2ba0\nmov     rcx, rbx; this                                                 ; +0x83, 0x1800b2ba3\ncall    ?forceAddHandler@CCTouchDispatcher@cocos2d@@IEAAXPEAVCCTouchHandler@2@PEAVCCArray@2@@Z; cocos2d::CCTouchDispatcher::forceAddHandler(cocos2d::CCTouchHandler *,cocos2d::CCArray *) ; +0x86, 0x1800b2ba6\njmp     short loc_1800B2BDB                                            ; +0x8b, 0x1800b2bab\nmov     rcx, [rbx+60h]                                                 ; +0x8d, 0x1800b2bad\nmov     rdx, rdi                                                       ; +0x91, 0x1800b2bb1\ncall    sub_18009E1B0                                                  ; +0x94, 0x1800b2bb4\ntest    al, al                                                         ; +0x99, 0x1800b2bb9\njz      short loc_1800B2BCB                                            ; +0x9b, 0x1800b2bbb\nmov     rcx, [rbx+60h]                                                 ; +0x9d, 0x1800b2bbd\nmov     rdx, rdi                                                       ; +0xa1, 0x1800b2bc1\ncall    sub_18009E300                                                  ; +0xa4, 0x1800b2bc4\njmp     short loc_1800B2BDB                                            ; +0xa9, 0x1800b2bc9\nmov     rcx, [rbx+58h]; this                                           ; +0xab, 0x1800b2bcb\nmov     rdx, rsi; struct cocos2d::CCObject *                           ; +0xaf, 0x1800b2bcf\ncall    ?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xb2, 0x1800b2bd2\nmov     byte ptr [rbx+51h], 1                                          ; +0xb7, 0x1800b2bd7\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xbb, 0x1800b2bdb\nmov     rbp, [rsp+28h+arg_8]                                           ; +0xc0, 0x1800b2be0\nmov     rsi, [rsp+28h+arg_10]                                          ; +0xc5, 0x1800b2be5\nadd     rsp, 20h                                                       ; +0xca, 0x1800b2bea\npop     rdi                                                            ; +0xce, 0x1800b2bee\nretn                                                                   ; +0xcf, 0x1800b2bef", "xrefs": ["cocos2d::CCLayer::registerWithTouchDispatcher @ 0x180050989", "cocos2d::CCMenu::registerWithTouchDispatcher @ 0x1800598fa", "cocos2d::CCTouchDispatcher::addPrioTargetedDelegate @ 0x1800b2a70", "<???> @ 0x1801438a8", "<???> @ 0x1801b8634"], "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"}