{"type": "func", "start": 7032260, "end": 7032832, "name": "EditorUI::toggleSpecialEditButtons", "pseudocode": "// \n// EditorUI::toggleSpecialEditButtons from 0x6b4dc4 to 0x6b5000 (572 bytes)\n// \n// 3 xrefs:\n// > EditorUI::updateButtons @ 0x6b502c\n// > EditorUI::toggleEnableRotate @ 0x6b5944\n// > <???> @ 0x53730\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 EditorUI::toggleSpecialEditButtons(EditorUI *a1)\n{\n  unsigned int i; // w20\n  GameObject *v3; // x0\n  unsigned int v4; // w21\n  GameObject *m_selectedObject; // x0\n  __int64 v6; // x24\n  const char *j; // x1\n  cocos2d::CCDictionary *m_editButtonDict; // x26\n  cocos2d::CCString *v9; // x0\n  char *CString; // x0\n  __int64 v11; // x26\n  char *v12; // x0\n  ButtonSprite *v13; // x0\n  __int64 *v14; // x1\n  unsigned int *v15; // x1\n  int v16; // w3\n  GameManager *v17; // x0\n  std::string v18; // [xsp+80h] [xbp+80h] BYREF\n\n  if ( (unsigned int)cocos2d::CCArray::count(a1->m_selectedObjects) )\n  {\n    for ( i = 0; i < (unsigned int)cocos2d::CCArray::count(a1->m_selectedObjects); ++i )\n    {\n      v3 = (GameObject *)cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, i);\n      if ( !GameObject::canRotateFree(v3) )\n        goto LABEL_9;\n    }\n  }\n  else\n  {\n    m_selectedObject = a1->m_selectedObject;\n    if ( !m_selectedObject || !GameObject::canRotateFree(m_selectedObject) )\n    {\nLABEL_9:\n      v4 = 0;\n      goto LABEL_10;\n    }\n  }\n  v4 = 1;\nLABEL_10:\n  v6 = 0;\n  for ( j = (char *)&off_18 + 3; ; j = (const char *)dword_EC6310[v6++] )\n  {\n    m_editButtonDict = a1->m_editButtonDict;\n    v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"%i\", j);\n    CString = (char *)cocos2d::CCString::getCString(v9);\n    sub_D153B8((int)&v18, CString);\n    v11 = cocos2d::CCDictionary::objectForKey(m_editButtonDict, &v18);\n    v12 = (char *)v18.m_data.m_data - 24;\n    if ( (__int64 *)v18.m_data.m_data - 3 != &qword_124B6B0 )\n    {\n      if ( &pthread_create )\n      {\n        v15 = (unsigned int *)((char *)v18.m_data.m_data - 8);\n        do\n          v16 = __ldaxr(v15);\n        while ( __stlxr(v16 - 1, v15) );\n      }\n      else\n      {\n        v16 = *((_DWORD *)v18.m_data.m_data - 2);\n        *((_DWORD *)v18.m_data.m_data - 2) = v16 - 1;\n      }\n      if ( v16 <= 0 )\n        operator delete(v12);\n    }\n    if ( v11 )\n    {\n      v13 = (ButtonSprite *)(*(__int64 (__fastcall **)(__int64))(*(_QWORD *)v11 + 1056LL))(v11);\n      v14 = (__int64 *)&off_EC62E0;\n      if ( !v4 )\n        v14 = &qword_EC62F0;\n      ButtonSprite::setColor(v13, (cocos2d::ccColor3B)*v14);\n      (*(void (__fastcall **)(__int64, _QWORD))(*(_QWORD *)v11 + 1040LL))(v11, v4);\n    }\n    if ( v6 == 3 )\n      break;\n  }\n  if ( v4 )\n  {\n    v17 = GameManager::sharedState();\n    if ( GameManager::getGameVariable(v17, \"0007\") )\n      EditorUI::activateRotationControl(a1, nullptr);\n  }\n  else\n  {\n    EditorUI::deactivateRotationControl(a1);\n  }\n  EditorUI::updateGridNodeSize(a1);\n}", "assembly": "; \n; EditorUI::toggleSpecialEditButtons from 0x6b4dc4 to 0x6b5000 (572 bytes)\n; \n; 3 xrefs:\n; > EditorUI::updateButtons @ 0x6b502c\n; > EditorUI::toggleEnableRotate @ 0x6b5944\n; > <???> @ 0x53730\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\nSTP             X29, X30, [SP,#var_90]!                                ; +0x0, 0x6b4dc4\nMOV             X29, SP                                                ; +0x4, 0x6b4dc8\nSTP             X19, X20, [SP,#0x90+var_80]                            ; +0x8, 0x6b4dcc\nMOV             X19, X0                                                ; +0xc, 0x6b4dd0\nADRP            X0, #__stack_chk_guard_ptr@PAGE                        ; +0x10, 0x6b4dd4\nSTP             X21, X22, [SP,#0x90+var_70]                            ; +0x14, 0x6b4dd8\nSTP             X23, X24, [SP,#0x90+var_60]                            ; +0x18, 0x6b4ddc\nLDR             X1, [X0,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x6b4de0\nLDR             X0, [X19,#0x338]; this                                 ; +0x20, 0x6b4de4\nSTP             X25, X26, [SP,#0x90+var_50]                            ; +0x24, 0x6b4de8\nLDR             X1, [X1]                                               ; +0x28, 0x6b4dec\nSTP             X27, X28, [SP,#0x90+var_40]                            ; +0x2c, 0x6b4df0\nSTR             X1, [X29,#0x90+var_8]                                  ; +0x30, 0x6b4df4\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x34, 0x6b4df8\nCBZ             W0, loc_6B4E3C                                         ; +0x38, 0x6b4dfc\nMOV             W20, #0                                                ; +0x3c, 0x6b4e00\nB               loc_6B4E24                                             ; +0x40, 0x6b4e04\nLDR             X0, [X19,#0x338]; this                                 ; +0x44, 0x6b4e08\nMOV             W1, W20; unsigned int                                  ; +0x48, 0x6b4e0c\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x4c, 0x6b4e10\nBL              _ZN10GameObject13canRotateFreeEv; GameObject::canRotateFree(void) ; +0x50, 0x6b4e14\nUXTB            W0, W0                                                 ; +0x54, 0x6b4e18\nCBZ             W0, loc_6B4E50                                         ; +0x58, 0x6b4e1c\nADD             W20, W20, #1                                           ; +0x5c, 0x6b4e20\nLDR             X0, [X19,#0x338]; this                                 ; +0x60, 0x6b4e24\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x64, 0x6b4e28\nCMP             W20, W0                                                ; +0x68, 0x6b4e2c\nB.CC            loc_6B4E08                                             ; +0x6c, 0x6b4e30\nMOV             W21, #1                                                ; +0x70, 0x6b4e34\nB               loc_6B4E54                                             ; +0x74, 0x6b4e38\nLDR             X0, [X19,#0x530]; this                                 ; +0x78, 0x6b4e3c\nCBZ             X0, loc_6B4E50                                         ; +0x7c, 0x6b4e40\nBL              _ZN10GameObject13canRotateFreeEv; GameObject::canRotateFree(void) ; +0x80, 0x6b4e44\nUXTB            W0, W0                                                 ; +0x84, 0x6b4e48\nCBNZ            W0, loc_6B4E34                                         ; +0x88, 0x6b4e4c\nMOV             W21, #0                                                ; +0x8c, 0x6b4e50\nADRP            X22, #(aSongidI+8)@PAGE; \"%i\"                          ; +0x90, 0x6b4e54\nADD             X0, X29, #0x90+var_18                                  ; +0x94, 0x6b4e58\nMOV             X24, #0                                                ; +0x98, 0x6b4e5c\nMOV             W1, #(off_18+3); char *                                ; +0x9c, 0x6b4e60\nADD             X20, X29, #0x90+var_10                                 ; +0xa0, 0x6b4e64\nADD             X25, X29, #0x90+var_20                                 ; +0xa4, 0x6b4e68\nADRP            X23, #off_122EFE8@PAGE                                 ; +0xa8, 0x6b4e6c\nADD             X22, X22, #(aSongidI+8)@PAGEOFF; \"%i\"                  ; +0xac, 0x6b4e70\nSTR             X0, [X29,#0x90+var_28]                                 ; +0xb0, 0x6b4e74\nADRP            X28, #off_EC62E0@PAGE                                  ; +0xb4, 0x6b4e78\nADRP            X27, #qword_EC62F0@PAGE                                ; +0xb8, 0x6b4e7c\nMOV             X0, X22; this                                          ; +0xbc, 0x6b4e80\nLDR             X26, [X19,#0x2E8]                                      ; +0xc0, 0x6b4e84\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0xc4, 0x6b4e88\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0xc8, 0x6b4e8c\nMOV             X1, X0; char *                                         ; +0xcc, 0x6b4e90\nMOV             X2, X25                                                ; +0xd0, 0x6b4e94\nMOV             X0, X20; int                                           ; +0xd4, 0x6b4e98\nBL              sub_D153B8                                             ; +0xd8, 0x6b4e9c\nMOV             X0, X26                                                ; +0xdc, 0x6b4ea0\nMOV             X1, X20                                                ; +0xe0, 0x6b4ea4\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0xe4, 0x6b4ea8\nLDR             X1, [X20]                                              ; +0xe8, 0x6b4eac\nMOV             X26, X0                                                ; +0xec, 0x6b4eb0\nLDR             X3, [X23,#off_122EFE8@PAGEOFF]; qword_124B6B0          ; +0xf0, 0x6b4eb4\nSUB             X0, X1, #0x18; p                                       ; +0xf4, 0x6b4eb8\nCMP             X0, X3                                                 ; +0xf8, 0x6b4ebc\nB.NE            loc_6B4F68                                             ; +0xfc, 0x6b4ec0\nCBZ             X26, loc_6B4F04                                        ; +0x100, 0x6b4ec4\nLDR             X1, [X26]                                              ; +0x104, 0x6b4ec8\nMOV             X0, X26                                                ; +0x108, 0x6b4ecc\nLDR             X1, [X1,#0x420]                                        ; +0x10c, 0x6b4ed0\nBLR             X1                                                     ; +0x110, 0x6b4ed4\nADD             X3, X27, #qword_EC62F0@PAGEOFF                         ; +0x114, 0x6b4ed8\nCMP             W21, WZR                                               ; +0x118, 0x6b4edc\nADD             X1, X28, #off_EC62E0@PAGEOFF                           ; +0x11c, 0x6b4ee0\nCSEL            X1, X1, X3, NE                                         ; +0x120, 0x6b4ee4\nLDR             X1, [X1]                                               ; +0x124, 0x6b4ee8\nBL              _ZN12ButtonSprite8setColorEN7cocos2d10_ccColor3BE; ButtonSprite::setColor(cocos2d::_ccColor3B) ; +0x128, 0x6b4eec\nLDR             X3, [X26]                                              ; +0x12c, 0x6b4ef0\nMOV             X0, X26                                                ; +0x130, 0x6b4ef4\nMOV             W1, W21                                                ; +0x134, 0x6b4ef8\nLDR             X2, [X3,#0x410]                                        ; +0x138, 0x6b4efc\nBLR             X2                                                     ; +0x13c, 0x6b4f00\nCMP             X24, #3                                                ; +0x140, 0x6b4f04\nB.EQ            loc_6B4F20                                             ; +0x144, 0x6b4f08\nADD             X0, X27, #qword_EC62F0@PAGEOFF                         ; +0x148, 0x6b4f0c\nADD             X0, X0, #0x20 ; ' '                                    ; +0x14c, 0x6b4f10\nLDR             W1, [X0,X24,LSL#2]                                     ; +0x150, 0x6b4f14\nADD             X24, X24, #1                                           ; +0x154, 0x6b4f18\nB               loc_6B4E80                                             ; +0x158, 0x6b4f1c\nCBNZ            W21, loc_6B4F9C                                        ; +0x15c, 0x6b4f20\nMOV             X0, X19; this                                          ; +0x160, 0x6b4f24\nBL              _ZN8EditorUI25deactivateRotationControlEv; EditorUI::deactivateRotationControl(void) ; +0x164, 0x6b4f28\nMOV             X0, X19; this                                          ; +0x168, 0x6b4f2c\nBL              _ZN8EditorUI18updateGridNodeSizeEv; EditorUI::updateGridNodeSize(void) ; +0x16c, 0x6b4f30\nLDR             X19, [X29,#0x90+var_8]                                 ; +0x170, 0x6b4f34\nADRP            X0, #__stack_chk_guard_ptr@PAGE                        ; +0x174, 0x6b4f38\nLDR             X26, [X0,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x178, 0x6b4f3c\nLDR             X0, [X26]                                              ; +0x17c, 0x6b4f40\nCMP             X19, X0                                                ; +0x180, 0x6b4f44\nB.NE            loc_6B4FD4                                             ; +0x184, 0x6b4f48\nLDP             X19, X20, [SP,#0x90+var_80]                            ; +0x188, 0x6b4f4c\nLDP             X21, X22, [SP,#0x90+var_70]                            ; +0x18c, 0x6b4f50\nLDP             X23, X24, [SP,#0x90+var_60]                            ; +0x190, 0x6b4f54\nLDP             X25, X26, [SP,#0x90+var_50]                            ; +0x194, 0x6b4f58\nLDP             X27, X28, [SP,#0x90+var_40]                            ; +0x198, 0x6b4f5c\nLDP             X29, X30, [SP+0x90+var_90],#0x90                       ; +0x19c, 0x6b4f60\nRET                                                                    ; +0x1a0, 0x6b4f64\nADRP            X2, #pthread_create_ptr_0@PAGE                         ; +0x1a4, 0x6b4f68\nLDR             X3, [X2,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x1a8, 0x6b4f6c\nCBZ             X3, loc_6B4FC4                                         ; +0x1ac, 0x6b4f70\nSUB             X1, X1, #8                                             ; +0x1b0, 0x6b4f74\nLDAXR           W3, [X1]                                               ; +0x1b4, 0x6b4f78\nSUB             W2, W3, #1                                             ; +0x1b8, 0x6b4f7c\nSTLXR           W4, W2, [X1]                                           ; +0x1bc, 0x6b4f80\nCBNZ            W4, loc_6B4F78                                         ; +0x1c0, 0x6b4f84\nCMP             W3, WZR                                                ; +0x1c4, 0x6b4f88\nB.GT            loc_6B4EC4                                             ; +0x1c8, 0x6b4f8c\nLDR             X1, [X29,#0x90+var_28]                                 ; +0x1cc, 0x6b4f90\nBL              j__ZdlPv; operator delete(void *)                      ; +0x1d0, 0x6b4f94\nB               loc_6B4EC4                                             ; +0x1d4, 0x6b4f98\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x1d8, 0x6b4f9c\nADRL            X1, a0007; \"0007\"                                      ; +0x1dc, 0x6b4fa0\nBL              _ZN11GameManager15getGameVariableEPKc; GameManager::getGameVariable(char const*) ; +0x1e4, 0x6b4fa8\nUXTB            W0, W0                                                 ; +0x1e8, 0x6b4fac\nCBZ             W0, loc_6B4F2C                                         ; +0x1ec, 0x6b4fb0\nMOV             X0, X19; this                                          ; +0x1f0, 0x6b4fb4\nMOV             X1, #0; cocos2d::CCObject *                            ; +0x1f4, 0x6b4fb8\nBL              _ZN8EditorUI23activateRotationControlEPN7cocos2d8CCObjectE; EditorUI::activateRotationControl(cocos2d::CCObject *) ; +0x1f8, 0x6b4fbc\nB               loc_6B4F2C                                             ; +0x1fc, 0x6b4fc0\nLDUR            W3, [X1,#-8]                                           ; +0x200, 0x6b4fc4\nSUB             W4, W3, #1                                             ; +0x204, 0x6b4fc8\nSTUR            W4, [X1,#-8]                                           ; +0x208, 0x6b4fcc\nB               loc_6B4F88                                             ; +0x20c, 0x6b4fd0\nBL              .__stack_chk_fail                                      ; +0x210, 0x6b4fd4\nMOV             X19, X0                                                ; +0x214, 0x6b4fd8\nLDR             X0, [X29,#0x90+var_10]                                 ; +0x218, 0x6b4fdc\nLDR             X23, [X23,#0xFE8]                                      ; +0x21c, 0x6b4fe0\nSUB             X0, X0, #0x18                                          ; +0x220, 0x6b4fe4\nCMP             X0, X23                                                ; +0x224, 0x6b4fe8\nB.EQ            loc_6B4FF8                                             ; +0x228, 0x6b4fec\nADD             X1, X29, #0x90+var_18                                  ; +0x22c, 0x6b4ff0\nBL              sub_6865FC                                             ; +0x230, 0x6b4ff4\nMOV             X0, X19                                                ; +0x234, 0x6b4ff8\nBL              _Unwind_Resume                                         ; +0x238, 0x6b4ffc", "xrefs": ["EditorUI::updateButtons @ 0x6b502c", "EditorUI::toggleEnableRotate @ 0x6b5944", "<???> @ 0x53730"], "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"}