{"type": "func", "start": 6443197744, "end": 6443198026, "name": "cocos2d::CCTouchDispatcher::addTargetedDelegate", "pseudocode": "// \n// cocos2d::CCTouchDispatcher::addTargetedDelegate from 0x1800b6530 to 0x1800b664a (282 bytes)\n// \n// 5 xrefs:\n// > cocos2d::CCLayer::registerWithTouchDispatcher @ 0x1800527a9\n// > cocos2d::CCMenu::registerWithTouchDispatcher @ 0x18005b92c\n// > cocos2d::CCTouchDispatcher::addPrioTargetedDelegate @ 0x1800b6484\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c28f8\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:22:21 +0000\n// \n\nvoid __fastcall cocos2d::CCTouchDispatcher::addTargetedDelegate(\n        cocos2d::CCTouchDispatcher *this,\n        struct cocos2d::CCTouchDelegate *a2,\n        int a3,\n        bool a4)\n{\n  struct cocos2d::CCNode *v8; // rax\n  int v9; // eax\n  struct cocos2d::CCTouchHandler *v10; // rax\n  struct cocos2d::CCObject *v11; // rsi\n  int v12; // [rsp+40h] [rbp+8h] BYREF\n\n  v12 = 0;\n  v8 = (struct cocos2d::CCNode *)_RTDynamicCast(\n                                   a2,\n                                   0,\n                                   &cocos2d::CCTouchDelegate `RTTI Type Descriptor',\n                                   &cocos2d::CCNode `RTTI Type Descriptor',\n                                   0);\n  if ( v8 && cocos2d::CCTouchDispatcher::ownerLevelOf(this, v8, &v12) )\n  {\n    v9 = v12;\n    if ( a3 <= v12 )\n      goto LABEL_12;\n    goto LABEL_11;\n  }\n  if ( *((int *)this + 40) > 0\n    && a3 > *((_DWORD *)this + 32)\n    && !(*(unsigned int (__fastcall **)(struct cocos2d::CCTouchDelegate *))(*(_QWORD *)a2 + 80LL))(a2) )\n  {\n    a3 = *((_DWORD *)this + 32);\n    goto LABEL_12;\n  }\n  if ( (*(unsigned int (__fastcall **)(struct cocos2d::CCTouchDelegate *))(*(_QWORD *)a2 + 80LL))(a2) )\n  {\n    v9 = (*(__int64 (__fastcall **)(struct cocos2d::CCTouchDelegate *))(*(_QWORD *)a2 + 80LL))(a2);\nLABEL_11:\n    a3 = v9;\n  }\nLABEL_12:\n  (*(void (__fastcall **)(struct cocos2d::CCTouchDelegate *, _QWORD))(*(_QWORD *)a2 + 72LL))(a2, (unsigned int)a3);\n  v10 = cocos2d::CCTargetedTouchHandler::handlerWithDelegate(a2, a3, a4);\n  v11 = v10;\n  if ( *((_BYTE *)this + 80) )\n  {\n    if ( sub_1800A1E40(*((_QWORD *)this + 12), (__int64)a2) )\n    {\n      sub_1800A1F90(*((_QWORD *)this + 12), (__int64)a2);\n    }\n    else\n    {\n      cocos2d::CCArray::addObject(*((cocos2d::CCArray **)this + 11), v11);\n      *((_BYTE *)this + 81) = 1;\n    }\n  }\n  else\n  {\n    cocos2d::CCTouchDispatcher::forceAddHandler(this, v10, *((struct cocos2d::CCArray **)this + 8));\n  }\n}", "assembly": "; \n; cocos2d::CCTouchDispatcher::addTargetedDelegate from 0x1800b6530 to 0x1800b664a (282 bytes)\n; \n; 5 xrefs:\n; > cocos2d::CCLayer::registerWithTouchDispatcher @ 0x1800527a9\n; > cocos2d::CCMenu::registerWithTouchDispatcher @ 0x18005b92c\n; > cocos2d::CCTouchDispatcher::addPrioTargetedDelegate @ 0x1800b6484\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c28f8\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:22:21 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1800b6530\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1800b6535\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x1800b653a\npush    rdi                                                            ; +0xf, 0x1800b653f\nsub     rsp, 30h                                                       ; +0x10, 0x1800b6540\nmov     rdi, rdx                                                       ; +0x14, 0x1800b6544\nxor     eax, eax                                                       ; +0x17, 0x1800b6547\nmovzx   ebp, r9b                                                       ; +0x19, 0x1800b6549\nmov     [rsp+38h+arg_0], eax                                           ; +0x1d, 0x1800b654d\nmov     esi, r8d                                                       ; +0x21, 0x1800b6551\nmov     [rsp+38h+var_18], eax                                          ; +0x24, 0x1800b6554\nmov     rbx, rcx                                                       ; +0x28, 0x1800b6558\nlea     r9, ??_R0?AVCCNode@cocos2d@@@8; cocos2d::CCNode `RTTI Type Descriptor' ; +0x2b, 0x1800b655b\nmov     rcx, rdi                                                       ; +0x32, 0x1800b6562\nlea     r8, ??_R0?AVCCTouchDelegate@cocos2d@@@8; cocos2d::CCTouchDelegate `RTTI Type Descriptor' ; +0x35, 0x1800b6565\nxor     edx, edx                                                       ; +0x3c, 0x1800b656c\ncall    __RTDynamicCast                                                ; +0x3e, 0x1800b656e\ntest    rax, rax                                                       ; +0x43, 0x1800b6573\njz      short loc_1800B6596                                            ; +0x46, 0x1800b6576\nlea     r8, [rsp+38h+arg_0]; int *                                     ; +0x48, 0x1800b6578\nmov     rdx, rax; struct cocos2d::CCNode *                             ; +0x4d, 0x1800b657d\nmov     rcx, rbx; this                                                 ; +0x50, 0x1800b6580\ncall    ?ownerLevelOf@CCTouchDispatcher@cocos2d@@QEAA_NPEAVCCNode@2@AEAH@Z; cocos2d::CCTouchDispatcher::ownerLevelOf(cocos2d::CCNode *,int &) ; +0x53, 0x1800b6583\ntest    al, al                                                         ; +0x58, 0x1800b6588\njz      short loc_1800B6596                                            ; +0x5a, 0x1800b658a\nmov     eax, [rsp+38h+arg_0]                                           ; +0x5c, 0x1800b658c\ncmp     esi, eax                                                       ; +0x60, 0x1800b6590\njle     short loc_1800B65D4                                            ; +0x62, 0x1800b6592\njmp     short loc_1800B65D2                                            ; +0x64, 0x1800b6594\ncmp     dword ptr [rbx+0A0h], 0                                        ; +0x66, 0x1800b6596\njle     short loc_1800B65BC                                            ; +0x6d, 0x1800b659d\ncmp     esi, [rbx+80h]                                                 ; +0x6f, 0x1800b659f\njle     short loc_1800B65BC                                            ; +0x75, 0x1800b65a5\nmov     rax, [rdi]                                                     ; +0x77, 0x1800b65a7\nmov     rcx, rdi                                                       ; +0x7a, 0x1800b65aa\ncall    qword ptr [rax+50h]                                            ; +0x7d, 0x1800b65ad\ntest    eax, eax                                                       ; +0x80, 0x1800b65b0\njnz     short loc_1800B65BC                                            ; +0x82, 0x1800b65b2\nmov     esi, [rbx+80h]                                                 ; +0x84, 0x1800b65b4\njmp     short loc_1800B65D4                                            ; +0x8a, 0x1800b65ba\nmov     rax, [rdi]                                                     ; +0x8c, 0x1800b65bc\nmov     rcx, rdi                                                       ; +0x8f, 0x1800b65bf\ncall    qword ptr [rax+50h]                                            ; +0x92, 0x1800b65c2\ntest    eax, eax                                                       ; +0x95, 0x1800b65c5\njz      short loc_1800B65D4                                            ; +0x97, 0x1800b65c7\nmov     rax, [rdi]                                                     ; +0x99, 0x1800b65c9\nmov     rcx, rdi                                                       ; +0x9c, 0x1800b65cc\ncall    qword ptr [rax+50h]                                            ; +0x9f, 0x1800b65cf\nmov     esi, eax                                                       ; +0xa2, 0x1800b65d2\nmov     rax, [rdi]                                                     ; +0xa4, 0x1800b65d4\nmov     edx, esi                                                       ; +0xa7, 0x1800b65d7\nmov     rcx, rdi                                                       ; +0xa9, 0x1800b65d9\ncall    qword ptr [rax+48h]                                            ; +0xac, 0x1800b65dc\nmovzx   r8d, bpl; bool                                                 ; +0xaf, 0x1800b65df\nmov     edx, esi; int                                                  ; +0xb3, 0x1800b65e3\nmov     rcx, rdi; struct cocos2d::CCTouchDelegate *                    ; +0xb5, 0x1800b65e5\ncall    ?handlerWithDelegate@CCTargetedTouchHandler@cocos2d@@SAPEAV12@PEAVCCTouchDelegate@2@H_N@Z; cocos2d::CCTargetedTouchHandler::handlerWithDelegate(cocos2d::CCTouchDelegate *,int,bool) ; +0xb8, 0x1800b65e8\ncmp     byte ptr [rbx+50h], 0                                          ; +0xbd, 0x1800b65ed\nmov     rsi, rax                                                       ; +0xc1, 0x1800b65f1\njnz     short loc_1800B6607                                            ; +0xc4, 0x1800b65f4\nmov     r8, [rbx+40h]; struct cocos2d::CCArray *                       ; +0xc6, 0x1800b65f6\nmov     rdx, rax; struct cocos2d::CCTouchHandler *                     ; +0xca, 0x1800b65fa\nmov     rcx, rbx; this                                                 ; +0xcd, 0x1800b65fd\ncall    ?forceAddHandler@CCTouchDispatcher@cocos2d@@IEAAXPEAVCCTouchHandler@2@PEAVCCArray@2@@Z; cocos2d::CCTouchDispatcher::forceAddHandler(cocos2d::CCTouchHandler *,cocos2d::CCArray *) ; +0xd0, 0x1800b6600\njmp     short loc_1800B6635                                            ; +0xd5, 0x1800b6605\nmov     rcx, [rbx+60h]                                                 ; +0xd7, 0x1800b6607\nmov     rdx, rdi                                                       ; +0xdb, 0x1800b660b\ncall    sub_1800A1E40                                                  ; +0xde, 0x1800b660e\ntest    al, al                                                         ; +0xe3, 0x1800b6613\njz      short loc_1800B6625                                            ; +0xe5, 0x1800b6615\nmov     rcx, [rbx+60h]                                                 ; +0xe7, 0x1800b6617\nmov     rdx, rdi                                                       ; +0xeb, 0x1800b661b\ncall    sub_1800A1F90                                                  ; +0xee, 0x1800b661e\njmp     short loc_1800B6635                                            ; +0xf3, 0x1800b6623\nmov     rcx, [rbx+58h]; this                                           ; +0xf5, 0x1800b6625\nmov     rdx, rsi; struct cocos2d::CCObject *                           ; +0xf9, 0x1800b6629\ncall    ?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xfc, 0x1800b662c\nmov     byte ptr [rbx+51h], 1                                          ; +0x101, 0x1800b6631\nmov     rbx, [rsp+38h+arg_8]                                           ; +0x105, 0x1800b6635\nmov     rbp, [rsp+38h+arg_10]                                          ; +0x10a, 0x1800b663a\nmov     rsi, [rsp+38h+arg_18]                                          ; +0x10f, 0x1800b663f\nadd     rsp, 30h                                                       ; +0x114, 0x1800b6644\npop     rdi                                                            ; +0x118, 0x1800b6648\nretn                                                                   ; +0x119, 0x1800b6649", "xrefs": ["cocos2d::CCLayer::registerWithTouchDispatcher @ 0x1800527a9", "cocos2d::CCMenu::registerWithTouchDispatcher @ 0x18005b92c", "cocos2d::CCTouchDispatcher::addPrioTargetedDelegate @ 0x1800b6484", "<???> @ 0x18014cf68", "<???> @ 0x1801c28f8"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}