{"type": "func", "start": 6443204960, "end": 6443205326, "name": "cocos2d::CCKeypadDispatcher::dispatchKeypadMSG", "pseudocode": "// \n// cocos2d::CCKeypadDispatcher::dispatchKeypadMSG from 0x1800b8160 to 0x1800b82ce (366 bytes)\n// \n// 6 xrefs:\n// > cocos2d::CCLayer::keyDown @ 0x180052341\n// > cocos2d::CCApplication::updateControllerKeys @ 0x180076f7d\n// > <???> @ 0x18014a464\n// > <???> @ 0x18014a4bc\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801c2b5c\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:22 +0000\n// \n\nchar __fastcall cocos2d::CCKeypadDispatcher::dispatchKeypadMSG(__int64 a1, int a2)\n{\n  cocos2d::CCArray *v4; // rcx\n  __int64 v5; // rdi\n  int v6; // esi\n  char v7; // bp\n  int v8; // eax\n  cocos2d::CCNotificationObserver *v9; // rax\n  struct cocos2d::CCObject *Target; // rax\n  Concurrency::details::_NonReentrantLock *v11; // rcx\n  unsigned int v12; // esi\n  Concurrency::details::_NonReentrantLock *v13; // rcx\n  struct cocos2d::CCObject *v14; // rax\n\n  if ( *((_BYTE *)cocos2d::CCDirector::sharedDirector() + 176) )\n    return 1;\n  v4 = *(cocos2d::CCArray **)(a1 + 56);\n  *(_BYTE *)(a1 + 64) = 1;\n  v5 = 0;\n  if ( (unsigned int)cocos2d::CCArray::count(v4) )\n  {\n    v6 = 0;\n    v7 = 0;\n    if ( (unsigned int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 56)) )\n    {\n      while ( 1 )\n      {\n        v8 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 56));\n        v9 = cocos2d::CCArray::stringAtIndex(*(cocos2d::CCArray **)(a1 + 56), v8 + ~v6);\n        if ( !v9 || v7 )\n          goto LABEL_12;\n        Target = cocos2d::CCNotificationObserver::getTarget(v9);\n        if ( a2 == 1 )\n          break;\n        if ( a2 == 2 )\n        {\n          (*(void (__fastcall **)(struct cocos2d::CCObject *, _QWORD, struct cocos2d::CCObject *))(*(_QWORD *)Target\n                                                                                                 + 8LL))(\n            Target,\n            *(_QWORD *)(*(_QWORD *)Target + 8LL),\n            Target);\nLABEL_10:\n          v7 = 1;\n        }\n        if ( ++v6 >= (unsigned int)cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 56)) )\n          goto LABEL_12;\n      }\n      (**(void (__fastcall ***)(struct cocos2d::CCObject *, _QWORD))Target)(Target, (unsigned int)(a2 - 1));\n      goto LABEL_10;\n    }\n  }\nLABEL_12:\n  *(_BYTE *)(a1 + 64) = 0;\n  if ( *(_BYTE *)(a1 + 66) )\n  {\n    v11 = *(Concurrency::details::_NonReentrantLock **)(a1 + 80);\n    v12 = 0;\n    for ( *(_BYTE *)(a1 + 66) = 0; v12 < *(_DWORD *)v11; ++v12 )\n    {\n      cocos2d::CCMouseDispatcher::forceRemoveDelegate(\n        (cocos2d::CCMouseDispatcher *)a1,\n        *(struct cocos2d::CCMouseDelegate **)(*((_QWORD *)v11 + 2) + 8LL * v12));\n      v11 = *(Concurrency::details::_NonReentrantLock **)(a1 + 80);\n    }\n    Concurrency::details::_NonReentrantLock::_Release(v11);\n  }\n  if ( *(_BYTE *)(a1 + 65) )\n  {\n    v13 = *(Concurrency::details::_NonReentrantLock **)(a1 + 72);\n    *(_BYTE *)(a1 + 65) = 0;\n    if ( *(_DWORD *)v13 )\n    {\n      do\n      {\n        v14 = cocos2d::CCKeypadHandler::handlerWithDelegate(*(struct cocos2d::CCKeypadDelegate **)(*((_QWORD *)v13 + 2)\n                                                                                                 + 8 * v5));\n        if ( v14 )\n          cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 56), v14);\n        v13 = *(Concurrency::details::_NonReentrantLock **)(a1 + 72);\n        v5 = (unsigned int)(v5 + 1);\n      }\n      while ( (unsigned int)v5 < *(_DWORD *)v13 );\n    }\n    Concurrency::details::_NonReentrantLock::_Release(v13);\n  }\n  return 1;\n}", "assembly": "; \n; cocos2d::CCKeypadDispatcher::dispatchKeypadMSG from 0x1800b8160 to 0x1800b82ce (366 bytes)\n; \n; 6 xrefs:\n; > cocos2d::CCLayer::keyDown @ 0x180052341\n; > cocos2d::CCApplication::updateControllerKeys @ 0x180076f7d\n; > <???> @ 0x18014a464\n; > <???> @ 0x18014a4bc\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801c2b5c\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:22 +0000\n; \nmov     [rsp+arg_18], rbx                                              ; +0x0, 0x1800b8160\npush    r14                                                            ; +0x5, 0x1800b8165\nsub     rsp, 20h                                                       ; +0x7, 0x1800b8167\nmov     r14d, edx                                                      ; +0xb, 0x1800b816b\nmov     rbx, rcx                                                       ; +0xe, 0x1800b816e\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x11, 0x1800b8171\ncmp     byte ptr [rax+0B0h], 0                                         ; +0x16, 0x1800b8176\njnz     loc_1800B82C0                                                  ; +0x1d, 0x1800b817d\nmov     rcx, [rbx+38h]; this                                           ; +0x23, 0x1800b8183\nmov     [rsp+28h+arg_10], rdi                                          ; +0x27, 0x1800b8187\nmov     [rsp+28h+arg_8], rsi                                           ; +0x2c, 0x1800b818c\nmov     byte ptr [rbx+40h], 1                                          ; +0x31, 0x1800b8191\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x35, 0x1800b8195\nxor     edi, edi                                                       ; +0x3a, 0x1800b819a\ntest    eax, eax                                                       ; +0x3c, 0x1800b819c\njz      short loc_1800B821E                                            ; +0x3e, 0x1800b819e\nmov     rcx, [rbx+38h]; this                                           ; +0x40, 0x1800b81a0\nmov     esi, edi                                                       ; +0x44, 0x1800b81a4\nmov     [rsp+28h+arg_0], rbp                                           ; +0x46, 0x1800b81a6\nxor     bpl, bpl                                                       ; +0x4b, 0x1800b81ab\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x4e, 0x1800b81ae\ntest    eax, eax                                                       ; +0x53, 0x1800b81b3\njz      short loc_1800B8219                                            ; +0x55, 0x1800b81b5\nmov     rcx, [rbx+38h]; this                                           ; +0x57, 0x1800b81b7\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x5b, 0x1800b81bb\nmov     rcx, [rbx+38h]; this                                           ; +0x60, 0x1800b81c0\nmov     edx, esi                                                       ; +0x64, 0x1800b81c4\nnot     edx                                                            ; +0x66, 0x1800b81c6\nadd     edx, eax; unsigned int                                         ; +0x68, 0x1800b81c8\ncall    ?stringAtIndex@CCArray@cocos2d@@QEAAPEAVCCString@2@I@Z; cocos2d::CCArray::stringAtIndex(uint) ; +0x6a, 0x1800b81ca\ntest    rax, rax                                                       ; +0x6f, 0x1800b81cf\njz      short loc_1800B8219                                            ; +0x72, 0x1800b81d2\ntest    bpl, bpl                                                       ; +0x74, 0x1800b81d4\njnz     short loc_1800B8219                                            ; +0x77, 0x1800b81d7\nmov     rcx, rax; this                                                 ; +0x79, 0x1800b81d9\ncall    ?getTarget@CCNotificationObserver@cocos2d@@UEAAPEAVCCObject@2@XZ; cocos2d::CCNotificationObserver::getTarget(void) ; +0x7c, 0x1800b81dc\nmov     edx, r14d                                                      ; +0x81, 0x1800b81e1\nmov     r8, rax                                                        ; +0x84, 0x1800b81e4\nsub     edx, 1                                                         ; +0x87, 0x1800b81e7\njz      short loc_1800B81FF                                            ; +0x8a, 0x1800b81ea\ncmp     edx, 1                                                         ; +0x8c, 0x1800b81ec\njnz     short loc_1800B820A                                            ; +0x8f, 0x1800b81ef\nmov     rcx, [rax]                                                     ; +0x91, 0x1800b81f1\nmov     rdx, [rcx+8]                                                   ; +0x94, 0x1800b81f4\nmov     rcx, rax                                                       ; +0x98, 0x1800b81f8\ncall    rdx                                                            ; +0x9b, 0x1800b81fb\njmp     short loc_1800B8207                                            ; +0x9d, 0x1800b81fd\nmov     rax, [rax]                                                     ; +0x9f, 0x1800b81ff\nmov     rcx, r8                                                        ; +0xa2, 0x1800b8202\ncall    qword ptr [rax]                                                ; +0xa5, 0x1800b8205\nmov     bpl, 1                                                         ; +0xa7, 0x1800b8207\nmov     rcx, [rbx+38h]; this                                           ; +0xaa, 0x1800b820a\ninc     esi                                                            ; +0xae, 0x1800b820e\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xb0, 0x1800b8210\ncmp     esi, eax                                                       ; +0xb5, 0x1800b8215\njb      short loc_1800B81B7                                            ; +0xb7, 0x1800b8217\nmov     rbp, [rsp+28h+arg_0]                                           ; +0xb9, 0x1800b8219\nmov     [rbx+40h], dil                                                 ; +0xbe, 0x1800b821e\ncmp     [rbx+42h], dil                                                 ; +0xc2, 0x1800b8222\njz      short loc_1800B8261                                            ; +0xc6, 0x1800b8226\nmov     rcx, [rbx+50h]                                                 ; +0xc8, 0x1800b8228\nmov     esi, edi                                                       ; +0xcc, 0x1800b822c\nmov     [rbx+42h], dil                                                 ; +0xce, 0x1800b822e\ncmp     [rcx], edi                                                     ; +0xd2, 0x1800b8232\njbe     short loc_1800B825C                                            ; +0xd4, 0x1800b8234\nnop     word ptr [rax+rax+00000000h]                                   ; +0xd6, 0x1800b8236\nmov     rdx, [rcx+10h]                                                 ; +0xe0, 0x1800b8240\nmov     rcx, rbx; this                                                 ; +0xe4, 0x1800b8244\nmov     eax, esi                                                       ; +0xe7, 0x1800b8247\nmov     rdx, [rdx+rax*8]; struct cocos2d::CCMouseDelegate *            ; +0xe9, 0x1800b8249\ncall    ?forceRemoveDelegate@CCMouseDispatcher@cocos2d@@QEAAXPEAVCCMouseDelegate@2@@Z; cocos2d::CCMouseDispatcher::forceRemoveDelegate(cocos2d::CCMouseDelegate *) ; +0xed, 0x1800b824d\nmov     rcx, [rbx+50h]; this                                           ; +0xf2, 0x1800b8252\ninc     esi                                                            ; +0xf6, 0x1800b8256\ncmp     esi, [rcx]                                                     ; +0xf8, 0x1800b8258\njb      short loc_1800B8240                                            ; +0xfa, 0x1800b825a\ncall    ?_Release@_NonReentrantLock@details@Concurrency@@QEAAXXZ; Concurrency::details::_NonReentrantLock::_Release(void) ; +0xfc, 0x1800b825c\nmov     rsi, [rsp+28h+arg_8]                                           ; +0x101, 0x1800b8261\ncmp     [rbx+41h], dil                                                 ; +0x106, 0x1800b8266\njz      short loc_1800B82AD                                            ; +0x10a, 0x1800b826a\nmov     rcx, [rbx+48h]                                                 ; +0x10c, 0x1800b826c\nmov     [rbx+41h], dil                                                 ; +0x110, 0x1800b8270\ncmp     [rcx], edi                                                     ; +0x114, 0x1800b8274\njbe     short loc_1800B82A8                                            ; +0x116, 0x1800b8276\nnop     dword ptr [rax+rax+00000000h]                                  ; +0x118, 0x1800b8278\nmov     rcx, [rcx+10h]                                                 ; +0x120, 0x1800b8280\nmov     rcx, [rcx+rdi*8]; struct cocos2d::CCKeypadDelegate *           ; +0x124, 0x1800b8284\ncall    ?handlerWithDelegate@CCKeypadHandler@cocos2d@@SAPEAV12@PEAVCCKeypadDelegate@2@@Z; cocos2d::CCKeypadHandler::handlerWithDelegate(cocos2d::CCKeypadDelegate *) ; +0x128, 0x1800b8288\ntest    rax, rax                                                       ; +0x12d, 0x1800b828d\njz      short loc_1800B829E                                            ; +0x130, 0x1800b8290\nmov     rcx, [rbx+38h]; this                                           ; +0x132, 0x1800b8292\nmov     rdx, rax; struct cocos2d::CCObject *                           ; +0x136, 0x1800b8296\ncall    ?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x139, 0x1800b8299\nmov     rcx, [rbx+48h]; this                                           ; +0x13e, 0x1800b829e\ninc     edi                                                            ; +0x142, 0x1800b82a2\ncmp     edi, [rcx]                                                     ; +0x144, 0x1800b82a4\njb      short loc_1800B8280                                            ; +0x146, 0x1800b82a6\ncall    ?_Release@_NonReentrantLock@details@Concurrency@@QEAAXXZ; Concurrency::details::_NonReentrantLock::_Release(void) ; +0x148, 0x1800b82a8\nmov     rdi, [rsp+28h+arg_10]                                          ; +0x14d, 0x1800b82ad\nmov     al, 1                                                          ; +0x152, 0x1800b82b2\nmov     rbx, [rsp+28h+arg_18]                                          ; +0x154, 0x1800b82b4\nadd     rsp, 20h                                                       ; +0x159, 0x1800b82b9\npop     r14                                                            ; +0x15d, 0x1800b82bd\nretn                                                                   ; +0x15f, 0x1800b82bf\nmov     rbx, [rsp+28h+arg_18]                                          ; +0x160, 0x1800b82c0\nmov     al, 1                                                          ; +0x165, 0x1800b82c5\nadd     rsp, 20h                                                       ; +0x167, 0x1800b82c7\npop     r14                                                            ; +0x16b, 0x1800b82cb\nretn                                                                   ; +0x16d, 0x1800b82cd", "xrefs": ["cocos2d::CCLayer::keyDown @ 0x180052341", "cocos2d::CCApplication::updateControllerKeys @ 0x180076f7d", "<???> @ 0x18014a464", "<???> @ 0x18014a4bc", "<???> @ 0x18014cf68", "<???> @ 0x1801c2b5c"], "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"}