{"type": "func", "start": 6443184368, "end": 6443184554, "name": "cocos2d::CCTouchDispatcher::removeDelegate", "pseudocode": "// \n// cocos2d::CCTouchDispatcher::removeDelegate from 0x1800b30f0 to 0x1800b31aa (186 bytes)\n// \n// 8 xrefs:\n// > cocos2d::CCLayer::onExit @ 0x18005072b\n// > cocos2d::CCLayer::setTouchEnabled @ 0x180050f10\n// > <???> @ 0x180140f0c\n// > <???> @ 0x180140f1c\n// > <???> @ 0x180140f38\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b86a0\n// > <???> @ 0x1801b86ac\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::removeDelegate(\n        cocos2d::CCTouchDispatcher *this,\n        struct cocos2d::CCObject *a2)\n{\n  cocos2d::CCArray *m_pHandlersToAdd; // rax\n  cocos2d::ccArray *data; // rbx\n  __int64 num; // rax\n  cocos2d::CCNotificationObserver **arr; // rbx\n  cocos2d::CCNotificationObserver **i; // r14\n  cocos2d::CCNotificationObserver *v9; // rdi\n\n  if ( a2 )\n  {\n    if ( this->m_bLocked )\n    {\n      m_pHandlersToAdd = this->m_pHandlersToAdd;\n      if ( m_pHandlersToAdd )\n      {\n        data = m_pHandlersToAdd->data;\n        num = data->num;\n        if ( (_DWORD)num )\n        {\n          arr = (cocos2d::CCNotificationObserver **)data->arr;\n          for ( i = &arr[num - 1]; arr <= i; ++arr )\n          {\n            v9 = *arr;\n            if ( !*arr )\n              break;\n            if ( cocos2d::CCNotificationObserver::getTarget(*arr) == a2 )\n            {\n              cocos2d::CCArray::removeObject(this->m_pHandlersToAdd, v9);\n              return;\n            }\n          }\n        }\n      }\n      sub_18009E170((__int64)this->m_pHandlersToRemove, (__int64)a2);\n      this->m_bToRemove = 1;\n    }\n    else\n    {\n      cocos2d::CCTouchDispatcher::forceRemoveDelegate(this, a2);\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCTouchDispatcher::removeDelegate from 0x1800b30f0 to 0x1800b31aa (186 bytes)\n; \n; 8 xrefs:\n; > cocos2d::CCLayer::onExit @ 0x18005072b\n; > cocos2d::CCLayer::setTouchEnabled @ 0x180050f10\n; > <???> @ 0x180140f0c\n; > <???> @ 0x180140f1c\n; > <???> @ 0x180140f38\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b86a0\n; > <???> @ 0x1801b86ac\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\ntest    rdx, rdx                                                       ; +0x0, 0x1800b30f0\njz      locret_1800B3198                                               ; +0x3, 0x1800b30f3\nmov     [rsp+arg_18], rbp                                              ; +0x9, 0x1800b30f9\npush    rsi                                                            ; +0xe, 0x1800b30fe\nsub     rsp, 20h                                                       ; +0xf, 0x1800b30ff\ncmp     byte ptr [rcx+50h], 0                                          ; +0x13, 0x1800b3103\nmov     rbp, rdx                                                       ; +0x17, 0x1800b3107\nmov     rsi, rcx                                                       ; +0x1a, 0x1800b310a\njnz     short loc_1800B311E                                            ; +0x1d, 0x1800b310d\nmov     rbp, [rsp+28h+arg_18]                                          ; +0x1f, 0x1800b310f\nadd     rsp, 20h                                                       ; +0x24, 0x1800b3114\npop     rsi                                                            ; +0x28, 0x1800b3118\njmp     ?forceRemoveDelegate@CCTouchDispatcher@cocos2d@@IEAAXPEAVCCTouchDelegate@2@@Z; cocos2d::CCTouchDispatcher::forceRemoveDelegate(cocos2d::CCTouchDelegate *) ; +0x29, 0x1800b3119\nmov     rax, [rcx+58h]                                                 ; +0x2e, 0x1800b311e\nmov     [rsp+28h+arg_0], rbx                                           ; +0x32, 0x1800b3122\nmov     [rsp+28h+arg_8], rdi                                           ; +0x37, 0x1800b3127\nmov     [rsp+28h+arg_10], r14                                          ; +0x3c, 0x1800b312c\ntest    rax, rax                                                       ; +0x41, 0x1800b3131\njz      short loc_1800B316F                                            ; +0x44, 0x1800b3134\nmov     rbx, [rax+38h]                                                 ; +0x46, 0x1800b3136\nmov     eax, [rbx]                                                     ; +0x4a, 0x1800b313a\ntest    eax, eax                                                       ; +0x4c, 0x1800b313c\njz      short loc_1800B316F                                            ; +0x4e, 0x1800b313e\nmov     rbx, [rbx+10h]                                                 ; +0x50, 0x1800b3140\nlea     r14, [rax-1]                                                   ; +0x54, 0x1800b3144\nlea     r14, [rbx+r14*8]                                               ; +0x58, 0x1800b3148\ncmp     rbx, r14                                                       ; +0x5c, 0x1800b314c\nja      short loc_1800B316F                                            ; +0x5f, 0x1800b314f\nmov     rdi, [rbx]                                                     ; +0x61, 0x1800b3151\ntest    rdi, rdi                                                       ; +0x64, 0x1800b3154\njz      short loc_1800B316F                                            ; +0x67, 0x1800b3157\nmov     rcx, rdi; this                                                 ; +0x69, 0x1800b3159\ncall    ?getTarget@CCNotificationObserver@cocos2d@@UEAAPEAVCCObject@2@XZ; cocos2d::CCNotificationObserver::getTarget(void) ; +0x6c, 0x1800b315c\ncmp     rax, rbp                                                       ; +0x71, 0x1800b3161\njz      short loc_1800B3199                                            ; +0x74, 0x1800b3164\nadd     rbx, 8                                                         ; +0x76, 0x1800b3166\ncmp     rbx, r14                                                       ; +0x7a, 0x1800b316a\njbe     short loc_1800B3151                                            ; +0x7d, 0x1800b316d\nmov     rcx, [rsi+60h]                                                 ; +0x7f, 0x1800b316f\nmov     rdx, rbp                                                       ; +0x83, 0x1800b3173\ncall    sub_18009E170                                                  ; +0x86, 0x1800b3176\nmov     byte ptr [rsi+52h], 1                                          ; +0x8b, 0x1800b317b\nmov     rdi, [rsp+28h+arg_8]                                           ; +0x8f, 0x1800b317f\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x94, 0x1800b3184\nmov     r14, [rsp+28h+arg_10]                                          ; +0x99, 0x1800b3189\nmov     rbp, [rsp+28h+arg_18]                                          ; +0x9e, 0x1800b318e\nadd     rsp, 20h                                                       ; +0xa3, 0x1800b3193\npop     rsi                                                            ; +0xa7, 0x1800b3197\nretn                                                                   ; +0xa8, 0x1800b3198\nmov     rcx, [rsi+58h]; this                                           ; +0xa9, 0x1800b3199\nmov     r8b, 1; bool                                                   ; +0xad, 0x1800b319d\nmov     rdx, rdi; struct cocos2d::CCObject *                           ; +0xb0, 0x1800b31a0\ncall    ?removeObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@_N@Z; cocos2d::CCArray::removeObject(cocos2d::CCObject *,bool) ; +0xb3, 0x1800b31a3\njmp     short loc_1800B317F                                            ; +0xb8, 0x1800b31a8", "xrefs": ["cocos2d::CCLayer::onExit @ 0x18005072b", "cocos2d::CCLayer::setTouchEnabled @ 0x180050f10", "<???> @ 0x180140f0c", "<???> @ 0x180140f1c", "<???> @ 0x180140f38", "<???> @ 0x1801438a8", "<???> @ 0x1801b86a0", "<???> @ 0x1801b86ac"], "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"}