{"type": "func", "start": 6935068, "end": 6935460, "name": "CharacterColorPage::onPlayerColor", "pseudocode": "// \n// CharacterColorPage::onPlayerColor from 0x69d21c to 0x69d3a4 (392 bytes)\n// \n// 0 xrefs:\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n// \n// Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n// Generated at Fri, 27 Nov 2026 11:56:20 +0000\n// \n\nunsigned int __fastcall CharacterColorPage::onPlayerColor(CharacterColorPage *this, cocos2d::CCObject *a2)\n{\n  int v4; // r8\n  int v5; // r5\n  unsigned int result; // r0\n  GameManager *active; // r0\n  GameManager *v8; // r1\n  GameManager *v9; // r0\n  GameManager *v10; // r0\n  int v11; // r0\n  int v12; // r3\n  GameManager *v13; // r0\n  int v14; // r0\n  int v15; // r8\n  int v16; // s15\n  int v17; // r0\n  int v18; // r8\n  int v19; // s15\n  int v20; // r0\n  int v21; // r8\n  int v22; // s15\n  int v23; // r0\n  const cocos2d::CCPoint *v24; // r5\n  const cocos2d::CCPoint *v25; // r10\n  int v26; // r8\n  void (__fastcall *v27)(int, _BYTE *); // r9\n  _BYTE v28[8]; // [sp+4h] [bp-14h] BYREF\n  _BYTE v29[8]; // [sp+Ch] [bp-Ch] BYREF\n\n  if ( *((_DWORD *)this + 130) )\n    v4 = 3;\n  else\n    v4 = 2;\n  v5 = (*(int (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)a2 + 32))(a2);\n  result = CharacterColorPage::checkColor(this, v5, v4);\n  if ( result )\n  {\n    active = (GameManager *)CharacterColorPage::activeColorForMode(this, *((_DWORD *)this + 130));\n    v8 = active;\n    if ( active == (GameManager *)v5 )\n    {\n      result = *((_DWORD *)this + 137);\n      if ( result )\n        return (*(int (__fastcall **)(unsigned int, GameManager *, int))(*(_DWORD *)result + 4))(result, v8, v4);\n    }\n    else\n    {\n      v9 = (GameManager *)GameManager::sharedState(active);\n      *((_BYTE *)v9 + 460) = 0;\n      v10 = (GameManager *)GameManager::sharedState(v9);\n      v11 = GameManager::colorForIdx(v10, v5);\n      v12 = *((_DWORD *)this + 130);\n      v13 = (GameManager *)BYTE2(v11);\n      switch ( v12 )\n      {\n        case 1:\n          v17 = GameManager::sharedState(v13);\n          *(_DWORD *)(v17 + 632) = v5;\n          v18 = v17;\n          v19 = (int)(float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0);\n          *(_DWORD *)(v18 + 628) = v19;\n          *(_DWORD *)(v18 + 624) = v19 + v5;\n          break;\n        case 2:\n          v20 = GameManager::sharedState(v13);\n          *(_DWORD *)(v20 + 644) = v5;\n          v21 = v20;\n          v22 = (int)(float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0);\n          *(_DWORD *)(v21 + 640) = v22;\n          *(_DWORD *)(v21 + 636) = v22 + v5;\n          break;\n        case 0:\n          v14 = GameManager::sharedState(v13);\n          *(_DWORD *)(v14 + 620) = v5;\n          v15 = v14;\n          v16 = (int)(float)(vcvts_n_f32_s32(rand(), 0x1Fu) * 1000.0);\n          *(_DWORD *)(v15 + 616) = v16;\n          *(_DWORD *)(v15 + 612) = v16 + v5;\n          break;\n      }\n      v23 = cocos2d::CCArray::objectAtIndex(*((cocos2d::CCArray **)this + 136), *((_DWORD *)this + 130));\n      v24 = *((const cocos2d::CCPoint **)this + 111);\n      v25 = *((const cocos2d::CCPoint **)this + 115);\n      v26 = v23;\n      v27 = *(void (__fastcall **)(int, _BYTE *))(*(_DWORD *)v23 + 92);\n      (*(void (__fastcall **)(cocos2d::CCObject *))(*(_DWORD *)a2 + 96))(a2);\n      cocos2d::CCNode::convertToWorldSpace((cocos2d::CCNode *)v28, v24);\n      cocos2d::CCNode::convertToNodeSpace((cocos2d::CCNode *)v29, v25);\n      v27(v26, v29);\n      return CharacterColorPage::updateIconColors((cocos2d::CCArray **)this);\n    }\n  }\n  return result;\n}", "assembly": "; \n; CharacterColorPage::onPlayerColor from 0x69d21c to 0x69d3a4 (392 bytes)\n; \n; 0 xrefs:\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\n; \n; Using BromaIDA 8.3.0 @ https://github.com/Stazzical/BromaIDA\n; Using bindings at commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings\n; Generated at Fri, 27 Nov 2026 11:56:20 +0000\n; \nPUSH.W          {R4-R10,LR}                                            ; +0x0, 0x69d21c\nSUB             SP, SP, #0x18                                          ; +0x4, 0x69d220\nLDR             R6, =(__stack_chk_guard_ptr - 0x69D22C)                ; +0x6, 0x69d222\nMOV             R4, R0                                                 ; +0x8, 0x69d224\nMOV             R7, R1                                                 ; +0xa, 0x69d226\nADD             R6, PC; __stack_chk_guard_ptr                          ; +0xc, 0x69d228\nLDR             R6, [R6]; __stack_chk_guard                            ; +0xe, 0x69d22a\nLDR             R3, [R6]                                               ; +0x10, 0x69d22c\nSTR             R3, [SP,#0x18+var_4]                                   ; +0x12, 0x69d22e\nLDR.W           R3, [R0,#0x208]                                        ; +0x14, 0x69d230\nMOV             R0, R1                                                 ; +0x18, 0x69d234\nCMP             R3, #0                                                 ; +0x1a, 0x69d236\nLDR             R3, [R1]                                               ; +0x1c, 0x69d238\nITE EQ                                                                 ; +0x1e, 0x69d23a\nMOVEQ.W         R8, #2                                                 ; +0x20, 0x69d23c\nMOVNE.W         R8, #3                                                 ; +0x24, 0x69d240\nLDR             R3, [R3,#0x20]                                         ; +0x28, 0x69d244\nBLX             R3                                                     ; +0x2a, 0x69d246\nMOV             R2, R8                                                 ; +0x2c, 0x69d248\nMOV             R5, R0                                                 ; +0x2e, 0x69d24a\nMOV             R0, R4                                                 ; +0x30, 0x69d24c\nMOV             R1, R5                                                 ; +0x32, 0x69d24e\nBL              _ZN18CharacterColorPage10checkColorEi10UnlockType; CharacterColorPage::checkColor(int,UnlockType) ; +0x34, 0x69d250\nCMP             R0, #0                                                 ; +0x38, 0x69d254\nBEQ.W           loc_69D392                                             ; +0x3a, 0x69d256\nLDR.W           R1, [R4,#0x208]; int                                   ; +0x3e, 0x69d25a\nMOV             R0, R4; this                                           ; +0x42, 0x69d25e\nBL              _ZN18CharacterColorPage18activeColorForModeEi; CharacterColorPage::activeColorForMode(int) ; +0x44, 0x69d260\nCMP             R0, R5                                                 ; +0x48, 0x69d264\nMOV             R1, R0                                                 ; +0x4a, 0x69d266\nBNE             loc_69D27E                                             ; +0x4c, 0x69d268\nLDR.W           R0, [R4,#0x224]                                        ; +0x4e, 0x69d26a\nCMP             R0, #0                                                 ; +0x52, 0x69d26e\nBEQ.W           loc_69D392                                             ; +0x54, 0x69d270\nLDR             R3, [R0]                                               ; +0x58, 0x69d274\nMOV             R2, R8                                                 ; +0x5a, 0x69d276\nLDR             R3, [R3,#4]                                            ; +0x5c, 0x69d278\nBLX             R3                                                     ; +0x5e, 0x69d27a\nB               loc_69D392                                             ; +0x60, 0x69d27c\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x62, 0x69d27e\nMOVS            R3, #0                                                 ; +0x66, 0x69d282\nSTRB.W          R3, [R0,#0x1CC]                                        ; +0x68, 0x69d284\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x6c, 0x69d288\nMOV             R1, R5; int                                            ; +0x70, 0x69d28c\nBL              _ZN11GameManager11colorForIdxEi; GameManager::colorForIdx(int) ; +0x72, 0x69d28e\nUBFX.W          R3, R0, #8, #8                                         ; +0x76, 0x69d292\nSTRB.W          R3, [SP,#0x18+var_17]                                  ; +0x7a, 0x69d296\nLDR.W           R3, [R4,#0x208]                                        ; +0x7e, 0x69d29a\nSTRB.W          R0, [SP,#0x18+var_18]                                  ; +0x82, 0x69d29e\nUBFX.W          R0, R0, #0x10, #8; this                                ; +0x86, 0x69d2a2\nCMP             R3, #1                                                 ; +0x8a, 0x69d2a6\nSTRB.W          R0, [SP,#0x18+var_16]                                  ; +0x8c, 0x69d2a8\nBEQ             loc_69D2E8                                             ; +0x90, 0x69d2ac\nCMP             R3, #2                                                 ; +0x92, 0x69d2ae\nBEQ             loc_69D31A                                             ; +0x94, 0x69d2b0\nCMP             R3, #0                                                 ; +0x96, 0x69d2b2\nBNE             loc_69D34A                                             ; +0x98, 0x69d2b4\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x9a, 0x69d2b6\nSTR.W           R5, [R0,#0x26C]                                        ; +0x9e, 0x69d2ba\nMOV             R8, R0                                                 ; +0xa2, 0x69d2be\nBLX             rand                                                   ; +0xa4, 0x69d2c0\nVLDR            S14, =1000.0                                           ; +0xa8, 0x69d2c4\nVMOV            S15, R0                                                ; +0xac, 0x69d2c8\nVCVT.F32.S32    S15, S15, #0x1F                                        ; +0xb0, 0x69d2cc\nVMUL.F32        S15, S15, S14                                          ; +0xb4, 0x69d2d0\nVCVT.S32.F32    S15, S15                                               ; +0xb8, 0x69d2d4\nVMOV            R3, S15                                                ; +0xbc, 0x69d2d8\nVSTR            S15, [R8,#0x268]                                       ; +0xc0, 0x69d2dc\nADD             R3, R5                                                 ; +0xc4, 0x69d2e0\nSTR.W           R3, [R8,#0x264]                                        ; +0xc6, 0x69d2e2\nB               loc_69D34A                                             ; +0xca, 0x69d2e6\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xcc, 0x69d2e8\nSTR.W           R5, [R0,#0x278]                                        ; +0xd0, 0x69d2ec\nMOV             R8, R0                                                 ; +0xd4, 0x69d2f0\nBLX             rand                                                   ; +0xd6, 0x69d2f2\nVLDR            S14, =1000.0                                           ; +0xda, 0x69d2f6\nVMOV            S15, R0                                                ; +0xde, 0x69d2fa\nVCVT.F32.S32    S15, S15, #0x1F                                        ; +0xe2, 0x69d2fe\nVMUL.F32        S15, S15, S14                                          ; +0xe6, 0x69d302\nVCVT.S32.F32    S15, S15                                               ; +0xea, 0x69d306\nVMOV            R3, S15                                                ; +0xee, 0x69d30a\nVSTR            S15, [R8,#0x274]                                       ; +0xf2, 0x69d30e\nADD             R3, R5                                                 ; +0xf6, 0x69d312\nSTR.W           R3, [R8,#0x270]                                        ; +0xf8, 0x69d314\nB               loc_69D34A                                             ; +0xfc, 0x69d318\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xfe, 0x69d31a\nSTR.W           R5, [R0,#0x284]                                        ; +0x102, 0x69d31e\nMOV             R8, R0                                                 ; +0x106, 0x69d322\nBLX             rand                                                   ; +0x108, 0x69d324\nVLDR            S14, =1000.0                                           ; +0x10c, 0x69d328\nVMOV            S15, R0                                                ; +0x110, 0x69d32c\nVCVT.F32.S32    S15, S15, #0x1F                                        ; +0x114, 0x69d330\nVMUL.F32        S15, S15, S14                                          ; +0x118, 0x69d334\nVCVT.S32.F32    S15, S15                                               ; +0x11c, 0x69d338\nVMOV            R3, S15                                                ; +0x120, 0x69d33c\nVSTR            S15, [R8,#0x280]                                       ; +0x124, 0x69d340\nADD             R3, R5                                                 ; +0x128, 0x69d344\nSTR.W           R3, [R8,#0x27C]                                        ; +0x12a, 0x69d346\nLDR.W           R1, [R4,#0x208]; unsigned int                          ; +0x12e, 0x69d34a\nLDR.W           R0, [R4,#0x220]; this                                  ; +0x132, 0x69d34e\nBL              _ZN7cocos2d7CCArray13objectAtIndexEj; cocos2d::CCArray::objectAtIndex(uint) ; +0x136, 0x69d352\nLDR.W           R5, [R4,#0x1BC]                                        ; +0x13a, 0x69d356\nLDR.W           R10, [R4,#0x1CC]                                       ; +0x13e, 0x69d35a\nLDR             R3, [R0]                                               ; +0x142, 0x69d35e\nMOV             R8, R0                                                 ; +0x144, 0x69d360\nMOV             R0, R7                                                 ; +0x146, 0x69d362\nLDR.W           R9, [R3,#0x5C]                                         ; +0x148, 0x69d364\nLDR             R3, [R7]                                               ; +0x14c, 0x69d368\nADD             R7, SP, #0x18+var_14                                   ; +0x14e, 0x69d36a\nLDR             R3, [R3,#0x60]                                         ; +0x150, 0x69d36c\nBLX             R3                                                     ; +0x152, 0x69d36e\nMOV             R1, R5; cocos2d::CCPoint *                             ; +0x154, 0x69d370\nADD             R5, SP, #0x18+var_C                                    ; +0x156, 0x69d372\nMOV             R2, R0                                                 ; +0x158, 0x69d374\nMOV             R0, R7; this                                           ; +0x15a, 0x69d376\nBL              _ZN7cocos2d6CCNode19convertToWorldSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToWorldSpace(cocos2d::CCPoint const&) ; +0x15c, 0x69d378\nMOV             R0, R5; this                                           ; +0x160, 0x69d37c\nMOV             R1, R10; cocos2d::CCPoint *                            ; +0x162, 0x69d37e\nMOV             R2, R7                                                 ; +0x164, 0x69d380\nBL              _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0x166, 0x69d382\nMOV             R0, R8                                                 ; +0x16a, 0x69d386\nMOV             R1, R5                                                 ; +0x16c, 0x69d388\nBLX             R9                                                     ; +0x16e, 0x69d38a\nMOV             R0, R4; this                                           ; +0x170, 0x69d38c\nBL              _ZN18CharacterColorPage16updateIconColorsEv; CharacterColorPage::updateIconColors(void) ; +0x172, 0x69d38e\nLDR             R2, [SP,#0x18+var_4]                                   ; +0x176, 0x69d392\nLDR             R3, [R6]                                               ; +0x178, 0x69d394\nCMP             R2, R3                                                 ; +0x17a, 0x69d396\nBEQ             loc_69D39E                                             ; +0x17c, 0x69d398\nBLX             __stack_chk_fail                                       ; +0x17e, 0x69d39a\nADD             SP, SP, #0x18                                          ; +0x182, 0x69d39e\nPOP.W           {R4-R10,PC}                                            ; +0x184, 0x69d3a0", "xrefs": [], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "bida_info": "8.3.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit 1c6ec395 at Thu Nov 26 21:29:22 2026 from https://github.com/geode-sdk/bindings"}