{"type": "func", "start": 3654380, "end": 3654636, "name": "EditorUI::enableButton", "pseudocode": "// \n// EditorUI::enableButton from 0x37c2ec to 0x37c3ec (256 bytes)\n// \n// 2 xrefs:\n// > EditorUI::updateCreateMenu @ 0x37df1c\n// > EditorUI::updateCreateMenu @ 0x37df40\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::enableButton(EditorUI *a1, CreateMenuItem *a2)\n{\n  cocos2d::CCNode *v3; // r4\n  int m_nTag; // r0\n  void (*v5)(void); // r3\n  unsigned int m_uReference; // r0\n  int m_nLuaID; // r4\n  char v8; // r3\n  void (__fastcall *v9)(int, _BYTE *); // r2\n  int v10; // r3\n  CreateMenuItem *v11; // [sp+4h] [bp-Ch] BYREF\n  _BYTE v12[4]; // [sp+8h] [bp-8h] BYREF\n\n  v11 = a2;\n  v3 = a2->getNormalImage(a2);\n  m_nTag = v3[2].m_nTag;\n  if ( m_nTag )\n  {\n    v5 = *(void (**)(void))(*(_DWORD *)m_nTag + 472);\n  }\n  else\n  {\n    m_uReference = v3[2].m_uReference;\n    if ( !m_uReference )\n      goto LABEL_6;\n    v5 = *(void (**)(void))(*(_DWORD *)m_uReference + 472);\n  }\n  v5();\nLABEL_6:\n  if ( a2->m_objectID < 0 )\n    return;\n  m_nLuaID = v3[2].m_nLuaID;\n  LOWORD(v11) = -1;\n  BYTE2(v11) = -1;\n  if ( *(_DWORD *)(m_nLuaID + 1076) != 1\n    || !GameObject::isColorObject((GameObject *)m_nLuaID)\n    || !*(_BYTE *)(m_nLuaID + 1576) )\n  {\n    v10 = *(_DWORD *)(m_nLuaID + 884);\n    if ( v10 > 1328 )\n    {\n      if ( v10 != 1584 && v10 != 2012 )\n      {\nLABEL_17:\n        if ( GameObject::getMainColorMode((GameObject *)m_nLuaID) != 1010 )\n          goto LABEL_12;\n      }\n    }\n    else if ( v10 < 1327 && (unsigned int)(v10 - 918) > 1 )\n    {\n      goto LABEL_17;\n    }\n    v8 = 0;\n    LOWORD(v11) = 0;\n    goto LABEL_11;\n  }\n  LOWORD(v11) = -14136;\n  v8 = -1;\nLABEL_11:\n  BYTE2(v11) = v8;\nLABEL_12:\n  (*(void (__fastcall **)(int, CreateMenuItem **))(*(_DWORD *)m_nLuaID + 740))(m_nLuaID, &v11);\n  v9 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)m_nLuaID + 540);\n  v12[0] = -56;\n  v12[1] = -56;\n  v12[2] = -1;\n  v9(m_nLuaID, v12);\n}", "assembly": "; \n; EditorUI::enableButton from 0x37c2ec to 0x37c3ec (256 bytes)\n; \n; 2 xrefs:\n; > EditorUI::updateCreateMenu @ 0x37df1c\n; > EditorUI::updateCreateMenu @ 0x37df40\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            {R0-R6,LR}                                             ; +0x0, 0x37c2ec\nMOV             R0, R1                                                 ; +0x2, 0x37c2ee\nLDR             R5, =(__stack_chk_guard_ptr - 0x37C2F8)                ; +0x4, 0x37c2f0\nMOV             R6, R1                                                 ; +0x6, 0x37c2f2\nADD             R5, PC; __stack_chk_guard_ptr                          ; +0x8, 0x37c2f4\nLDR             R5, [R5]; __stack_chk_guard                            ; +0xa, 0x37c2f6\nLDR             R3, [R5]                                               ; +0xc, 0x37c2f8\nSTR             R3, [SP,#0x10+var_4]                                   ; +0xe, 0x37c2fa\nLDR             R3, [R1]                                               ; +0x10, 0x37c2fc\nLDR.W           R3, [R3,#0x210]                                        ; +0x12, 0x37c2fe\nBLX             R3                                                     ; +0x16, 0x37c302\nMOV             R4, R0                                                 ; +0x18, 0x37c304\nLDR.W           R0, [R0,#0x21C]                                        ; +0x1a, 0x37c306\nCBZ             R0, loc_37C318                                         ; +0x1e, 0x37c30a\nLDR             R3, [R0]                                               ; +0x20, 0x37c30c\nLDR             R1, =(word_9AA83C - 0x37C318)                          ; +0x22, 0x37c30e\nLDR.W           R3, [R3,#0x1D8]                                        ; +0x24, 0x37c310\nADD             R1, PC; word_9AA83C                                    ; +0x28, 0x37c314\nB               loc_37C328                                             ; +0x2a, 0x37c316\nLDR.W           R0, [R4,#0x220]                                        ; +0x2c, 0x37c318\nCBZ             R0, loc_37C32A                                         ; +0x30, 0x37c31c\nLDR             R3, [R0]                                               ; +0x32, 0x37c31e\nLDR             R1, =(word_9AA83C - 0x37C32A)                          ; +0x34, 0x37c320\nLDR.W           R3, [R3,#0x1D8]                                        ; +0x36, 0x37c322\nADD             R1, PC; word_9AA83C                                    ; +0x3a, 0x37c326\nBLX             R3                                                     ; +0x3c, 0x37c328\nLDR.W           R3, [R6,#0x178]                                        ; +0x3e, 0x37c32a\nCMP             R3, #0                                                 ; +0x42, 0x37c32e\nBLT             loc_37C3DC                                             ; +0x44, 0x37c330\nLDR             R3, =(word_9AA83C - 0x37C33E)                          ; +0x46, 0x37c332\nADD             R6, SP, #0x10+var_C                                    ; +0x48, 0x37c334\nLDR.W           R4, [R4,#0x218]                                        ; +0x4a, 0x37c336\nADD             R3, PC; word_9AA83C                                    ; +0x4e, 0x37c33a\nLDRH            R2, [R3]                                               ; +0x50, 0x37c33c\nLDRB            R3, [R3,#(byte_9AA83E - 0x9AA83C)]                     ; +0x52, 0x37c33e\nSTRH.W          R2, [SP,#0x10+var_C]                                   ; +0x54, 0x37c340\nSTRB            R3, [R6,#2]                                            ; +0x58, 0x37c344\nLDR.W           R3, [R4,#0x434]                                        ; +0x5a, 0x37c346\nCMP             R3, #1                                                 ; +0x5e, 0x37c34a\nBNE             loc_37C396                                             ; +0x60, 0x37c34c\nMOV             R0, R4; this                                           ; +0x62, 0x37c34e\nBL              _ZN10GameObject13isColorObjectEv; GameObject::isColorObject(void) ; +0x64, 0x37c350\nCBZ             R0, loc_37C396                                         ; +0x68, 0x37c354\nLDRB.W          R3, [R4,#0x628]                                        ; +0x6a, 0x37c356\nCBZ             R3, loc_37C396                                         ; +0x6e, 0x37c35a\nMOVS            R3, #0xC8                                              ; +0x70, 0x37c35c\nSTRB.W          R3, [SP,#0x10+var_C]                                   ; +0x72, 0x37c35e\nSTRB.W          R3, [SP,#0x10+var_C+1]                                 ; +0x76, 0x37c362\nMOVS            R3, #0xFF                                              ; +0x7a, 0x37c366\nSTRB.W          R3, [SP,#0x10+var_A]                                   ; +0x7c, 0x37c368\nLDR             R3, [R4]                                               ; +0x80, 0x37c36c\nMOV             R0, R4                                                 ; +0x82, 0x37c36e\nMOV             R1, R6                                                 ; +0x84, 0x37c370\nLDR.W           R3, [R3,#0x2E4]                                        ; +0x86, 0x37c372\nBLX             R3                                                     ; +0x8a, 0x37c376\nLDR             R3, [R4]                                               ; +0x8c, 0x37c378\nMOV             R0, R4                                                 ; +0x8e, 0x37c37a\nADD             R1, SP, #0x10+var_8                                    ; +0x90, 0x37c37c\nLDR.W           R2, [R3,#0x21C]                                        ; +0x92, 0x37c37e\nMOVS            R3, #0xC8                                              ; +0x96, 0x37c382\nSTRB.W          R3, [SP,#0x10+var_8]                                   ; +0x98, 0x37c384\nSTRB.W          R3, [SP,#0x10+var_7]                                   ; +0x9c, 0x37c388\nMOVS            R3, #0xFF                                              ; +0xa0, 0x37c38c\nSTRB.W          R3, [SP,#0x10+var_6]                                   ; +0xa2, 0x37c38e\nBLX             R2                                                     ; +0xa6, 0x37c392\nB               loc_37C3DC                                             ; +0xa8, 0x37c394\nLDR.W           R3, [R4,#0x374]                                        ; +0xaa, 0x37c396\nCMP.W           R3, #0x530                                             ; +0xae, 0x37c39a\nBGT             loc_37C3CC                                             ; +0xb2, 0x37c39e\nMOVW            R2, #0x52F                                             ; +0xb4, 0x37c3a0\nCMP             R3, R2                                                 ; +0xb8, 0x37c3a4\nBLT             loc_37C3B4                                             ; +0xba, 0x37c3a6\nMOVS            R3, #0                                                 ; +0xbc, 0x37c3a8\nSTRB.W          R3, [SP,#0x10+var_C]                                   ; +0xbe, 0x37c3aa\nSTRB.W          R3, [SP,#0x10+var_C+1]                                 ; +0xc2, 0x37c3ae\nB               loc_37C368                                             ; +0xc6, 0x37c3b2\nSUBW            R3, R3, #0x396                                         ; +0xc8, 0x37c3b4\nCMP             R3, #1                                                 ; +0xcc, 0x37c3b8\nBLS             loc_37C3A8                                             ; +0xce, 0x37c3ba\nMOV             R0, R4; this                                           ; +0xd0, 0x37c3bc\nBL              _ZN10GameObject16getMainColorModeEv; GameObject::getMainColorMode(void) ; +0xd2, 0x37c3be\nMOVW            R3, #0x3F2                                             ; +0xd6, 0x37c3c2\nCMP             R0, R3                                                 ; +0xda, 0x37c3c6\nBNE             loc_37C36C                                             ; +0xdc, 0x37c3c8\nB               loc_37C3A8                                             ; +0xde, 0x37c3ca\nCMP.W           R3, #0x630                                             ; +0xe0, 0x37c3cc\nBEQ             loc_37C3A8                                             ; +0xe4, 0x37c3d0\nMOVW            R2, #0x7DC                                             ; +0xe6, 0x37c3d2\nCMP             R3, R2                                                 ; +0xea, 0x37c3d6\nBEQ             loc_37C3A8                                             ; +0xec, 0x37c3d8\nB               loc_37C3BC                                             ; +0xee, 0x37c3da\nLDR             R2, [SP,#0x10+var_4]                                   ; +0xf0, 0x37c3dc\nLDR             R3, [R5]                                               ; +0xf2, 0x37c3de\nCMP             R2, R3                                                 ; +0xf4, 0x37c3e0\nBEQ             loc_37C3E8                                             ; +0xf6, 0x37c3e2\nBLX             __stack_chk_fail                                       ; +0xf8, 0x37c3e4\nADD             SP, SP, #0x10                                          ; +0xfc, 0x37c3e8\nPOP             {R4-R6,PC}                                             ; +0xfe, 0x37c3ea", "xrefs": ["EditorUI::updateCreateMenu @ 0x37df1c", "EditorUI::updateCreateMenu @ 0x37df40"], "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"}