{"type": "func", "start": 4742768, "end": 4743114, "name": "EditorUI::toggleSpecialEditButtons", "pseudocode": "// \n// EditorUI::toggleSpecialEditButtons from 0x485e70 to 0x485fca (346 bytes)\n// \n// 3 xrefs:\n// > EditorUI::updateButtons @ 0x485ffc\n// > EditorUI::toggleEnableRotate @ 0x486604\n// > EditorUI::activateTransformControl @ 0x70eff8\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:49:25 +0000\n// \n\nint __fastcall EditorUI::toggleSpecialEditButtons(cocos2d::CCArray **this, int a2)\n{\n  unsigned int i; // r6\n  GameObject *v4; // r0\n  GameObject *v5; // r0\n  int v6; // r5\n  unsigned int v7; // r6\n  const char *v8; // r1\n  int v9; // r8\n  cocos2d::CCString *v10; // r0\n  const char *CString; // r0\n  size_t v12; // r0\n  int v13; // r8\n  GameManager *v14; // r0\n  char *v15; // r3\n  _DWORD *v16; // r0\n  __int16 *v17; // r2\n  GameManager *v18; // r0\n  const char *v21; // [sp+Ch] [bp-18h]\n  int v22[3]; // [sp+10h] [bp-14h] BYREF\n\n  if ( cocos2d::CCArray::count(*(this + 167)) )\n  {\n    for ( i = 0; i < cocos2d::CCArray::count(*(this + 167)); ++i )\n    {\n      v4 = (GameObject *)cocos2d::CCArray::objectAtIndex(*(this + 167), i);\n      if ( !GameObject::canRotateFree(v4) )\n      {\n        v6 = 0;\n        goto LABEL_10;\n      }\n    }\n  }\n  else\n  {\n    v5 = *(this + 249);\n    if ( !v5 || !GameObject::canRotateFree(v5) )\n    {\n      v6 = 0;\n      goto LABEL_10;\n    }\n  }\n  v6 = 1;\nLABEL_10:\n  v7 = -1;\n  v8 = (char *)&word_2A + 1;\n  while ( 1 )\n  {\n    v9 = (int)*(this + 152);\n    v10 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"%i\", v8);\n    CString = (const char *)cocos2d::CCString::getCString(v10);\n    memset(v22, 0, sizeof(v22));\n    v21 = CString;\n    v12 = strlen(CString);\n    std::string::__init(v22, v21, v12);\n    v13 = cocos2d::CCDictionary::objectForKey(v9, v22);\n    v14 = (GameManager *)std::string::~string((int)v22);\n    if ( v13 )\n    {\n      v16 = (_DWORD *)(*(int (__fastcall **)(int))(*(_DWORD *)v13 + 536))(v13);\n      if ( v6 )\n        v17 = word_BEBDD8;\n      else\n        v17 = (__int16 *)&byte_BEBE3C;\n      ButtonSprite::setColor(\n        v16,\n        *(unsigned __int8 *)v17 | (*((unsigned __int8 *)v17 + 1) << 8) | (*((unsigned __int8 *)v17 + 2) << 16));\n      v14 = (GameManager *)(*(int (__fastcall **)(int, int))(*(_DWORD *)v13 + 528))(v13, v6);\n    }\n    if ( ++v7 == 3 )\n      break;\n    if ( v7 > 2 )\n      v8 = (_BYTE *)(&word_2A + 1);\n    else\n      v15 = (char *)&unk_BEBE44;\n    if ( v7 <= 2 )\n      v8 = (const char *)v15[v7];\n  }\n  if ( v6 )\n  {\n    v18 = (GameManager *)GameManager::sharedState(v14);\n    if ( GameManager::getGameVariable(v18, \"0007\")\n      && (a2 || !(*(int (__fastcall **)(_DWORD))(*(_DWORD *)*(this + 149) + 176))(*(this + 149))) )\n    {\n      EditorUI::activateRotationControl((EditorUI *)this, nullptr);\n    }\n  }\n  else\n  {\n    EditorUI::deactivateRotationControl((EditorUI *)this);\n  }\n  return EditorUI::updateGridNodeSize(this);\n}", "assembly": "; \n; EditorUI::toggleSpecialEditButtons from 0x485e70 to 0x485fca (346 bytes)\n; \n; 3 xrefs:\n; > EditorUI::updateButtons @ 0x485ffc\n; > EditorUI::toggleEnableRotate @ 0x486604\n; > EditorUI::activateTransformControl @ 0x70eff8\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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:49:25 +0000\n; \nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x485e70\nSUB             SP, SP, #0x24                                          ; +0x4, 0x485e74\nLDR             R5, =(__stack_chk_guard_ptr - 0x485E82)                ; +0x6, 0x485e76\nMOV             R4, R0                                                 ; +0x8, 0x485e78\nLDR.W           R0, [R0,#0x29C]; this                                  ; +0xa, 0x485e7a\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0xe, 0x485e7e\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x10, 0x485e80\nSTR             R1, [SP,#0x24+var_24]                                  ; +0x12, 0x485e82\nLDR             R3, [R5]                                               ; +0x14, 0x485e84\nSTR             R3, [SP,#0x24+var_8]                                   ; +0x16, 0x485e86\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x18, 0x485e88\nSTR             R5, [SP,#0x24+var_20]                                  ; +0x1c, 0x485e8c\nCBZ             R0, loc_485EB2                                         ; +0x1e, 0x485e8e\nMOVS            R6, #0                                                 ; +0x20, 0x485e90\nLDR.W           R0, [R4,#0x29C]; this                                  ; +0x22, 0x485e92\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x26, 0x485e96\nCMP             R6, R0                                                 ; +0x2a, 0x485e9a\nBCS             loc_485EC2                                             ; +0x2c, 0x485e9c\nMOV             R1, R6; unsigned int                                   ; +0x2e, 0x485e9e\nLDR.W           R0, [R4,#0x29C]; this                                  ; +0x30, 0x485ea0\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x34, 0x485ea4\nBL              _ZN10GameObject13canRotateFreeEv; GameObject::canRotateFree(void) ; +0x38, 0x485ea8\nCBZ             R0, loc_485EC6                                         ; +0x3c, 0x485eac\nADDS            R6, #1                                                 ; +0x3e, 0x485eae\nB               loc_485E92                                             ; +0x40, 0x485eb0\nLDR.W           R0, [R4,#0x3E4]; this                                  ; +0x42, 0x485eb2\nCMP             R0, #0                                                 ; +0x46, 0x485eb6\nBEQ             loc_485FAE                                             ; +0x48, 0x485eb8\nBL              _ZN10GameObject13canRotateFreeEv; GameObject::canRotateFree(void) ; +0x4a, 0x485eba\nCMP             R0, #0                                                 ; +0x4e, 0x485ebe\nBEQ             loc_485FAE                                             ; +0x50, 0x485ec0\nMOVS            R5, #1                                                 ; +0x52, 0x485ec2\nB               loc_485EC8                                             ; +0x54, 0x485ec4\nMOV             R5, R0                                                 ; +0x56, 0x485ec6\nLDR.W           R9, =(word_BEBDD8 - 0x485EDE)                          ; +0x58, 0x485ec8\nMOV.W           R6, #0xFFFFFFFF                                        ; +0x5c, 0x485ecc\nLDR.W           R10, =(word_BEBDD8 - 0x485EE2)                         ; +0x60, 0x485ed0\nMOVS            R1, #(word_2A+1); char *                               ; +0x64, 0x485ed4\nLDR.W           R11, =(word_BEBDD8 - 0x485EE4)                         ; +0x66, 0x485ed6\nADD             R9, PC; word_BEBDD8                                    ; +0x6a, 0x485eda\nLDR             R3, =(aI - 0x485EE6); \"%i\"                             ; +0x6c, 0x485edc\nADD             R10, PC; word_BEBDD8                                   ; +0x6e, 0x485ede\nADD             R11, PC; word_BEBDD8                                   ; +0x70, 0x485ee0\nADD             R3, PC; \"%i\"                                           ; +0x72, 0x485ee2\nSTR             R3, [SP,#0x24+var_1C]                                  ; +0x74, 0x485ee4\nLDR             R0, [SP,#0x24+var_1C]; this                            ; +0x76, 0x485ee6\nADD             R7, SP, #0x24+var_14                                   ; +0x78, 0x485ee8\nLDR.W           R8, [R4,#0x260]                                        ; +0x7a, 0x485eea\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x7e, 0x485eee\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x82, 0x485ef2\nMOVS            R2, #0                                                 ; +0x86, 0x485ef6\nSTR             R2, [SP,#0x24+var_14]                                  ; +0x88, 0x485ef8\nSTR             R2, [SP,#0x24+var_10]                                  ; +0x8a, 0x485efa\nSTR             R2, [SP,#0x24+var_C]                                   ; +0x8c, 0x485efc\nSTR             R0, [SP,#0x24+var_18]                                  ; +0x8e, 0x485efe\nBLX             strlen                                                 ; +0x90, 0x485f00\nLDR             R1, [SP,#0x24+var_18]                                  ; +0x94, 0x485f04\nMOV             R2, R0                                                 ; +0x96, 0x485f06\nMOV             R0, R7                                                 ; +0x98, 0x485f08\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEE6__initEPKcj; std::string::__init(char const*,uint) ; +0x9a, 0x485f0a\nMOV             R0, R8                                                 ; +0x9e, 0x485f0e\nMOV             R1, R7                                                 ; +0xa0, 0x485f10\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKNSt6__ndk112basic_stringIcNS1_11char_traitsIcEENS1_9allocatorIcEEEE; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0xa2, 0x485f12\nMOV             R8, R0                                                 ; +0xa6, 0x485f16\nMOV             R0, R7                                                 ; +0xa8, 0x485f18\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xaa, 0x485f1a\nCMP.W           R8, #0                                                 ; +0xae, 0x485f1e\nBEQ             loc_485F5A                                             ; +0xb2, 0x485f22\nLDR.W           R2, [R8]                                               ; +0xb4, 0x485f24\nMOV             R0, R8                                                 ; +0xb8, 0x485f28\nLDR.W           R2, [R2,#0x218]                                        ; +0xba, 0x485f2a\nBLX             R2                                                     ; +0xbe, 0x485f2e\nCBNZ            R5, loc_485F38                                         ; +0xc0, 0x485f30\nADD.W           R2, R10, #(byte_BEBE3C - 0xBEBDD8)                     ; +0xc2, 0x485f32\nB               loc_485F3A                                             ; +0xc6, 0x485f36\nMOV             R2, R9                                                 ; +0xc8, 0x485f38\nLDRB            R7, [R2,#1]                                            ; +0xca, 0x485f3a\nLDRB            R1, [R2]                                               ; +0xcc, 0x485f3c\nLDRB            R2, [R2,#2]                                            ; +0xce, 0x485f3e\nORR.W           R1, R1, R7,LSL#8                                       ; +0xd0, 0x485f40\nORR.W           R1, R1, R2,LSL#16                                      ; +0xd4, 0x485f44\nBL              _ZN12ButtonSprite8setColorEN7cocos2d10_ccColor3BE; ButtonSprite::setColor(cocos2d::_ccColor3B) ; +0xd8, 0x485f48\nLDR.W           R2, [R8]                                               ; +0xdc, 0x485f4c\nMOV             R0, R8                                                 ; +0xe0, 0x485f50\nMOV             R1, R5                                                 ; +0xe2, 0x485f52\nLDR.W           R2, [R2,#0x210]                                        ; +0xe4, 0x485f54\nBLX             R2                                                     ; +0xe8, 0x485f58\nADDS            R6, #1                                                 ; +0xea, 0x485f5a\nCMP             R6, #3                                                 ; +0xec, 0x485f5c\nBEQ             loc_485F6E                                             ; +0xee, 0x485f5e\nCMP             R6, #2                                                 ; +0xf0, 0x485f60\nITET LS                                                                ; +0xf2, 0x485f62\nADDLS.W         R3, R11, #(unk_BEBE44 - 0xBEBDD8)                      ; +0xf4, 0x485f64\nMOVHI           R1, #0x2B ; '+'                                        ; +0xf8, 0x485f68\nLDRSBLS         R1, [R6,R3]                                            ; +0xfa, 0x485f6a\nB               loc_485EE6                                             ; +0xfc, 0x485f6c\nCBZ             R5, loc_485FBC                                         ; +0xfe, 0x485f6e\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x100, 0x485f70\nLDR             R1, =(a0007 - 0x485F7A); \"0007\"                        ; +0x104, 0x485f74\nADD             R1, PC; \"0007\"                                         ; +0x106, 0x485f76\nBL              _ZN11GameManager15getGameVariableEPKc; GameManager::getGameVariable(char const*) ; +0x108, 0x485f78\nCBZ             R0, loc_485F90                                         ; +0x10c, 0x485f7c\nLDR             R3, [SP,#0x24+var_24]                                  ; +0x10e, 0x485f7e\nCBNZ            R3, loc_485FB2                                         ; +0x110, 0x485f80\nLDR.W           R0, [R4,#0x254]                                        ; +0x112, 0x485f82\nLDR             R3, [R0]                                               ; +0x116, 0x485f86\nLDR.W           R3, [R3,#0xB0]                                         ; +0x118, 0x485f88\nBLX             R3                                                     ; +0x11c, 0x485f8c\nCBZ             R0, loc_485FB2                                         ; +0x11e, 0x485f8e\nMOV             R0, R4; this                                           ; +0x120, 0x485f90\nBL              _ZN8EditorUI18updateGridNodeSizeEv; EditorUI::updateGridNodeSize(void) ; +0x122, 0x485f92\nLDR             R3, [SP,#0x24+var_20]                                  ; +0x126, 0x485f96\nLDR             R2, [SP,#0x24+var_8]                                   ; +0x128, 0x485f98\nLDR             R3, [R3]                                               ; +0x12a, 0x485f9a\nCMP             R2, R3                                                 ; +0x12c, 0x485f9c\nBEQ             loc_485FC4                                             ; +0x12e, 0x485f9e\nBLX             __stack_chk_fail                                       ; +0x130, 0x485fa0\nMOV             R0, R7                                                 ; +0x134, 0x485fa4\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x136, 0x485fa6\nBL              __cxa_end_cleanup                                      ; +0x13a, 0x485faa\nMOVS            R5, #0                                                 ; +0x13e, 0x485fae\nB               loc_485EC8                                             ; +0x140, 0x485fb0\nMOV             R0, R4; this                                           ; +0x142, 0x485fb2\nMOVS            R1, #0; cocos2d::CCObject *                            ; +0x144, 0x485fb4\nBL              _ZN8EditorUI23activateRotationControlEPN7cocos2d8CCObjectE; EditorUI::activateRotationControl(cocos2d::CCObject *) ; +0x146, 0x485fb6\nB               loc_485F90                                             ; +0x14a, 0x485fba\nMOV             R0, R4; this                                           ; +0x14c, 0x485fbc\nBL              _ZN8EditorUI25deactivateRotationControlEv; EditorUI::deactivateRotationControl(void) ; +0x14e, 0x485fbe\nB               loc_485F90                                             ; +0x152, 0x485fc2\nADD             SP, SP, #0x24 ; '$'                                    ; +0x154, 0x485fc4\nPOP.W           {R4-R11,PC}                                            ; +0x156, 0x485fc6", "xrefs": ["EditorUI::updateButtons @ 0x485ffc", "EditorUI::toggleEnableRotate @ 0x486604", "EditorUI::activateTransformControl @ 0x70eff8"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "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"}