{"type": "func", "start": 10638720, "end": 10639288, "name": "CharacterColorPage::onPlayerColor", "pseudocode": "// \n// CharacterColorPage::onPlayerColor from 0xa25580 to 0xa257b8 (568 bytes)\n// \n// 3 xrefs:\n// > <???> @ 0x2f5b0\n// > CharacterColorPage::createColorMenu @ 0xa2518c\n// > <???> @ 0x1229650\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 CharacterColorPage::onPlayerColor(CharacterColorPage *a1, cocos2d::CCObject *a2)\n{\n  UnlockType v4; // w21\n  unsigned int v5; // w23\n  GameManager *v6; // x0\n  unsigned int m_colorMode; // w1\n  __int64 v8; // x24\n  cocos2d::CCObject *v9; // x0\n  cocos2d::CCMenu *m_buttonMenu; // x26\n  void (__fastcall *acceptVisitor)(cocos2d::CCObject *__hidden, cocos2d::CCDataVisitor *); // x1\n  cocos2d::CCLayer *m_mainLayer; // x25\n  void (__fastcall *v13)(__int64, _BYTE *, float, float); // x22\n  const cocos2d::CCPoint *v14; // x0\n  CharacterColorDelegate *m_delegate; // x0\n  GameManager *v16; // x0\n  GameManager *v17; // x24\n  int v18; // w0\n  int v19; // w21\n  GameManager *v20; // x0\n  GameManager *v21; // x21\n  int v22; // w0\n  int v23; // w0\n  GameManager *v24; // x0\n  GameManager *v25; // x24\n  int v26; // w0\n  int v27; // w21\n  cocos2d::CCPoint v28; // [xsp+58h] [xbp+58h] BYREF\n  _BYTE v29[8]; // [xsp+60h] [xbp+60h] BYREF\n  cocos2d::CCPoint v30; // 0:kr08_8.8\n\n  if ( a1->m_colorMode )\n    v4 = Col2;\n  else\n    v4 = Col1;\n  v5 = a2->getTag(a2);\n  if ( CharacterColorPage::checkColor(a1, v5, v4) )\n  {\n    if ( v5 == CharacterColorPage::activeColorForMode(a1, a1->m_colorMode) )\n    {\n      m_delegate = a1->m_delegate;\n      if ( m_delegate )\n        m_delegate->showUnlockPopup(m_delegate, v5, v4);\n    }\n    else\n    {\n      GameManager::sharedState()->m_scoreValid = 0;\n      v6 = GameManager::sharedState();\n      GameManager::colorForIdx(v6, v5);\n      m_colorMode = a1->m_colorMode;\n      switch ( m_colorMode )\n      {\n        case 1u:\n          v24 = GameManager::sharedState();\n          v24->m_playerColor2.value = v5;\n          v25 = v24;\n          v26 = rand();\n          m_colorMode = a1->m_colorMode;\n          v27 = (int)(float)((float)((float)v26 * 4.6566e-10) * 1000.0);\n          v25->m_playerColor2.seed = v27;\n          v25->m_playerColor2.random = v5 + v27;\n          break;\n        case 2u:\n          v20 = GameManager::sharedState();\n          v20->m_playerGlowColor.value = v5;\n          v21 = v20;\n          v22 = rand();\n          m_colorMode = a1->m_colorMode;\n          v23 = (int)(float)((float)((float)v22 * 4.6566e-10) * 1000.0);\n          v21->m_playerGlowColor.seed = v23;\n          v21->m_playerGlowColor.random = v5 + v23;\n          break;\n        case 0u:\n          v16 = GameManager::sharedState();\n          v16->m_playerColor.value = v5;\n          v17 = v16;\n          v18 = rand();\n          m_colorMode = a1->m_colorMode;\n          v19 = (int)(float)((float)((float)v18 * 4.6566e-10) * 1000.0);\n          v17->m_playerColor.seed = v19;\n          v17->m_playerColor.random = v5 + v19;\n          break;\n      }\n      v8 = cocos2d::CCArray::objectAtIndex(a1->m_cursors, m_colorMode);\n      v9 = a2;\n      m_buttonMenu = a1->m_buttonMenu;\n      acceptVisitor = a2->__vftable[2].acceptVisitor;\n      m_mainLayer = a1->m_mainLayer;\n      v13 = *(void (__fastcall **)(__int64, _BYTE *, float, float))(*(_QWORD *)v8 + 184LL);\n      v14 = (const cocos2d::CCPoint *)((__int64 (__fastcall *)(cocos2d::CCObject *))acceptVisitor)(v9);\n      cocos2d::CCNode::convertToWorldSpace(m_buttonMenu, v14);\n      v30 = cocos2d::CCNode::convertToNodeSpace(m_mainLayer, &v28);\n      v13(v8, v29, v30.x, v30.y);\n      CharacterColorPage::updateIconColors(a1);\n    }\n  }\n}", "assembly": "; \n; CharacterColorPage::onPlayerColor from 0xa25580 to 0xa257b8 (568 bytes)\n; \n; 3 xrefs:\n; > <???> @ 0x2f5b0\n; > CharacterColorPage::createColorMenu @ 0xa2518c\n; > <???> @ 0x1229650\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_70]!                                ; +0x0, 0xa25580\nMOV             X29, SP                                                ; +0x4, 0xa25584\nSTP             X19, X20, [SP,#0x70+var_60]                            ; +0x8, 0xa25588\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0xa2558c\nMOV             X20, X0                                                ; +0x10, 0xa25590\nSTP             X21, X22, [SP,#0x70+var_50]                            ; +0x14, 0xa25594\nMOV             X0, X1                                                 ; +0x18, 0xa25598\nMOV             X22, X1                                                ; +0x1c, 0xa2559c\nLDR             X3, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x20, 0xa255a0\nMOV             W21, #3                                                ; +0x24, 0xa255a4\nLDR             X1, [X1]                                               ; +0x28, 0xa255a8\nLDR             W2, [X20,#0x278]                                       ; +0x2c, 0xa255ac\nLDR             X3, [X3]                                               ; +0x30, 0xa255b0\nCMP             W2, WZR                                                ; +0x34, 0xa255b4\nLDR             X2, [X1,#0x40]                                         ; +0x38, 0xa255b8\nSTP             X23, X24, [SP,#0x70+var_40]                            ; +0x3c, 0xa255bc\nMOV             W1, #2                                                 ; +0x40, 0xa255c0\nSTR             X3, [X29,#0x70+var_8]                                  ; +0x44, 0xa255c4\nSTP             X25, X26, [SP,#0x70+var_30]                            ; +0x48, 0xa255c8\nCSEL            W21, W1, W21, EQ                                       ; +0x4c, 0xa255cc\nBLR             X2                                                     ; +0x50, 0xa255d0\nMOV             W23, W0                                                ; +0x54, 0xa255d4\nMOV             W1, W23                                                ; +0x58, 0xa255d8\nMOV             X0, X20                                                ; +0x5c, 0xa255dc\nMOV             W2, W21                                                ; +0x60, 0xa255e0\nBL              _ZN18CharacterColorPage10checkColorEi10UnlockType; CharacterColorPage::checkColor(int,UnlockType) ; +0x64, 0xa255e4\nUXTB            W0, W0                                                 ; +0x68, 0xa255e8\nCBNZ            W0, loc_A2561C                                         ; +0x6c, 0xa255ec\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x70, 0xa255f0\nLDR             X1, [X29,#0x70+var_8]                                  ; +0x74, 0xa255f4\nLDR             X0, [X19]                                              ; +0x78, 0xa255f8\nCMP             X1, X0                                                 ; +0x7c, 0xa255fc\nB.NE            loc_A257B4                                             ; +0x80, 0xa25600\nLDP             X19, X20, [SP,#0x70+var_60]                            ; +0x84, 0xa25604\nLDP             X21, X22, [SP,#0x70+var_50]                            ; +0x88, 0xa25608\nLDP             X23, X24, [SP,#0x70+var_40]                            ; +0x8c, 0xa2560c\nLDP             X25, X26, [SP,#0x70+var_30]                            ; +0x90, 0xa25610\nLDP             X29, X30, [SP+0x70+var_70],#0x70                       ; +0x94, 0xa25614\nRET                                                                    ; +0x98, 0xa25618\nLDR             W1, [X20,#0x278]; int                                  ; +0x9c, 0xa2561c\nMOV             X0, X20; this                                          ; +0xa0, 0xa25620\nBL              _ZN18CharacterColorPage18activeColorForModeEi; CharacterColorPage::activeColorForMode(int) ; +0xa4, 0xa25624\nCMP             W23, W0                                                ; +0xa8, 0xa25628\nB.EQ            loc_A256E0                                             ; +0xac, 0xa2562c\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xb0, 0xa25630\nSTRB            WZR, [X0,#0x228]                                       ; +0xb4, 0xa25634\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xb8, 0xa25638\nMOV             W1, W23; int                                           ; +0xbc, 0xa2563c\nBL              _ZN11GameManager11colorForIdxEi; GameManager::colorForIdx(int) ; +0xc0, 0xa25640\nSXTW            X0, W0                                                 ; +0xc4, 0xa25644\nLDR             W1, [X20,#0x278]; unsigned int                         ; +0xc8, 0xa25648\nUBFX            X2, X0, #8, #8                                         ; +0xcc, 0xa2564c\nSTRB            W0, [X29,#0x70+var_20]                                 ; +0xd0, 0xa25650\nUBFX            X0, X0, #0x10, #8; this                                ; +0xd4, 0xa25654\nSTRB            W2, [X29,#0x70+var_1F]                                 ; +0xd8, 0xa25658\nCMP             W1, #1                                                 ; +0xdc, 0xa2565c\nSTRB            W0, [X29,#0x70+var_1E]                                 ; +0xe0, 0xa25660\nB.EQ            loc_A25778                                             ; +0xe4, 0xa25664\nCMP             W1, #2                                                 ; +0xe8, 0xa25668\nB.EQ            loc_A2573C                                             ; +0xec, 0xa2566c\nCBZ             W1, loc_A25700                                         ; +0xf0, 0xa25670\nLDR             X0, [X20,#0x2A0]; this                                 ; +0xf4, 0xa25674\nADD             X23, X29, #0x70+var_18                                 ; +0xf8, 0xa25678\nADD             X21, X29, #0x70+var_10                                 ; +0xfc, 0xa2567c\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x100, 0xa25680\nMOV             X24, X0                                                ; +0x104, 0xa25684\nLDR             X1, [X22]                                              ; +0x108, 0xa25688\nMOV             X0, X22                                                ; +0x10c, 0xa2568c\nLDR             X26, [X20,#0x220]                                      ; +0x110, 0xa25690\nLDR             X2, [X24]                                              ; +0x114, 0xa25694\nLDR             X1, [X1,#0xC0]                                         ; +0x118, 0xa25698\nLDR             X25, [X20,#0x240]                                      ; +0x11c, 0xa2569c\nLDR             X22, [X2,#0xB8]                                        ; +0x120, 0xa256a0\nBLR             X1                                                     ; +0x124, 0xa256a4\nMOV             X1, X0; cocos2d::CCPoint *                             ; +0x128, 0xa256a8\nMOV             X8, X23                                                ; +0x12c, 0xa256ac\nMOV             X0, X26; this                                          ; +0x130, 0xa256b0\nBL              _ZN7cocos2d6CCNode19convertToWorldSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToWorldSpace(cocos2d::CCPoint const&) ; +0x134, 0xa256b4\nMOV             X8, X21                                                ; +0x138, 0xa256b8\nMOV             X0, X25; this                                          ; +0x13c, 0xa256bc\nMOV             X1, X23; cocos2d::CCPoint *                            ; +0x140, 0xa256c0\nBL              _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0x144, 0xa256c4\nMOV             X0, X24                                                ; +0x148, 0xa256c8\nMOV             X1, X21                                                ; +0x14c, 0xa256cc\nBLR             X22                                                    ; +0x150, 0xa256d0\nMOV             X0, X20; this                                          ; +0x154, 0xa256d4\nBL              _ZN18CharacterColorPage16updateIconColorsEv; CharacterColorPage::updateIconColors(void) ; +0x158, 0xa256d8\nB               loc_A255F0                                             ; +0x15c, 0xa256dc\nLDR             X0, [X20,#0x2A8]                                       ; +0x160, 0xa256e0\nCBZ             X0, loc_A255F0                                         ; +0x164, 0xa256e4\nLDR             X3, [X0]                                               ; +0x168, 0xa256e8\nMOV             W1, W23                                                ; +0x16c, 0xa256ec\nMOV             W2, W21                                                ; +0x170, 0xa256f0\nLDR             X3, [X3,#8]                                            ; +0x174, 0xa256f4\nBLR             X3                                                     ; +0x178, 0xa256f8\nB               loc_A255F0                                             ; +0x17c, 0xa256fc\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x180, 0xa25700\nSTR             W23, [X0,#0x2CC]                                       ; +0x184, 0xa25704\nMOV             X24, X0                                                ; +0x188, 0xa25708\nBL              .rand                                                  ; +0x18c, 0xa2570c\nSCVTF           S0, W0                                                 ; +0x190, 0xa25710\nLDR             W1, [X20,#0x278]                                       ; +0x194, 0xa25714\nLDR             S1, =0x30000000                                        ; +0x198, 0xa25718\nFMUL            S0, S0, S1                                             ; +0x19c, 0xa2571c\nLDR             S1, =0x447A0000                                        ; +0x1a0, 0xa25720\nFMUL            S0, S0, S1                                             ; +0x1a4, 0xa25724\nFCVTZS          W21, S0                                                ; +0x1a8, 0xa25728\nADD             W23, W23, W21                                          ; +0x1ac, 0xa2572c\nSTR             W21, [X24,#0x2C8]                                      ; +0x1b0, 0xa25730\nSTR             W23, [X24,#0x2C4]                                      ; +0x1b4, 0xa25734\nB               loc_A25674                                             ; +0x1b8, 0xa25738\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x1bc, 0xa2573c\nSTR             W23, [X0,#0x2E4]                                       ; +0x1c0, 0xa25740\nMOV             X21, X0                                                ; +0x1c4, 0xa25744\nBL              .rand                                                  ; +0x1c8, 0xa25748\nSCVTF           S0, W0                                                 ; +0x1cc, 0xa2574c\nLDR             W1, [X20,#0x278]                                       ; +0x1d0, 0xa25750\nLDR             S1, =0x30000000                                        ; +0x1d4, 0xa25754\nFMUL            S0, S0, S1                                             ; +0x1d8, 0xa25758\nLDR             S1, =0x447A0000                                        ; +0x1dc, 0xa2575c\nFMUL            S0, S0, S1                                             ; +0x1e0, 0xa25760\nFCVTZS          W0, S0                                                 ; +0x1e4, 0xa25764\nADD             W23, W23, W0                                           ; +0x1e8, 0xa25768\nSTR             W0, [X21,#0x2E0]                                       ; +0x1ec, 0xa2576c\nSTR             W23, [X21,#0x2DC]                                      ; +0x1f0, 0xa25770\nB               loc_A25674                                             ; +0x1f4, 0xa25774\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x1f8, 0xa25778\nSTR             W23, [X0,#0x2D8]                                       ; +0x1fc, 0xa2577c\nMOV             X24, X0                                                ; +0x200, 0xa25780\nBL              .rand                                                  ; +0x204, 0xa25784\nSCVTF           S0, W0                                                 ; +0x208, 0xa25788\nLDR             W1, [X20,#0x278]                                       ; +0x20c, 0xa2578c\nLDR             S1, =0x30000000                                        ; +0x210, 0xa25790\nFMUL            S0, S0, S1                                             ; +0x214, 0xa25794\nLDR             S1, =0x447A0000                                        ; +0x218, 0xa25798\nFMUL            S0, S0, S1                                             ; +0x21c, 0xa2579c\nFCVTZS          W21, S0                                                ; +0x220, 0xa257a0\nADD             W23, W23, W21                                          ; +0x224, 0xa257a4\nSTR             W21, [X24,#0x2D4]                                      ; +0x228, 0xa257a8\nSTR             W23, [X24,#0x2D0]                                      ; +0x22c, 0xa257ac\nB               loc_A25674                                             ; +0x230, 0xa257b0\nBL              .__stack_chk_fail                                      ; +0x234, 0xa257b4", "xrefs": ["<???> @ 0x2f5b0", "CharacterColorPage::createColorMenu @ 0xa2518c", "<???> @ 0x1229650"], "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"}