{"type": "func", "start": 4594388, "end": 4594528, "name": "CustomizeObjectLayer::getActiveMode", "pseudocode": "// \n// CustomizeObjectLayer::getActiveMode from 0x461ad4 to 0x461b60 (140 bytes)\n// \n// 7 xrefs:\n// > CustomizeObjectLayer::onLiveEdit @ 0x461b66\n// > CustomizeObjectLayer::onEditColor @ 0x461b92\n// > CustomizeObjectLayer::updateColorSprite @ 0x461bd4\n// > CustomizeObjectLayer::onSelectColor @ 0x461ffc\n// > CustomizeObjectLayer::updateCurrentSelection @ 0x4620d4\n// > CustomizeObjectLayer::onPaste @ 0x46213a\n// > CustomizeObjectLayer::onSelectMode @ 0x46235e\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\nint CustomizeObjectLayer::getActiveMode(CustomizeObjectLayer *a1, bool a2)\n{\n  GameObject *m_targetObject; // r0\n  _BOOL4 v4; // r6\n  GJSpriteColor *RelativeSpriteColor; // r0\n  int m_colorID; // r4\n  _BOOL4 v7; // r6\n  unsigned int v8; // r5\n  GameObject *v9; // r0\n  GJSpriteColor *v10; // r0\n  int m_defaultColorID; // r2\n  int v12; // r3\n\n  m_targetObject = a1->m_targetObject;\n  v4 = a2;\n  if ( m_targetObject )\n  {\n    RelativeSpriteColor = GameObject::getRelativeSpriteColor(m_targetObject, a1->m_selectedMode);\n    if ( !RelativeSpriteColor )\n      return 0;\n    m_colorID = RelativeSpriteColor->m_colorID;\n    if ( RelativeSpriteColor->m_defaultColorID != RelativeSpriteColor->m_colorID )\n    {\n      if ( m_colorID )\n        return m_colorID;\n      m_colorID = RelativeSpriteColor->m_defaultColorID;\n    }\n    if ( !v4 )\n      return 0;\n  }\n  else\n  {\n    v7 = !a2;\n    v8 = 0;\n    m_colorID = -1;\n    while ( v8 < cocos2d::CCArray::count(a1->m_targetObjects) )\n    {\n      v9 = (GameObject *)cocos2d::CCArray::objectAtIndex(a1->m_targetObjects, v8);\n      v10 = GameObject::getRelativeSpriteColor(v9, a1->m_selectedMode);\n      if ( v10 )\n      {\n        m_defaultColorID = v10->m_defaultColorID;\n        v12 = v10->m_colorID;\n        if ( m_defaultColorID != v10->m_colorID && !v12 )\n          v12 = v10->m_defaultColorID;\n        if ( v7 )\n          v7 = v12 == m_defaultColorID;\n        if ( m_colorID != -1 && m_colorID != v12 )\n        {\n          m_colorID = -1;\n          break;\n        }\n      }\n      else\n      {\n        v12 = m_colorID;\n      }\n      ++v8;\n      m_colorID = v12;\n    }\n    if ( v7 )\n      return 0;\n  }\n  return m_colorID;\n}", "assembly": "; \n; CustomizeObjectLayer::getActiveMode from 0x461ad4 to 0x461b60 (140 bytes)\n; \n; 7 xrefs:\n; > CustomizeObjectLayer::onLiveEdit @ 0x461b66\n; > CustomizeObjectLayer::onEditColor @ 0x461b92\n; > CustomizeObjectLayer::updateColorSprite @ 0x461bd4\n; > CustomizeObjectLayer::onSelectColor @ 0x461ffc\n; > CustomizeObjectLayer::updateCurrentSelection @ 0x4620d4\n; > CustomizeObjectLayer::onPaste @ 0x46213a\n; > CustomizeObjectLayer::onSelectMode @ 0x46235e\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            {R3-R7,LR}                                             ; +0x0, 0x461ad4\nMOV             R7, R0                                                 ; +0x2, 0x461ad6\nLDR.W           R0, [R0,#0x200]; this                                  ; +0x4, 0x461ad8\nMOV             R6, R1                                                 ; +0x8, 0x461adc\nCBZ             R0, loc_461AFC                                         ; +0xa, 0x461ade\nLDR.W           R1, [R7,#0x21C]; int                                   ; +0xc, 0x461ae0\nBL              _ZN10GameObject22getRelativeSpriteColorEi; GameObject::getRelativeSpriteColor(int) ; +0x10, 0x461ae4\nCBNZ            R0, loc_461AEE                                         ; +0x14, 0x461ae8\nMOVS            R4, #0                                                 ; +0x16, 0x461aea\nB               loc_461B5C                                             ; +0x18, 0x461aec\nLDR             R3, [R0,#4]                                            ; +0x1a, 0x461aee\nLDR             R4, [R0]                                               ; +0x1c, 0x461af0\nCMP             R3, R4                                                 ; +0x1e, 0x461af2\nBEQ             loc_461B56                                             ; +0x20, 0x461af4\nCBNZ            R4, loc_461B5C                                         ; +0x22, 0x461af6\nMOV             R4, R3                                                 ; +0x24, 0x461af8\nB               loc_461B56                                             ; +0x26, 0x461afa\nEOR.W           R6, R1, #1                                             ; +0x28, 0x461afc\nMOV             R5, R0                                                 ; +0x2c, 0x461b00\nMOV.W           R4, #0xFFFFFFFF                                        ; +0x2e, 0x461b02\nLDR.W           R0, [R7,#0x204]; this                                  ; +0x32, 0x461b06\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x36, 0x461b0a\nCMP             R5, R0                                                 ; +0x3a, 0x461b0e\nBCS             loc_461B52                                             ; +0x3c, 0x461b10\nMOV             R1, R5; unsigned int                                   ; +0x3e, 0x461b12\nLDR.W           R0, [R7,#0x204]; this                                  ; +0x40, 0x461b14\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x44, 0x461b18\nLDR.W           R1, [R7,#0x21C]; int                                   ; +0x48, 0x461b1c\nBL              _ZN10GameObject22getRelativeSpriteColorEi; GameObject::getRelativeSpriteColor(int) ; +0x4c, 0x461b20\nCBZ             R0, loc_461B46                                         ; +0x50, 0x461b24\nLDR             R2, [R0,#4]                                            ; +0x52, 0x461b26\nLDR             R3, [R0]                                               ; +0x54, 0x461b28\nCMP             R2, R3                                                 ; +0x56, 0x461b2a\nBEQ             loc_461B34                                             ; +0x58, 0x461b2c\nCMP             R3, #0                                                 ; +0x5a, 0x461b2e\nIT EQ                                                                  ; +0x5c, 0x461b30\nMOVEQ           R3, R2                                                 ; +0x5e, 0x461b32\nCBZ             R6, loc_461B3C                                         ; +0x60, 0x461b34\nSUBS            R1, R3, R2                                             ; +0x62, 0x461b36\nNEGS            R6, R1                                                 ; +0x64, 0x461b38\nADCS            R6, R1                                                 ; +0x66, 0x461b3a\nADDS            R2, R4, #1                                             ; +0x68, 0x461b3c\nBEQ             loc_461B48                                             ; +0x6a, 0x461b3e\nCMP             R4, R3                                                 ; +0x6c, 0x461b40\nBEQ             loc_461B48                                             ; +0x6e, 0x461b42\nB               loc_461B4E                                             ; +0x70, 0x461b44\nMOV             R3, R4                                                 ; +0x72, 0x461b46\nADDS            R5, #1                                                 ; +0x74, 0x461b48\nMOV             R4, R3                                                 ; +0x76, 0x461b4a\nB               loc_461B06                                             ; +0x78, 0x461b4c\nMOV.W           R4, #0xFFFFFFFF                                        ; +0x7a, 0x461b4e\nCBZ             R6, loc_461B5C                                         ; +0x7e, 0x461b52\nB               loc_461AEA                                             ; +0x80, 0x461b54\nCMP             R6, #0                                                 ; +0x82, 0x461b56\nIT EQ                                                                  ; +0x84, 0x461b58\nMOVEQ           R4, #0                                                 ; +0x86, 0x461b5a\nMOV             R0, R4                                                 ; +0x88, 0x461b5c\nPOP             {R3-R7,PC}                                             ; +0x8a, 0x461b5e", "xrefs": ["CustomizeObjectLayer::onLiveEdit @ 0x461b66", "CustomizeObjectLayer::onEditColor @ 0x461b92", "CustomizeObjectLayer::updateColorSprite @ 0x461bd4", "CustomizeObjectLayer::onSelectColor @ 0x461ffc", "CustomizeObjectLayer::updateCurrentSelection @ 0x4620d4", "CustomizeObjectLayer::onPaste @ 0x46213a", "CustomizeObjectLayer::onSelectMode @ 0x46235e"], "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"}