{"type": "func", "start": 6442738592, "end": 6442738840, "name": "cocos2d::CCKeyboardDispatcher::dispatchToTopDelegate", "pseudocode": "// \n// cocos2d::CCKeyboardDispatcher::dispatchToTopDelegate from 0x1800463a0 to 0x180046498 (248 bytes)\n// \n// 6 xrefs:\n// > cocos2d::CCKeyboardDispatcher::dispatchKeyboardMSG @ 0x1800462e2\n// > cocos2d::CCKeyboardDispatcher::releaseAllKeys @ 0x180047103\n// > <???> @ 0x180140360\n// > <???> @ 0x180140394\n// > <???> @ 0x18014cf68\n// > <???> @ 0x1801bb8c0\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:21:41 +0000\n// \n\nunsigned __int64 __fastcall cocos2d::CCKeyboardDispatcher::dispatchToTopDelegate(\n        __int64 a1,\n        unsigned int a2,\n        unsigned __int8 a3,\n        __int64 *a4)\n{\n  unsigned __int64 result; // rax\n  struct cocos2d::CCObject *Target; // rax\n  __int64 v10; // rdx\n  char v11; // bp\n  unsigned __int64 v12; // rbx\n  struct cocos2d::CCObject *v13; // rsi\n  __int64 v14; // rdx\n  __int64 (__fastcall **v15)(struct cocos2d::CCObject *, _QWORD); // rax\n\n  result = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 56));\n  if ( (_DWORD)result )\n  {\n    result = (unsigned __int64)cocos2d::CCArray::lastObject(*(cocos2d::CCArray **)(a1 + 56));\n    if ( result )\n    {\n      Target = cocos2d::CCNotificationObserver::getTarget((cocos2d::CCNotificationObserver *)result);\n      v10 = *a4;\n      v11 = 0;\n      v12 = 0;\n      v13 = Target;\n      if ( !((a4[1] - *a4) >> 2) )\n        goto LABEL_9;\n      do\n      {\n        v14 = *(unsigned int *)(v10 + 4 * v12);\n        if ( (_DWORD)v14\n          && (*(unsigned __int8 (__fastcall **)(struct cocos2d::CCObject *, __int64, _QWORD))(*(_QWORD *)v13 + 16LL))(\n               v13,\n               v14,\n               a3) )\n        {\n          v11 = 1;\n        }\n        v10 = *a4;\n        ++v12;\n        result = (a4[1] - *a4) >> 2;\n      }\n      while ( v12 < result );\n      if ( !v11 )\n      {\nLABEL_9:\n        v15 = *(__int64 (__fastcall ***)(struct cocos2d::CCObject *, _QWORD))v13;\n        if ( a3 )\n          return (*v15)(v13, a2);\n        else\n          return v15[1](v13, a2);\n      }\n    }\n  }\n  return result;\n}", "assembly": "; \n; cocos2d::CCKeyboardDispatcher::dispatchToTopDelegate from 0x1800463a0 to 0x180046498 (248 bytes)\n; \n; 6 xrefs:\n; > cocos2d::CCKeyboardDispatcher::dispatchKeyboardMSG @ 0x1800462e2\n; > cocos2d::CCKeyboardDispatcher::releaseAllKeys @ 0x180047103\n; > <???> @ 0x180140360\n; > <???> @ 0x180140394\n; > <???> @ 0x18014cf68\n; > <???> @ 0x1801bb8c0\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:21:41 +0000\n; \nmov     [rsp+arg_18], rbx                                              ; +0x0, 0x1800463a0\npush    rdi                                                            ; +0x5, 0x1800463a5\npush    r14                                                            ; +0x6, 0x1800463a6\npush    r15                                                            ; +0x8, 0x1800463a8\nsub     rsp, 30h                                                       ; +0xa, 0x1800463aa\nmov     rbx, rcx                                                       ; +0xe, 0x1800463ae\nmov     rdi, r9                                                        ; +0x11, 0x1800463b1\nmov     rcx, [rcx+38h]; this                                           ; +0x14, 0x1800463b4\nmovzx   r14d, r8b                                                      ; +0x18, 0x1800463b8\nmov     r15d, edx                                                      ; +0x1c, 0x1800463bc\ncall    ?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x1f, 0x1800463bf\ntest    eax, eax                                                       ; +0x24, 0x1800463c4\njz      loc_180046489                                                  ; +0x26, 0x1800463c6\nmov     rcx, [rbx+38h]; this                                           ; +0x2c, 0x1800463cc\ncall    ?lastObject@CCArray@cocos2d@@QEAAPEAVCCObject@2@XZ; cocos2d::CCArray::lastObject(void) ; +0x30, 0x1800463d0\ntest    rax, rax                                                       ; +0x35, 0x1800463d5\njz      loc_180046489                                                  ; +0x38, 0x1800463d8\nmov     [rsp+48h+arg_0], rbp                                           ; +0x3e, 0x1800463de\nmov     rcx, rax; this                                                 ; +0x43, 0x1800463e3\nmov     [rsp+48h+arg_8], rsi                                           ; +0x46, 0x1800463e6\nmovaps  [rsp+48h+var_28], xmm6                                         ; +0x4b, 0x1800463eb\ncall    ?getTarget@CCNotificationObserver@cocos2d@@UEAAPEAVCCObject@2@XZ; cocos2d::CCNotificationObserver::getTarget(void) ; +0x50, 0x1800463f0\nmov     rdx, [rdi]                                                     ; +0x55, 0x1800463f5\nxor     bpl, bpl                                                       ; +0x58, 0x1800463f8\nmov     rcx, [rdi+8]                                                   ; +0x5b, 0x1800463fb\nxor     ebx, ebx                                                       ; +0x5f, 0x1800463ff\nmovsd   xmm6, [rsp+48h+arg_20]                                         ; +0x61, 0x180046401\nsub     rcx, rdx                                                       ; +0x67, 0x180046407\nsar     rcx, 2                                                         ; +0x6a, 0x18004640a\nmov     rsi, rax                                                       ; +0x6e, 0x18004640e\ntest    rcx, rcx                                                       ; +0x71, 0x180046411\njz      short loc_180046462                                            ; +0x74, 0x180046414\nmov     [rsp+48h+arg_10], r12                                          ; +0x76, 0x180046416\nmov     r12d, 1                                                        ; +0x7b, 0x18004641b\nmov     edx, [rdx+rbx*4]                                               ; +0x81, 0x180046421\ntest    edx, edx                                                       ; +0x84, 0x180046424\njz      short loc_180046442                                            ; +0x86, 0x180046426\nmov     rax, [rsi]                                                     ; +0x88, 0x180046428\nmovaps  xmm3, xmm6                                                     ; +0x8b, 0x18004642b\nmovzx   r8d, r14b                                                      ; +0x8e, 0x18004642e\nmov     rcx, rsi                                                       ; +0x92, 0x180046432\ncall    qword ptr [rax+10h]                                            ; +0x95, 0x180046435\ntest    al, al                                                         ; +0x98, 0x180046438\nmovzx   ebp, bpl                                                       ; +0x9a, 0x18004643a\ncmovnz  ebp, r12d                                                      ; +0x9e, 0x18004643e\nmov     rdx, [rdi]                                                     ; +0xa2, 0x180046442\ninc     rbx                                                            ; +0xa5, 0x180046445\nmov     rax, [rdi+8]                                                   ; +0xa8, 0x180046448\nsub     rax, rdx                                                       ; +0xac, 0x18004644c\nsar     rax, 2                                                         ; +0xaf, 0x18004644f\ncmp     rbx, rax                                                       ; +0xb3, 0x180046453\njb      short loc_180046421                                            ; +0xb6, 0x180046456\nmov     r12, [rsp+48h+arg_10]                                          ; +0xb8, 0x180046458\ntest    bpl, bpl                                                       ; +0xbd, 0x18004645d\njnz     short loc_18004647A                                            ; +0xc0, 0x180046460\nmov     rax, [rsi]                                                     ; +0xc2, 0x180046462\nmovaps  xmm2, xmm6                                                     ; +0xc5, 0x180046465\nmov     edx, r15d                                                      ; +0xc8, 0x180046468\nmov     rcx, rsi                                                       ; +0xcb, 0x18004646b\ntest    r14b, r14b                                                     ; +0xce, 0x18004646e\njz      short loc_180046477                                            ; +0xd1, 0x180046471\ncall    qword ptr [rax]                                                ; +0xd3, 0x180046473\njmp     short loc_18004647A                                            ; +0xd5, 0x180046475\ncall    qword ptr [rax+8]                                              ; +0xd7, 0x180046477\nmov     rsi, [rsp+48h+arg_8]                                           ; +0xda, 0x18004647a\nmov     rbp, [rsp+48h+arg_0]                                           ; +0xdf, 0x18004647f\nmovaps  xmm6, [rsp+48h+var_28]                                         ; +0xe4, 0x180046484\nmov     rbx, [rsp+48h+arg_18]                                          ; +0xe9, 0x180046489\nadd     rsp, 30h                                                       ; +0xee, 0x18004648e\npop     r15                                                            ; +0xf2, 0x180046492\npop     r14                                                            ; +0xf4, 0x180046494\npop     rdi                                                            ; +0xf6, 0x180046496\nretn                                                                   ; +0xf7, 0x180046497", "xrefs": ["cocos2d::CCKeyboardDispatcher::dispatchKeyboardMSG @ 0x1800462e2", "cocos2d::CCKeyboardDispatcher::releaseAllKeys @ 0x180047103", "<???> @ 0x180140360", "<???> @ 0x180140394", "<???> @ 0x18014cf68", "<???> @ 0x1801bb8c0"], "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"}