{"type": "func", "start": 6443190320, "end": 6443190488, "name": "cocos2d::CCIMEDispatcher::addDelegate", "pseudocode": "// \n// cocos2d::CCIMEDispatcher::addDelegate from 0x1800b4830 to 0x1800b48d8 (168 bytes)\n// \n// 3 xrefs:\n// > cocos2d::CCIMEDelegate::CCIMEDelegate @ 0x1800b45fe\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b891c\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\n// Hidden C++ exception states: #wind=1\nvoid __fastcall cocos2d::CCIMEDispatcher::addDelegate(\n        cocos2d::CCIMEDispatcher *this,\n        struct cocos2d::CCIMEDelegate *a2)\n{\n  cocos2d::CCIMEDispatcher::Impl *m_pImpl; // rdi\n  __int64 **v4; // r8\n  __int64 *v5; // rsi\n  __int64 **v6; // rax\n  __int64 **v7; // rax\n  __int64 *v8; // rcx\n\n  if ( a2 )\n  {\n    m_pImpl = this->m_pImpl;\n    if ( this->m_pImpl )\n    {\n      v4 = *(__int64 ***)m_pImpl;\n      v5 = **(__int64 ***)m_pImpl;\n      v6 = (__int64 **)v5;\n      if ( v5 == *(__int64 **)m_pImpl )\n        goto LABEL_8;\n      while ( a2 != (struct cocos2d::CCIMEDelegate *)v6[2] )\n      {\n        v6 = (__int64 **)*v6;\n        if ( v6 == v4 )\n          goto LABEL_8;\n      }\n      if ( v4 == v6 )\n      {\nLABEL_8:\n        if ( *((_QWORD *)m_pImpl + 1) == 0xAAAAAAAAAAAAAAALL )\n          std::_Xlength_error(\"list too long\");\n        v7 = (__int64 **)operator new(0x18u);\n        v7[2] = (__int64 *)a2;\n        ++*((_QWORD *)m_pImpl + 1);\n        v8 = (__int64 *)v5[1];\n        *v7 = v5;\n        v7[1] = v8;\n        v5[1] = (__int64)v7;\n        *v8 = (__int64)v7;\n      }\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCIMEDispatcher::addDelegate from 0x1800b4830 to 0x1800b48d8 (168 bytes)\n; \n; 3 xrefs:\n; > cocos2d::CCIMEDelegate::CCIMEDelegate @ 0x1800b45fe\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b891c\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, 0x1800b4830\njz      locret_1800B48CA                                               ; +0x3, 0x1800b4833\nmov     [rsp+arg_0], rbx                                               ; +0x9, 0x1800b4839\nmov     [rsp+arg_8], rsi                                               ; +0xe, 0x1800b483e\npush    rdi                                                            ; +0x13, 0x1800b4843\nsub     rsp, 30h                                                       ; +0x14, 0x1800b4844\nmov     rbx, rdx                                                       ; +0x18, 0x1800b4848\nmov     rdi, [rcx]                                                     ; +0x1b, 0x1800b484b\ntest    rdi, rdi                                                       ; +0x1e, 0x1800b484e\njz      short loc_1800B48BB                                            ; +0x21, 0x1800b4851\nmov     r8, [rdi]                                                      ; +0x23, 0x1800b4853\nmov     rsi, [r8]                                                      ; +0x26, 0x1800b4856\nmov     rax, rsi                                                       ; +0x29, 0x1800b4859\ncmp     rsi, r8                                                        ; +0x2c, 0x1800b485c\njz      short loc_1800B4879                                            ; +0x2f, 0x1800b485f\ncmp     rbx, [rax+10h]                                                 ; +0x31, 0x1800b4861\njz      short loc_1800B4874                                            ; +0x35, 0x1800b4865\nmov     rcx, [rax]                                                     ; +0x37, 0x1800b4867\nmov     rax, rcx                                                       ; +0x3a, 0x1800b486a\ncmp     rcx, r8                                                        ; +0x3d, 0x1800b486d\njnz     short loc_1800B4861                                            ; +0x40, 0x1800b4870\njmp     short loc_1800B4879                                            ; +0x42, 0x1800b4872\ncmp     r8, rax                                                        ; +0x44, 0x1800b4874\njnz     short loc_1800B48BB                                            ; +0x47, 0x1800b4877\nmov     rax, 0AAAAAAAAAAAAAAAh                                         ; +0x49, 0x1800b4879\ncmp     [rdi+8], rax                                                   ; +0x53, 0x1800b4883\njz      short loc_1800B48CB                                            ; +0x57, 0x1800b4887\nmov     [rsp+38h+var_18], rdi                                          ; +0x59, 0x1800b4889\nmov     [rsp+38h+var_10], 0                                            ; +0x5e, 0x1800b488e\nmov     ecx, 18h; Size                                                 ; +0x67, 0x1800b4897\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x6c, 0x1800b489c\nmov     [rax+10h], rbx                                                 ; +0x71, 0x1800b48a1\ninc     qword ptr [rdi+8]                                              ; +0x75, 0x1800b48a5\nmov     rcx, [rsi+8]                                                   ; +0x79, 0x1800b48a9\nmov     [rax], rsi                                                     ; +0x7d, 0x1800b48ad\nmov     [rax+8], rcx                                                   ; +0x80, 0x1800b48b0\nmov     [rsi+8], rax                                                   ; +0x84, 0x1800b48b4\nmov     [rcx], rax                                                     ; +0x88, 0x1800b48b8\nmov     rbx, [rsp+38h+arg_0]                                           ; +0x8b, 0x1800b48bb\nmov     rsi, [rsp+38h+arg_8]                                           ; +0x90, 0x1800b48c0\nadd     rsp, 30h                                                       ; +0x95, 0x1800b48c5\npop     rdi                                                            ; +0x99, 0x1800b48c9\nretn                                                                   ; +0x9a, 0x1800b48ca\nlea     rcx, aListTooLong; \"list too long\"                             ; +0x9b, 0x1800b48cb\ncall    ?_Xlength_error@std@@YAXPEBD@Z; std::_Xlength_error(char const *) ; +0xa2, 0x1800b48d2\ndb 0CCh                                                                ; +0xa7, 0x1800b48d7", "xrefs": ["cocos2d::CCIMEDelegate::CCIMEDelegate @ 0x1800b45fe", "<???> @ 0x1801438a8", "<???> @ 0x1801b891c"], "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"}