{"type": "func", "start": 5657928, "end": 5658320, "name": "CharacterColorPage::onPlayerColor", "pseudocode": "// \n// CharacterColorPage::onPlayerColor from 0x565548 to 0x5656d0 (392 bytes)\n// \n// 0 xrefs:\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; // r8\n  int v5; // r5\n  int active; // r1\n  CharacterColorDelegate *m_delegate; // r0\n  GameManager *v8; // r0\n  int m_colorMode; // r3\n  GameManager *v10; // r0\n  GameManager *v11; // r8\n  int v12; // s15\n  GameManager *v13; // r0\n  GameManager *v14; // r8\n  int v15; // s15\n  GameManager *v16; // r0\n  GameManager *v17; // r8\n  int v18; // s15\n  int v19; // r0\n  cocos2d::CCMenu *m_buttonMenu; // r5\n  cocos2d::CCLayer *m_mainLayer; // r10\n  int v22; // r8\n  void (__fastcall *v23)(int, cocos2d::CCPoint *); // r9\n  const cocos2d::CCPoint *v24; // r0\n  cocos2d::CCPoint v25; // [sp+4h] [bp-14h] BYREF\n  cocos2d::CCPoint v26; // [sp+Ch] [bp-Ch] BYREF\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    active = CharacterColorPage::activeColorForMode(a1, a1->m_colorMode);\n    if ( active == v5 )\n    {\n      m_delegate = a1->m_delegate;\n      if ( m_delegate )\n        m_delegate->showUnlockPopup(m_delegate, active, v4);\n    }\n    else\n    {\n      GameManager::sharedState()->m_scoreValid = 0;\n      v8 = GameManager::sharedState();\n      GameManager::colorForIdx(v8, v5);\n      m_colorMode = a1->m_colorMode;\n      switch ( m_colorMode )\n      {\n        case 1:\n          v13 = GameManager::sharedState();\n          v13->m_playerColor2.value = v5;\n          v14 = v13;\n          v15 = (int)(float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0);\n          v14->m_playerColor2.seed = v15;\n          v14->m_playerColor2.random = v15 + v5;\n          break;\n        case 2:\n          v16 = GameManager::sharedState();\n          v16->m_playerGlowColor.value = v5;\n          v17 = v16;\n          v18 = (int)(float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0);\n          v17->m_playerGlowColor.seed = v18;\n          v17->m_playerGlowColor.random = v18 + v5;\n          break;\n        case 0:\n          v10 = GameManager::sharedState();\n          v10->m_playerColor.value = v5;\n          v11 = v10;\n          v12 = (int)(float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0);\n          v11->m_playerColor.seed = v12;\n          v11->m_playerColor.random = v12 + v5;\n          break;\n      }\n      v19 = cocos2d::CCArray::objectAtIndex(a1->m_cursors, a1->m_colorMode);\n      m_buttonMenu = a1->m_buttonMenu;\n      m_mainLayer = a1->m_mainLayer;\n      v22 = v19;\n      v23 = *(void (__fastcall **)(int, cocos2d::CCPoint *))(*(_DWORD *)v19 + 92);\n      v24 = (const cocos2d::CCPoint *)((int (__fastcall *)(cocos2d::CCObject *))a2->__vftable[2].acceptVisitor)(a2);\n      cocos2d::CCNode::convertToWorldSpace(&v25, m_buttonMenu, v24);\n      cocos2d::CCNode::convertToNodeSpace(&v26, m_mainLayer, &v25);\n      v23(v22, &v26);\n      CharacterColorPage::updateIconColors(a1);\n    }\n  }\n}", "assembly": "; \n; CharacterColorPage::onPlayerColor from 0x565548 to 0x5656d0 (392 bytes)\n; \n; 0 xrefs:\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-R10,LR}                                            ; +0x0, 0x565548\nSUB             SP, SP, #0x18                                          ; +0x4, 0x56554c\nLDR             R6, =(__stack_chk_guard_ptr - 0x565558)                ; +0x6, 0x56554e\nMOV             R4, R0                                                 ; +0x8, 0x565550\nMOV             R7, R1                                                 ; +0xa, 0x565552\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xc, 0x565554\nLDR             R6, [R6]; __stack_chk_guard                            ; +0xe, 0x565556\nLDR             R3, [R6]                                               ; +0x10, 0x565558\nSTR             R3, [SP,#0x18+var_4]                                   ; +0x12, 0x56555a\nLDR.W           R3, [R0,#0x1F0]                                        ; +0x14, 0x56555c\nMOV             R0, R1                                                 ; +0x18, 0x565560\nCMP             R3, #0                                                 ; +0x1a, 0x565562\nLDR             R3, [R1]                                               ; +0x1c, 0x565564\nITE EQ                                                                 ; +0x1e, 0x565566\nMOVEQ.W         R8, #2                                                 ; +0x20, 0x565568\nMOVNE.W         R8, #3                                                 ; +0x24, 0x56556c\nLDR             R3, [R3,#0x20]                                         ; +0x28, 0x565570\nBLX             R3                                                     ; +0x2a, 0x565572\nMOV             R2, R8                                                 ; +0x2c, 0x565574\nMOV             R5, R0                                                 ; +0x2e, 0x565576\nMOV             R0, R4                                                 ; +0x30, 0x565578\nMOV             R1, R5                                                 ; +0x32, 0x56557a\nBL              _ZN18CharacterColorPage10checkColorEi10UnlockType; CharacterColorPage::checkColor(int,UnlockType) ; +0x34, 0x56557c\nCMP             R0, #0                                                 ; +0x38, 0x565580\nBEQ.W           loc_5656BE                                             ; +0x3a, 0x565582\nLDR.W           R1, [R4,#0x1F0]; int                                   ; +0x3e, 0x565586\nMOV             R0, R4; this                                           ; +0x42, 0x56558a\nBL              _ZN18CharacterColorPage18activeColorForModeEi; CharacterColorPage::activeColorForMode(int) ; +0x44, 0x56558c\nCMP             R0, R5                                                 ; +0x48, 0x565590\nMOV             R1, R0                                                 ; +0x4a, 0x565592\nBNE             loc_5655AA                                             ; +0x4c, 0x565594\nLDR.W           R0, [R4,#0x20C]                                        ; +0x4e, 0x565596\nCMP             R0, #0                                                 ; +0x52, 0x56559a\nBEQ.W           loc_5656BE                                             ; +0x54, 0x56559c\nLDR             R3, [R0]                                               ; +0x58, 0x5655a0\nMOV             R2, R8                                                 ; +0x5a, 0x5655a2\nLDR             R3, [R3,#4]                                            ; +0x5c, 0x5655a4\nBLX             R3                                                     ; +0x5e, 0x5655a6\nB               loc_5656BE                                             ; +0x60, 0x5655a8\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x62, 0x5655aa\nMOVS            R3, #0                                                 ; +0x66, 0x5655ae\nSTRB.W          R3, [R0,#0x194]                                        ; +0x68, 0x5655b0\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x6c, 0x5655b4\nMOV             R1, R5; int                                            ; +0x70, 0x5655b8\nBL              _ZN11GameManager11colorForIdxEi; GameManager::colorForIdx(int) ; +0x72, 0x5655ba\nUBFX.W          R3, R0, #8, #8                                         ; +0x76, 0x5655be\nSTRB.W          R3, [SP,#0x18+var_17]                                  ; +0x7a, 0x5655c2\nLDR.W           R3, [R4,#0x1F0]                                        ; +0x7e, 0x5655c6\nSTRB.W          R0, [SP,#0x18+var_18]                                  ; +0x82, 0x5655ca\nUBFX.W          R0, R0, #0x10, #8; this                                ; +0x86, 0x5655ce\nCMP             R3, #1                                                 ; +0x8a, 0x5655d2\nSTRB.W          R0, [SP,#0x18+var_16]                                  ; +0x8c, 0x5655d4\nBEQ             loc_565614                                             ; +0x90, 0x5655d8\nCMP             R3, #2                                                 ; +0x92, 0x5655da\nBEQ             loc_565646                                             ; +0x94, 0x5655dc\nCMP             R3, #0                                                 ; +0x96, 0x5655de\nBNE             loc_565676                                             ; +0x98, 0x5655e0\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x9a, 0x5655e2\nSTR.W           R5, [R0,#0x234]                                        ; +0x9e, 0x5655e6\nMOV             R8, R0                                                 ; +0xa2, 0x5655ea\nBLX             rand                                                   ; +0xa4, 0x5655ec\nVLDR            S14, =1000.0                                           ; +0xa8, 0x5655f0\nVMOV            S15, R0                                                ; +0xac, 0x5655f4\nVCVT.F32.S32    S15, S15, #0x1F                                        ; +0xb0, 0x5655f8\nVMUL.F32        S15, S15, S14                                          ; +0xb4, 0x5655fc\nVCVT.S32.F32    S15, S15                                               ; +0xb8, 0x565600\nVMOV            R3, S15                                                ; +0xbc, 0x565604\nVSTR            S15, [R8,#0x230]                                       ; +0xc0, 0x565608\nADD             R3, R5                                                 ; +0xc4, 0x56560c\nSTR.W           R3, [R8,#0x22C]                                        ; +0xc6, 0x56560e\nB               loc_565676                                             ; +0xca, 0x565612\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xcc, 0x565614\nSTR.W           R5, [R0,#0x240]                                        ; +0xd0, 0x565618\nMOV             R8, R0                                                 ; +0xd4, 0x56561c\nBLX             rand                                                   ; +0xd6, 0x56561e\nVLDR            S14, =1000.0                                           ; +0xda, 0x565622\nVMOV            S15, R0                                                ; +0xde, 0x565626\nVCVT.F32.S32    S15, S15, #0x1F                                        ; +0xe2, 0x56562a\nVMUL.F32        S15, S15, S14                                          ; +0xe6, 0x56562e\nVCVT.S32.F32    S15, S15                                               ; +0xea, 0x565632\nVMOV            R3, S15                                                ; +0xee, 0x565636\nVSTR            S15, [R8,#0x23C]                                       ; +0xf2, 0x56563a\nADD             R3, R5                                                 ; +0xf6, 0x56563e\nSTR.W           R3, [R8,#0x238]                                        ; +0xf8, 0x565640\nB               loc_565676                                             ; +0xfc, 0x565644\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xfe, 0x565646\nSTR.W           R5, [R0,#0x24C]                                        ; +0x102, 0x56564a\nMOV             R8, R0                                                 ; +0x106, 0x56564e\nBLX             rand                                                   ; +0x108, 0x565650\nVLDR            S14, =1000.0                                           ; +0x10c, 0x565654\nVMOV            S15, R0                                                ; +0x110, 0x565658\nVCVT.F32.S32    S15, S15, #0x1F                                        ; +0x114, 0x56565c\nVMUL.F32        S15, S15, S14                                          ; +0x118, 0x565660\nVCVT.S32.F32    S15, S15                                               ; +0x11c, 0x565664\nVMOV            R3, S15                                                ; +0x120, 0x565668\nVSTR            S15, [R8,#0x248]                                       ; +0x124, 0x56566c\nADD             R3, R5                                                 ; +0x128, 0x565670\nSTR.W           R3, [R8,#0x244]                                        ; +0x12a, 0x565672\nLDR.W           R1, [R4,#0x1F0]; unsigned int                          ; +0x12e, 0x565676\nLDR.W           R0, [R4,#0x208]; this                                  ; +0x132, 0x56567a\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x136, 0x56567e\nLDR.W           R5, [R4,#0x1B8]                                        ; +0x13a, 0x565682\nLDR.W           R10, [R4,#0x1C8]                                       ; +0x13e, 0x565686\nLDR             R3, [R0]                                               ; +0x142, 0x56568a\nMOV             R8, R0                                                 ; +0x144, 0x56568c\nMOV             R0, R7                                                 ; +0x146, 0x56568e\nLDR.W           R9, [R3,#0x5C]                                         ; +0x148, 0x565690\nLDR             R3, [R7]                                               ; +0x14c, 0x565694\nADD             R7, SP, #0x18+var_14                                   ; +0x14e, 0x565696\nLDR             R3, [R3,#0x60]                                         ; +0x150, 0x565698\nBLX             R3                                                     ; +0x152, 0x56569a\nMOV             R1, R5; cocos2d::CCPoint *                             ; +0x154, 0x56569c\nADD             R5, SP, #0x18+var_C                                    ; +0x156, 0x56569e\nMOV             R2, R0                                                 ; +0x158, 0x5656a0\nMOV             R0, R7; this                                           ; +0x15a, 0x5656a2\nBL              _ZN7cocos2d6CCNode19convertToWorldSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToWorldSpace(cocos2d::CCPoint const&) ; +0x15c, 0x5656a4\nMOV             R0, R5; this                                           ; +0x160, 0x5656a8\nMOV             R1, R10; cocos2d::CCPoint *                            ; +0x162, 0x5656aa\nMOV             R2, R7                                                 ; +0x164, 0x5656ac\nBL              _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0x166, 0x5656ae\nMOV             R0, R8                                                 ; +0x16a, 0x5656b2\nMOV             R1, R5                                                 ; +0x16c, 0x5656b4\nBLX             R9                                                     ; +0x16e, 0x5656b6\nMOV             R0, R4; this                                           ; +0x170, 0x5656b8\nBL              _ZN18CharacterColorPage16updateIconColorsEv; CharacterColorPage::updateIconColors(void) ; +0x172, 0x5656ba\nLDR             R2, [SP,#0x18+var_4]                                   ; +0x176, 0x5656be\nLDR             R3, [R6]                                               ; +0x178, 0x5656c0\nCMP             R2, R3                                                 ; +0x17a, 0x5656c2\nBEQ             loc_5656CA                                             ; +0x17c, 0x5656c4\nBLX             __stack_chk_fail                                       ; +0x17e, 0x5656c6\nADD             SP, SP, #0x18                                          ; +0x182, 0x5656ca\nPOP.W           {R4-R10,PC}                                            ; +0x184, 0x5656cc", "xrefs": [], "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"}