{"type": "func", "start": 6443189280, "end": 6443189649, "name": "cocos2d::CCKeypadDispatcher::dispatchKeypadMSG", "pseudocode": "// \n// cocos2d::CCKeypadDispatcher::dispatchKeypadMSG from 0x1800b4420 to 0x1800b4591 (369 bytes)\n// \n// 6 xrefs:\n// > cocos2d::CCLayer::keyDown @ 0x18005051e\n// > cocos2d::CCApplication::updateControllerKeys @ 0x1800742e9\n// > <???> @ 0x1801410c8\n// > <???> @ 0x180141120\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b8868\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\nchar __fastcall cocos2d::CCKeypadDispatcher::dispatchKeypadMSG(\n        cocos2d::CCKeypadDispatcher *this,\n        enum cocos2d::ccKeypadMSGType a2)\n{\n  cocos2d::CCArray *m_pDelegates; // rcx\n  __int64 v5; // rdi\n  int v6; // esi\n  char v7; // bp\n  int v8; // eax\n  struct cocos2d::CCString *v9; // rax\n  struct cocos2d::CCObject *Target; // rax\n  cocos2d::_ccCArray *m_pHandlersToRemove; // rcx\n  unsigned int v12; // esi\n  cocos2d::_ccCArray *m_pHandlersToAdd; // rax\n  struct cocos2d::CCKeypadHandler *v14; // rax\n\n  if ( cocos2d::CCDirector::sharedDirector()->m_bIsTransitioning )\n    return 1;\n  m_pDelegates = this->m_pDelegates;\n  this->m_bLocked = 1;\n  v5 = 0;\n  if ( (unsigned int)cocos2d::CCArray::count(m_pDelegates) )\n  {\n    v6 = 0;\n    v7 = 0;\n    if ( (unsigned int)cocos2d::CCArray::count(this->m_pDelegates) )\n    {\n      while ( 1 )\n      {\n        v8 = cocos2d::CCArray::count(this->m_pDelegates);\n        v9 = cocos2d::CCArray::stringAtIndex(this->m_pDelegates, v8 + -1 - v6);\n        if ( !v9 || v7 )\n          goto LABEL_12;\n        Target = cocos2d::CCNotificationObserver::getTarget((cocos2d::CCNotificationObserver *)v9);\n        if ( a2 == kTypeBackClicked )\n          break;\n        if ( a2 == kTypeMenuClicked )\n        {\n          ((void (__fastcall *)(struct cocos2d::CCObject *, cocos2d::CCObject_vtbl *, struct cocos2d::CCObject *))Target->~CCObject)(\n            Target,\n            Target->__vftable,\n            Target);\nLABEL_10:\n          v7 = 1;\n        }\n        if ( ++v6 >= (unsigned int)cocos2d::CCArray::count(this->m_pDelegates) )\n          goto LABEL_12;\n      }\n      ((void (__fastcall *)(struct cocos2d::CCObject *, _QWORD))Target->copyWithZone)(Target, (unsigned int)(a2 - 1));\n      goto LABEL_10;\n    }\n  }\nLABEL_12:\n  this->m_bLocked = 0;\n  if ( this->m_bToRemove )\n  {\n    m_pHandlersToRemove = this->m_pHandlersToRemove;\n    v12 = 0;\n    for ( this->m_bToRemove = 0; v12 < m_pHandlersToRemove->num; ++v12 )\n    {\n      cocos2d::CCMouseDispatcher::forceRemoveDelegate(\n        (cocos2d::CCMouseDispatcher *)this,\n        (struct cocos2d::CCObject *)m_pHandlersToRemove->arr[v12]);\n      m_pHandlersToRemove = this->m_pHandlersToRemove;\n    }\n    Concurrency::details::_NonReentrantLock::_Release((Concurrency::details::_NonReentrantLock *)m_pHandlersToRemove);\n  }\n  if ( this->m_bToAdd )\n  {\n    m_pHandlersToAdd = this->m_pHandlersToAdd;\n    this->m_bToAdd = 0;\n    if ( m_pHandlersToAdd->num )\n    {\n      do\n      {\n        v14 = cocos2d::CCKeypadHandler::handlerWithDelegate((cocos2d::CCObject_vtbl *)m_pHandlersToAdd->arr[v5]);\n        if ( v14 )\n          cocos2d::CCArray::addObject(this->m_pDelegates, v14);\n        m_pHandlersToAdd = this->m_pHandlersToAdd;\n        v5 = (unsigned int)(v5 + 1);\n      }\n      while ( (unsigned int)v5 < m_pHandlersToAdd->num );\n    }\n    Concurrency::details::_NonReentrantLock::_Release((Concurrency::details::_NonReentrantLock *)m_pHandlersToAdd);\n  }\n  return 1;\n}", "assembly": "; \n; cocos2d::CCKeypadDispatcher::dispatchKeypadMSG from 0x1800b4420 to 0x1800b4591 (369 bytes)\n; \n; 6 xrefs:\n; > cocos2d::CCLayer::keyDown @ 0x18005051e\n; > cocos2d::CCApplication::updateControllerKeys @ 0x1800742e9\n; > <???> @ 0x1801410c8\n; > <???> @ 0x180141120\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b8868\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_18], rbx                                              ; +0x0, 0x1800b4420\npush    r14                                                            ; +0x5, 0x1800b4425\nsub     rsp, 20h                                                       ; +0x7, 0x1800b4427\nmov     r14d, edx                                                      ; +0xb, 0x1800b442b\nmov     rbx, rcx                                                       ; +0xe, 0x1800b442e\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x11, 0x1800b4431\ncmp     byte ptr [rax+0A8h], 0                                         ; +0x16, 0x1800b4436\njnz     loc_1800B4583                                                  ; +0x1d, 0x1800b443d\nmov     rcx, [rbx+38h]; this                                           ; +0x23, 0x1800b4443\nmov     [rsp+28h+arg_10], rdi                                          ; +0x27, 0x1800b4447\nmov     [rsp+28h+arg_8], rsi                                           ; +0x2c, 0x1800b444c\nmov     byte ptr [rbx+40h], 1                                          ; +0x31, 0x1800b4451\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x35, 0x1800b4455\nxor     edi, edi                                                       ; +0x3a, 0x1800b445a\ntest    eax, eax                                                       ; +0x3c, 0x1800b445c\njz      short loc_1800B44DE                                            ; +0x3e, 0x1800b445e\nmov     rcx, [rbx+38h]; this                                           ; +0x40, 0x1800b4460\nmov     esi, edi                                                       ; +0x44, 0x1800b4464\nmov     [rsp+28h+arg_0], rbp                                           ; +0x46, 0x1800b4466\nxor     bpl, bpl                                                       ; +0x4b, 0x1800b446b\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x4e, 0x1800b446e\ntest    eax, eax                                                       ; +0x53, 0x1800b4473\njz      short loc_1800B44D9                                            ; +0x55, 0x1800b4475\nmov     rcx, [rbx+38h]; this                                           ; +0x57, 0x1800b4477\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x5b, 0x1800b447b\nmov     rcx, [rbx+38h]; this                                           ; +0x60, 0x1800b4480\nmov     edx, 0FFFFFFFFh                                                ; +0x64, 0x1800b4484\nsub     edx, esi                                                       ; +0x69, 0x1800b4489\nadd     edx, eax; unsigned int                                         ; +0x6b, 0x1800b448b\ncall    ?stringAtIndex@CCArray@cocos2d@@QEAAPEAVCCString@2@I@Z; cocos2d::CCArray::stringAtIndex(uint) ; +0x6d, 0x1800b448d\ntest    rax, rax                                                       ; +0x72, 0x1800b4492\njz      short loc_1800B44D9                                            ; +0x75, 0x1800b4495\ntest    bpl, bpl                                                       ; +0x77, 0x1800b4497\njnz     short loc_1800B44D9                                            ; +0x7a, 0x1800b449a\nmov     rcx, rax; this                                                 ; +0x7c, 0x1800b449c\ncall    ?getTarget@CCNotificationObserver@cocos2d@@UEAAPEAVCCObject@2@XZ; cocos2d::CCNotificationObserver::getTarget(void) ; +0x7f, 0x1800b449f\nmov     edx, r14d                                                      ; +0x84, 0x1800b44a4\nmov     r8, rax                                                        ; +0x87, 0x1800b44a7\nsub     edx, 1                                                         ; +0x8a, 0x1800b44aa\njz      short loc_1800B44BF                                            ; +0x8d, 0x1800b44ad\ncmp     edx, 1                                                         ; +0x8f, 0x1800b44af\njnz     short loc_1800B44CA                                            ; +0x92, 0x1800b44b2\nmov     rdx, [rax]                                                     ; +0x94, 0x1800b44b4\nmov     rcx, rax                                                       ; +0x97, 0x1800b44b7\ncall    qword ptr [rdx+8]                                              ; +0x9a, 0x1800b44ba\njmp     short loc_1800B44C7                                            ; +0x9d, 0x1800b44bd\nmov     rax, [rax]                                                     ; +0x9f, 0x1800b44bf\nmov     rcx, r8                                                        ; +0xa2, 0x1800b44c2\ncall    qword ptr [rax]                                                ; +0xa5, 0x1800b44c5\nmov     bpl, 1                                                         ; +0xa7, 0x1800b44c7\nmov     rcx, [rbx+38h]; this                                           ; +0xaa, 0x1800b44ca\ninc     esi                                                            ; +0xae, 0x1800b44ce\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xb0, 0x1800b44d0\ncmp     esi, eax                                                       ; +0xb5, 0x1800b44d5\njb      short loc_1800B4477                                            ; +0xb7, 0x1800b44d7\nmov     rbp, [rsp+28h+arg_0]                                           ; +0xb9, 0x1800b44d9\nmov     [rbx+40h], dil                                                 ; +0xbe, 0x1800b44de\ncmp     [rbx+42h], dil                                                 ; +0xc2, 0x1800b44e2\njz      short loc_1800B4521                                            ; +0xc6, 0x1800b44e6\nmov     rcx, [rbx+50h]                                                 ; +0xc8, 0x1800b44e8\nmov     esi, edi                                                       ; +0xcc, 0x1800b44ec\nmov     [rbx+42h], dil                                                 ; +0xce, 0x1800b44ee\ncmp     [rcx], edi                                                     ; +0xd2, 0x1800b44f2\njbe     short loc_1800B451C                                            ; +0xd4, 0x1800b44f4\nnop     word ptr [rax+rax+00000000h]                                   ; +0xd6, 0x1800b44f6\nmov     rdx, [rcx+10h]                                                 ; +0xe0, 0x1800b4500\nmov     rcx, rbx; this                                                 ; +0xe4, 0x1800b4504\nmov     eax, esi                                                       ; +0xe7, 0x1800b4507\nmov     rdx, [rdx+rax*8]; struct cocos2d::CCMouseDelegate *            ; +0xe9, 0x1800b4509\ncall    ?forceRemoveDelegate@CCMouseDispatcher@cocos2d@@QEAAXPEAVCCMouseDelegate@2@@Z; cocos2d::CCMouseDispatcher::forceRemoveDelegate(cocos2d::CCMouseDelegate *) ; +0xed, 0x1800b450d\nmov     rcx, [rbx+50h]; this                                           ; +0xf2, 0x1800b4512\ninc     esi                                                            ; +0xf6, 0x1800b4516\ncmp     esi, [rcx]                                                     ; +0xf8, 0x1800b4518\njb      short loc_1800B4500                                            ; +0xfa, 0x1800b451a\ncall    ?_Release@_NonReentrantLock@details@Concurrency@@QEAAXXZ; Concurrency::details::_NonReentrantLock::_Release(void) ; +0xfc, 0x1800b451c\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x101, 0x1800b4521\ncmp     [rbx+41h], dil                                                 ; +0x106, 0x1800b4526\njz      short loc_1800B4570                                            ; +0x10a, 0x1800b452a\nmov     rax, [rbx+48h]                                                 ; +0x10c, 0x1800b452c\nmov     [rbx+41h], dil                                                 ; +0x110, 0x1800b4530\ncmp     [rax], edi                                                     ; +0x114, 0x1800b4534\njbe     short loc_1800B4568                                            ; +0x116, 0x1800b4536\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x118, 0x1800b4538\nmov     rax, [rax+10h]                                                 ; +0x120, 0x1800b4540\nmov     rcx, [rax+rdi*8]; struct cocos2d::CCKeypadDelegate *           ; +0x124, 0x1800b4544\ncall    ?handlerWithDelegate@CCKeypadHandler@cocos2d@@SAPEAV12@PEAVCCKeypadDelegate@2@@Z; cocos2d::CCKeypadHandler::handlerWithDelegate(cocos2d::CCKeypadDelegate *) ; +0x128, 0x1800b4548\ntest    rax, rax                                                       ; +0x12d, 0x1800b454d\njz      short loc_1800B455E                                            ; +0x130, 0x1800b4550\nmov     rcx, [rbx+38h]; this                                           ; +0x132, 0x1800b4552\nmov     rdx, rax; struct cocos2d::CCObject *                           ; +0x136, 0x1800b4556\ncall    ?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x139, 0x1800b4559\nmov     rax, [rbx+48h]                                                 ; +0x13e, 0x1800b455e\ninc     edi                                                            ; +0x142, 0x1800b4562\ncmp     edi, [rax]                                                     ; +0x144, 0x1800b4564\njb      short loc_1800B4540                                            ; +0x146, 0x1800b4566\nmov     rcx, rax; this                                                 ; +0x148, 0x1800b4568\ncall    ?_Release@_NonReentrantLock@details@Concurrency@@QEAAXXZ; Concurrency::details::_NonReentrantLock::_Release(void) ; +0x14b, 0x1800b456b\nmov     rdi, [rsp+28h+arg_10]                                          ; +0x150, 0x1800b4570\nmov     al, 1                                                          ; +0x155, 0x1800b4575\nmov     rbx, [rsp+28h+arg_18]                                          ; +0x157, 0x1800b4577\nadd     rsp, 20h                                                       ; +0x15c, 0x1800b457c\npop     r14                                                            ; +0x160, 0x1800b4580\nretn                                                                   ; +0x162, 0x1800b4582\nmov     rbx, [rsp+28h+arg_18]                                          ; +0x163, 0x1800b4583\nmov     al, 1                                                          ; +0x168, 0x1800b4588\nadd     rsp, 20h                                                       ; +0x16a, 0x1800b458a\npop     r14                                                            ; +0x16e, 0x1800b458e\nretn                                                                   ; +0x170, 0x1800b4590", "xrefs": ["cocos2d::CCLayer::keyDown @ 0x18005051e", "cocos2d::CCApplication::updateControllerKeys @ 0x1800742e9", "<???> @ 0x1801410c8", "<???> @ 0x180141120", "<???> @ 0x1801438a8", "<???> @ 0x1801b8868"], "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"}