{"type": "func", "start": 3787164, "end": 3787476, "name": "EditorUI::toggleSpecialEditButtons", "pseudocode": "// \n// EditorUI::toggleSpecialEditButtons from 0x39c99c to 0x39cad4 (312 bytes)\n// \n// 2 xrefs:\n// > EditorUI::updateButtons @ 0x39cb02\n// > EditorUI::toggleEnableRotate @ 0x39d086\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; // r6\n  GameObject *v3; // r0\n  GameObject *m_selectedObject; // r0\n  int v5; // r5\n  unsigned int v6; // r6\n  const char *v7; // r1\n  cocos2d::CCDictionary *m_editButtonDict; // r8\n  cocos2d::CCString *v9; // r0\n  char *CString; // r0\n  int v11; // r8\n  char *v12; // r3\n  ButtonSprite *v13; // r0\n  __int16 *v14; // r2\n  GameManager *v15; // r0\n  std::string v16; // [sp+10h] [bp-Ch] BYREF\n\n  if ( cocos2d::CCArray::count(a1->m_selectedObjects) )\n  {\n    for ( i = 0; i < cocos2d::CCArray::count(a1->m_selectedObjects); ++i )\n    {\n      v3 = (GameObject *)cocos2d::CCArray::objectAtIndex(a1->m_selectedObjects, i);\n      if ( !GameObject::canRotateFree(v3) )\n      {\n        v5 = 0;\n        goto LABEL_10;\n      }\n    }\n  }\n  else\n  {\n    m_selectedObject = a1->m_selectedObject;\n    if ( !m_selectedObject || !GameObject::canRotateFree(m_selectedObject) )\n    {\n      v5 = 0;\n      goto LABEL_10;\n    }\n  }\n  v5 = 1;\nLABEL_10:\n  v6 = -1;\n  v7 = (char *)&dword_18 + 3;\n  while ( 1 )\n  {\n    m_editButtonDict = a1->m_editButtonDict;\n    v9 = (cocos2d::CCString *)cocos2d::CCString::createWithFormat((cocos2d::CCString *)\"%i\", v7);\n    CString = (char *)cocos2d::CCString::getCString(v9);\n    sub_776584((int)&v16, CString);\n    v11 = cocos2d::CCDictionary::objectForKey(m_editButtonDict, &v16);\n    sub_774008(&v16);\n    if ( v11 )\n    {\n      v13 = (ButtonSprite *)(*(int (__fastcall **)(int))(*(_DWORD *)v11 + 528))(v11);\n      if ( v5 )\n        v14 = word_9AA83C;\n      else\n        v14 = &word_9AA83F;\n      ButtonSprite::setColor(\n        v13,\n        (cocos2d::ccColor3B)(*(unsigned __int8 *)v14\n                           | (*((unsigned __int8 *)v14 + 1) << 8)\n                           | (*((unsigned __int8 *)v14 + 2) << 16)));\n      (*(void (__fastcall **)(int, int))(*(_DWORD *)v11 + 520))(v11, v5);\n    }\n    if ( ++v6 == 3 )\n      break;\n    if ( v6 > 2 )\n      v7 = (_BYTE *)(&dword_18 + 3);\n    else\n      v12 = (char *)&unk_9AA868;\n    if ( v6 <= 2 )\n      v7 = (const char *)v12[v6];\n  }\n  if ( v5 )\n  {\n    v15 = GameManager::sharedState();\n    if ( GameManager::getGameVariable(v15, \"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 0x39c99c to 0x39cad4 (312 bytes)\n; \n; 2 xrefs:\n; > EditorUI::updateButtons @ 0x39cb02\n; > EditorUI::toggleEnableRotate @ 0x39d086\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\nPUSH.W          {R4-R11,LR}                                            ; +0x0, 0x39c99c\nSUB             SP, SP, #0x1C                                          ; +0x4, 0x39c9a0\nLDR             R5, =(__stack_chk_guard_ptr - 0x39C9AE)                ; +0x6, 0x39c9a2\nMOV             R4, R0                                                 ; +0x8, 0x39c9a4\nLDR.W           R0, [R0,#0x260]; this                                  ; +0xa, 0x39c9a6\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0xe, 0x39c9aa\nLDR             R5, [R5]; __stack_chk_guard                            ; +0x10, 0x39c9ac\nLDR             R3, [R5]                                               ; +0x12, 0x39c9ae\nSTR             R3, [SP,#0x1C+var_8]                                   ; +0x14, 0x39c9b0\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x16, 0x39c9b2\nSTR             R5, [SP,#0x1C+var_1C]                                  ; +0x1a, 0x39c9b6\nCBZ             R0, loc_39C9DC                                         ; +0x1c, 0x39c9b8\nMOVS            R6, #0                                                 ; +0x1e, 0x39c9ba\nLDR.W           R0, [R4,#0x260]; this                                  ; +0x20, 0x39c9bc\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x24, 0x39c9c0\nCMP             R6, R0                                                 ; +0x28, 0x39c9c4\nBCS             loc_39C9EC                                             ; +0x2a, 0x39c9c6\nMOV             R1, R6; unsigned int                                   ; +0x2c, 0x39c9c8\nLDR.W           R0, [R4,#0x260]; this                                  ; +0x2e, 0x39c9ca\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x32, 0x39c9ce\nBL              _ZN10GameObject13canRotateFreeEv; GameObject::canRotateFree(void) ; +0x36, 0x39c9d2\nCBZ             R0, loc_39C9F0                                         ; +0x3a, 0x39c9d6\nADDS            R6, #1                                                 ; +0x3c, 0x39c9d8\nB               loc_39C9BC                                             ; +0x3e, 0x39c9da\nLDR.W           R0, [R4,#0x374]; this                                  ; +0x40, 0x39c9dc\nCMP             R0, #0                                                 ; +0x44, 0x39c9e0\nBEQ             loc_39CAB8                                             ; +0x46, 0x39c9e2\nBL              _ZN10GameObject13canRotateFreeEv; GameObject::canRotateFree(void) ; +0x48, 0x39c9e4\nCMP             R0, #0                                                 ; +0x4c, 0x39c9e8\nBEQ             loc_39CAB8                                             ; +0x4e, 0x39c9ea\nMOVS            R5, #1                                                 ; +0x50, 0x39c9ec\nB               loc_39C9F2                                             ; +0x52, 0x39c9ee\nMOV             R5, R0                                                 ; +0x54, 0x39c9f0\nLDR.W           R9, =(word_9AA83C - 0x39CA08)                          ; +0x56, 0x39c9f2\nMOV.W           R6, #0xFFFFFFFF                                        ; +0x5a, 0x39c9f6\nLDR.W           R10, =(word_9AA83C - 0x39CA0C)                         ; +0x5e, 0x39c9fa\nMOVS            R1, #(dword_18+3); char *                              ; +0x62, 0x39c9fe\nLDR.W           R11, =(word_9AA83C - 0x39CA0E)                         ; +0x64, 0x39ca00\nADD             R9, PC; word_9AA83C                                    ; +0x68, 0x39ca04\nLDR             R3, =(aI - 0x39CA10); \"%i\"                             ; +0x6a, 0x39ca06\nADD             R10, PC; word_9AA83C                                   ; +0x6c, 0x39ca08\nADD             R11, PC; word_9AA83C                                   ; +0x6e, 0x39ca0a\nADD             R3, PC; \"%i\"                                           ; +0x70, 0x39ca0c\nSTR             R3, [SP,#0x1C+var_18]                                  ; +0x72, 0x39ca0e\nLDR             R0, [SP,#0x1C+var_18]; this                            ; +0x74, 0x39ca10\nADD             R7, SP, #0x1C+var_C                                    ; +0x76, 0x39ca12\nLDR.W           R8, [R4,#0x224]                                        ; +0x78, 0x39ca14\nBL              _ZN7cocos2d8CCString16createWithFormatEPKcz; cocos2d::CCString::createWithFormat(char const*,...) ; +0x7c, 0x39ca18\nBL              _ZNK7cocos2d8CCString10getCStringEv; cocos2d::CCString::getCString(void) ; +0x80, 0x39ca1c\nADD             R2, SP, #0x1C+var_10                                   ; +0x84, 0x39ca20\nMOV             R1, R0; char *                                         ; +0x86, 0x39ca22\nMOV             R0, R7; int                                            ; +0x88, 0x39ca24\nBL              sub_776584                                             ; +0x8a, 0x39ca26\nMOV             R0, R8                                                 ; +0x8e, 0x39ca2a\nMOV             R1, R7                                                 ; +0x90, 0x39ca2c\nBL              _ZN7cocos2d12CCDictionary12objectForKeyERKSs; cocos2d::CCDictionary::objectForKey(std::string const&) ; +0x92, 0x39ca2e\nMOV             R8, R0                                                 ; +0x96, 0x39ca32\nMOV             R0, R7                                                 ; +0x98, 0x39ca34\nBL              sub_774008                                             ; +0x9a, 0x39ca36\nCMP.W           R8, #0                                                 ; +0x9e, 0x39ca3a\nBEQ             loc_39CA76                                             ; +0xa2, 0x39ca3e\nLDR.W           R2, [R8]                                               ; +0xa4, 0x39ca40\nMOV             R0, R8                                                 ; +0xa8, 0x39ca44\nLDR.W           R2, [R2,#0x210]                                        ; +0xaa, 0x39ca46\nBLX             R2                                                     ; +0xae, 0x39ca4a\nCBNZ            R5, loc_39CA54                                         ; +0xb0, 0x39ca4c\nADD.W           R2, R10, #(word_9AA83F - 0x9AA83C)                     ; +0xb2, 0x39ca4e\nB               loc_39CA56                                             ; +0xb6, 0x39ca52\nMOV             R2, R9                                                 ; +0xb8, 0x39ca54\nLDRB            R7, [R2,#1]                                            ; +0xba, 0x39ca56\nLDRB            R1, [R2]                                               ; +0xbc, 0x39ca58\nLDRB            R2, [R2,#2]                                            ; +0xbe, 0x39ca5a\nORR.W           R1, R1, R7,LSL#8                                       ; +0xc0, 0x39ca5c\nORR.W           R1, R1, R2,LSL#16                                      ; +0xc4, 0x39ca60\nBL              _ZN12ButtonSprite8setColorEN7cocos2d10_ccColor3BE; ButtonSprite::setColor(cocos2d::_ccColor3B) ; +0xc8, 0x39ca64\nLDR.W           R2, [R8]                                               ; +0xcc, 0x39ca68\nMOV             R0, R8                                                 ; +0xd0, 0x39ca6c\nMOV             R1, R5                                                 ; +0xd2, 0x39ca6e\nLDR.W           R2, [R2,#0x208]                                        ; +0xd4, 0x39ca70\nBLX             R2                                                     ; +0xd8, 0x39ca74\nADDS            R6, #1                                                 ; +0xda, 0x39ca76\nCMP             R6, #3                                                 ; +0xdc, 0x39ca78\nBEQ             loc_39CA8A                                             ; +0xde, 0x39ca7a\nCMP             R6, #2                                                 ; +0xe0, 0x39ca7c\nITET LS                                                                ; +0xe2, 0x39ca7e\nADDLS.W         R3, R11, #(unk_9AA868 - 0x9AA83C)                      ; +0xe4, 0x39ca80\nMOVHI           R1, #0x1B                                              ; +0xe8, 0x39ca84\nLDRSBLS         R1, [R6,R3]                                            ; +0xea, 0x39ca86\nB               loc_39CA10                                             ; +0xec, 0x39ca88\nCBZ             R5, loc_39CAC6                                         ; +0xee, 0x39ca8a\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xf0, 0x39ca8c\nLDR             R1, =(a0007 - 0x39CA96); \"0007\"                        ; +0xf4, 0x39ca90\nADD             R1, PC; \"0007\"                                         ; +0xf6, 0x39ca92\nBL              _ZN11GameManager15getGameVariableEPKc; GameManager::getGameVariable(char const*) ; +0xf8, 0x39ca94\nCBNZ            R0, loc_39CABC                                         ; +0xfc, 0x39ca98\nMOV             R0, R4; this                                           ; +0xfe, 0x39ca9a\nBL              _ZN8EditorUI18updateGridNodeSizeEv; EditorUI::updateGridNodeSize(void) ; +0x100, 0x39ca9c\nLDR             R3, [SP,#0x1C+var_1C]                                  ; +0x104, 0x39caa0\nLDR             R2, [SP,#0x1C+var_8]                                   ; +0x106, 0x39caa2\nLDR             R3, [R3]                                               ; +0x108, 0x39caa4\nCMP             R2, R3                                                 ; +0x10a, 0x39caa6\nBEQ             loc_39CACE                                             ; +0x10c, 0x39caa8\nBLX             __stack_chk_fail                                       ; +0x10e, 0x39caaa\nMOV             R0, R7                                                 ; +0x112, 0x39caae\nBL              sub_774008                                             ; +0x114, 0x39cab0\nBL              __cxa_end_cleanup                                      ; +0x118, 0x39cab4\nMOVS            R5, #0                                                 ; +0x11c, 0x39cab8\nB               loc_39C9F2                                             ; +0x11e, 0x39caba\nMOV             R0, R4; this                                           ; +0x120, 0x39cabc\nMOVS            R1, #0; cocos2d::CCObject *                            ; +0x122, 0x39cabe\nBL              _ZN8EditorUI23activateRotationControlEPN7cocos2d8CCObjectE; EditorUI::activateRotationControl(cocos2d::CCObject *) ; +0x124, 0x39cac0\nB               loc_39CA9A                                             ; +0x128, 0x39cac4\nMOV             R0, R4; this                                           ; +0x12a, 0x39cac6\nBL              _ZN8EditorUI25deactivateRotationControlEv; EditorUI::deactivateRotationControl(void) ; +0x12c, 0x39cac8\nB               loc_39CA9A                                             ; +0x130, 0x39cacc\nADD             SP, SP, #0x1C                                          ; +0x132, 0x39cace\nPOP.W           {R4-R11,PC}                                            ; +0x134, 0x39cad0", "xrefs": ["EditorUI::updateButtons @ 0x39cb02", "EditorUI::toggleEnableRotate @ 0x39d086"], "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"}