{"type": "func", "start": 6442781072, "end": 6442781199, "name": "cocos2d::CCLayer::setAccelerometerEnabled", "pseudocode": "// \n// cocos2d::CCLayer::setAccelerometerEnabled from 0x180050990 to 0x180050a0f (127 bytes)\n// \n// 8 xrefs:\n// > <???> @ 0x1800ed2a8\n// > <???> @ 0x1800ed768\n// > <???> @ 0x1800edca0\n// > <???> @ 0x1800ee208\n// > <???> @ 0x1800ee7e0\n// > <???> @ 0x1800f70b0\n// > <???> @ 0x1801438a8\n// > <???> @ 0x1801b2040\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::setAccelerometerEnabled(cocos2d::CCLayer *this, bool a2)\n{\n  bool v4; // zf\n  struct cocos2d::CCDirector *v5; // rax\n  cocos2d::CCDirector_vtbl *v6; // rdx\n  struct cocos2d::CCAccelerometerDelegate *v7; // rbx\n  cocos2d::CCAccelerometer *v8; // rax\n  cocos2d::CCAccelerometer *v9; // rax\n\n  if ( a2 != this->m_bAccelerometerEnabled )\n  {\n    v4 = !this->m_bRunning;\n    this->m_bAccelerometerEnabled = a2;\n    if ( !v4 )\n    {\n      v5 = cocos2d::CCDirector::sharedDirector();\n      v6 = v5->cocos2d::CCObject::cocos2d::CCCopying::__vftable;\n      if ( a2 )\n      {\n        v7 = &this->cocos2d::CCAccelerometerDelegate;\n        if ( !this )\n          v7 = nullptr;\n        v8 = (cocos2d::CCAccelerometer *)((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v6->getAccelerometer)(v5);\n        cocos2d::CCAccelerometer::setDelegate(v8, v7);\n      }\n      else\n      {\n        v9 = (cocos2d::CCAccelerometer *)((__int64 (__fastcall *)(struct cocos2d::CCDirector *))v6->getAccelerometer)(v5);\n        cocos2d::CCAccelerometer::setDelegate(v9, nullptr);\n      }\n    }\n  }\n}", "assembly": "; \n; cocos2d::CCLayer::setAccelerometerEnabled from 0x180050990 to 0x180050a0f (127 bytes)\n; \n; 8 xrefs:\n; > <???> @ 0x1800ed2a8\n; > <???> @ 0x1800ed768\n; > <???> @ 0x1800edca0\n; > <???> @ 0x1800ee208\n; > <???> @ 0x1800ee7e0\n; > <???> @ 0x1800f70b0\n; > <???> @ 0x1801438a8\n; > <???> @ 0x1801b2040\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_0], rbx                                               ; +0x0, 0x180050990\npush    rdi                                                            ; +0x5, 0x180050995\nsub     rsp, 20h                                                       ; +0x6, 0x180050996\nmovzx   ebx, dl                                                        ; +0xa, 0x18005099a\nmov     rdi, rcx                                                       ; +0xd, 0x18005099d\ncmp     dl, [rcx+169h]                                                 ; +0x10, 0x1800509a0\njz      short loc_180050A04                                            ; +0x16, 0x1800509a6\ncmp     byte ptr [rcx+110h], 0                                         ; +0x18, 0x1800509a8\nmov     [rcx+169h], dl                                                 ; +0x1f, 0x1800509af\njz      short loc_180050A04                                            ; +0x25, 0x1800509b5\ncall    ?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x27, 0x1800509b7\nmov     rdx, [rax]                                                     ; +0x2c, 0x1800509bc\ntest    bl, bl                                                         ; +0x2f, 0x1800509bf\njz      short loc_1800509F1                                            ; +0x31, 0x1800509c1\nxor     ecx, ecx                                                       ; +0x33, 0x1800509c3\nlea     rbx, [rdi+148h]                                                ; +0x35, 0x1800509c5\ntest    rdi, rdi                                                       ; +0x3c, 0x1800509cc\ncmovz   rbx, rcx                                                       ; +0x3f, 0x1800509cf\nmov     rcx, rax                                                       ; +0x43, 0x1800509d3\ncall    qword ptr [rdx+0D0h]                                           ; +0x46, 0x1800509d6\nmov     rcx, rax; this                                                 ; +0x4c, 0x1800509dc\nmov     rdx, rbx; struct cocos2d::CCAccelerometerDelegate *            ; +0x4f, 0x1800509df\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x52, 0x1800509e2\nadd     rsp, 20h                                                       ; +0x57, 0x1800509e7\npop     rdi                                                            ; +0x5b, 0x1800509eb\njmp     ?setDelegate@CCAccelerometer@cocos2d@@QEAAXPEAVCCAccelerometerDelegate@2@@Z; cocos2d::CCAccelerometer::setDelegate(cocos2d::CCAccelerometerDelegate *) ; +0x5c, 0x1800509ec\nmov     rcx, rax                                                       ; +0x61, 0x1800509f1\ncall    qword ptr [rdx+0D0h]                                           ; +0x64, 0x1800509f4\nmov     rcx, rax; this                                                 ; +0x6a, 0x1800509fa\nxor     edx, edx; struct cocos2d::CCAccelerometerDelegate *            ; +0x6d, 0x1800509fd\ncall    ?setDelegate@CCAccelerometer@cocos2d@@QEAAXPEAVCCAccelerometerDelegate@2@@Z; cocos2d::CCAccelerometer::setDelegate(cocos2d::CCAccelerometerDelegate *) ; +0x6f, 0x1800509ff\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x74, 0x180050a04\nadd     rsp, 20h                                                       ; +0x79, 0x180050a09\npop     rdi                                                            ; +0x7d, 0x180050a0d\nretn                                                                   ; +0x7e, 0x180050a0e", "xrefs": ["<???> @ 0x1800ed2a8", "<???> @ 0x1800ed768", "<???> @ 0x1800edca0", "<???> @ 0x1800ee208", "<???> @ 0x1800ee7e0", "<???> @ 0x1800f70b0", "<???> @ 0x1801438a8", "<???> @ 0x1801b2040"], "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"}