{"type": "func", "start": 6442781648, "end": 6442781799, "name": "cocos2d::CCLayer::setKeyboardEnabled", "pseudocode": "// \n// cocos2d::CCLayer::setKeyboardEnabled from 0x180050bd0 to 0x180050c67 (151 bytes)\n// \n// 11 xrefs:\n// > <???> @ 0x1800ed2d0\n// > <???> @ 0x1800ed790\n// > <???> @ 0x1800edcc8\n// > <???> @ 0x1800ee230\n// > <???> @ 0x1800ee808\n// > <???> @ 0x1800f70d8\n// > <???> @ 0x180138084\n// > <???> @ 0x180138098\n// > <???> @ 0x1801380a8\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b2088\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::CCLayer::setKeyboardEnabled(cocos2d::CCLayer *this, bool a2)\n{\n  bool v4; // zf\n  struct cocos2d::CCDirector *v5; // rax\n  cocos2d::CCKeyboardDelegate *v6; // rsi\n  cocos2d::CCDirector_vtbl *v7; // rdx\n  cocos2d::CCKeyboardDispatcher *v8; // rax\n  cocos2d::CCMouseDispatcher *v9; // rax\n\n  if ( a2 != this->m_bKeyboardEnabled )\n  {\n    v4 = !this->m_bRunning;\n    this->m_bKeyboardEnabled = a2;\n    if ( !v4 )\n    {\n      v5 = cocos2d::CCDirector::sharedDirector();\n      v6 = &this->cocos2d::CCKeyboardDelegate;\n      v7 = v5->cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n      if ( a2 )\n      {\n        if ( !this )\n          v6 = nullptr;\n        v8 = (cocos2d::CCKeyboardDispatcher *)((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v7->getKeyboardDispatcher)(v5);\n        cocos2d::CCKeyboardDispatcher::addDelegate(v8, (cocos2d::CCObject_vtbl *)v6);\n      }\n      else\n      {\n        if ( !this )\n          v6 = nullptr;\n        v9 = (cocos2d::CCMouseDispatcher *)((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v7->getKeyboardDispatcher)(v5);\n        cocos2d::CCMouseDispatcher::removeDelegate(v9, (struct cocos2d::CCObject *)v6);\n      }\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCLayer::setKeyboardEnabled from 0x180050bd0 to 0x180050c67 (151 bytes)\n; \n; 11 xrefs:\n; > <???> @ 0x1800ed2d0\n; > <???> @ 0x1800ed790\n; > <???> @ 0x1800edcc8\n; > <???> @ 0x1800ee230\n; > <???> @ 0x1800ee808\n; > <???> @ 0x1800f70d8\n; > <???> @ 0x180138084\n; > <???> @ 0x180138098\n; > <???> @ 0x1801380a8\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b2088\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_8], rbx                                               ; +0x0, 0x180050bd0\npush    rdi                                                            ; +0x5, 0x180050bd5\nsub     rsp, 20h                                                       ; +0x6, 0x180050bd6\nmovzx   edi, dl                                                        ; +0xa, 0x180050bda\nmov     rbx, rcx                                                       ; +0xd, 0x180050bdd\ncmp     dl, [rcx+16Bh]                                                 ; +0x10, 0x180050be0\njz      short loc_180050C5C                                            ; +0x16, 0x180050be6\ncmp     byte ptr [rcx+110h], 0                                         ; +0x18, 0x180050be8\nmov     [rcx+16Bh], dl                                                 ; +0x1f, 0x180050bef\njz      short loc_180050C5C                                            ; +0x25, 0x180050bf5\nmov     [rsp+28h+arg_0], rsi                                           ; +0x27, 0x180050bf7\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x2c, 0x180050bfc\nxor     ecx, ecx                                                       ; +0x31, 0x180050c01\nlea     rsi, [rbx+158h]                                                ; +0x33, 0x180050c03\nmov     rdx, [rax]                                                     ; +0x3a, 0x180050c0a\ntest    dil, dil                                                       ; +0x3d, 0x180050c0d\njz      short loc_180050C3C                                            ; +0x40, 0x180050c10\ntest    rbx, rbx                                                       ; +0x42, 0x180050c12\ncmovz   rsi, rcx                                                       ; +0x45, 0x180050c15\nmov     rcx, rax                                                       ; +0x49, 0x180050c19\ncall    qword ptr [rdx+0B0h]                                           ; +0x4c, 0x180050c1c\nmov     rcx, rax; this                                                 ; +0x52, 0x180050c22\nmov     rdx, rsi; struct cocos2d::CCKeyboardDelegate *                 ; +0x55, 0x180050c25\nmov     rsi, [rsp+28h+arg_0]                                           ; +0x58, 0x180050c28\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x5d, 0x180050c2d\nadd     rsp, 20h                                                       ; +0x62, 0x180050c32\npop     rdi                                                            ; +0x66, 0x180050c36\njmp     ?addDelegate@CCKeyboardDispatcher@cocos2d@@QEAAXPEAVCCKeyboardDelegate@2@@Z; cocos2d::CCKeyboardDispatcher::addDelegate(cocos2d::CCKeyboardDelegate *) ; +0x67, 0x180050c37\ntest    rbx, rbx                                                       ; +0x6c, 0x180050c3c\ncmovz   rsi, rcx                                                       ; +0x6f, 0x180050c3f\nmov     rcx, rax                                                       ; +0x73, 0x180050c43\ncall    qword ptr [rdx+0B0h]                                           ; +0x76, 0x180050c46\nmov     rcx, rax; this                                                 ; +0x7c, 0x180050c4c\nmov     rdx, rsi; struct cocos2d::CCMouseDelegate *                    ; +0x7f, 0x180050c4f\ncall    ?removeDelegate@CCMouseDispatcher@cocos2d@@QEAAXPEAVCCMouseDelegate@2@@Z; cocos2d::CCMouseDispatcher::removeDelegate(cocos2d::CCMouseDelegate *) ; +0x82, 0x180050c52\nmov     rsi, [rsp+28h+arg_0]                                           ; +0x87, 0x180050c57\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x8c, 0x180050c5c\nadd     rsp, 20h                                                       ; +0x91, 0x180050c61\npop     rdi                                                            ; +0x95, 0x180050c65\nretn                                                                   ; +0x96, 0x180050c66", "xrefs": ["<???> @ 0x1800ed2d0", "<???> @ 0x1800ed790", "<???> @ 0x1800edcc8", "<???> @ 0x1800ee230", "<???> @ 0x1800ee808", "<???> @ 0x1800f70d8", "<???> @ 0x180138084", "<???> @ 0x180138098", "<???> @ 0x1801380a8", "<???> @ 0x1801438a8", "<???> @ 0x1801b2088"], "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"}