{"type": "func", "start": 5369302336, "end": 5369302558, "name": "ColorSelectPopup::onPlayerColor2", "pseudocode": "// \n// ColorSelectPopup::onPlayerColor2 from 0x140090d40 to 0x140090e1e (222 bytes)\n// \n// 2 xrefs:\n// > ColorSelectPopup::init @ 0x14008ead8\n// > <???> @ 0x1406c6f90\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 ColorSelectPopup::onPlayerColor2(ColorSelectPopup *a1, cocos2d::CCObject *a2)\n{\n  int m_playerColor; // eax\n  unsigned int v4; // edi\n  int v5; // edx\n  EffectGameObject *m_gameObject; // rcx\n  cocos2d::CCArray *m_gameObjects; // rcx\n  struct cocos2d::CCObject *v8; // rax\n  ColorAction *m_colorAction; // rax\n\n  CCMenuItemToggler::toggle(a1->m_playerColor1Toggle, 0);\n  m_playerColor = a1->m_playerColor;\n  v4 = 0;\n  v5 = 0;\n  if ( m_playerColor != 2 )\n    v5 = 2;\n  m_gameObject = a1->m_gameObject;\n  a1->m_playerColor = v5;\n  if ( m_gameObject )\n  {\n    m_gameObject->m_usesPlayerColor2 = m_playerColor != 2;\n    a1->m_gameObject->m_usesPlayerColor1 = 0;\n  }\n  else\n  {\n    m_gameObjects = a1->m_gameObjects;\n    if ( m_gameObjects )\n    {\n      if ( cocos2d::CCArray::count(m_gameObjects) )\n      {\n        do\n        {\n          v8 = cocos2d::CCArray::objectAtIndex(a1->m_gameObjects, v4++);\n          BYTE2(v8[26].m_nZOrder) = a1->m_playerColor == 2;\n          BYTE1(v8[26].m_nZOrder) = 0;\n        }\n        while ( v4 < cocos2d::CCArray::count(a1->m_gameObjects) );\n      }\n    }\n    else\n    {\n      m_colorAction = a1->m_colorAction;\n      if ( m_colorAction )\n        m_colorAction->m_playerColor = v5;\n    }\n  }\n}", "assembly": "; \n; ColorSelectPopup::onPlayerColor2 from 0x140090d40 to 0x140090e1e (222 bytes)\n; \n; 2 xrefs:\n; > ColorSelectPopup::init @ 0x14008ead8\n; > <???> @ 0x1406c6f90\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\nmov     [rsp+arg_0], rbx                                               ; +0x0, 0x140090d40\npush    rdi                                                            ; +0x5, 0x140090d45\nsub     rsp, 20h                                                       ; +0x6, 0x140090d46\nmov     rbx, rcx                                                       ; +0xa, 0x140090d4a\nxor     edx, edx                                                       ; +0xd, 0x140090d4d\nmov     rcx, [rcx+3E0h]                                                ; +0xf, 0x140090d4f\ncall    CCMenuItemToggler__toggle                                      ; +0x16, 0x140090d56\nmov     eax, [rbx+41Ch]                                                ; +0x1b, 0x140090d5b\nmov     ecx, 2                                                         ; +0x21, 0x140090d61\nxor     edi, edi                                                       ; +0x26, 0x140090d66\ncmp     eax, ecx                                                       ; +0x28, 0x140090d68\nmov     edx, edi                                                       ; +0x2a, 0x140090d6a\ncmovnz  edx, ecx                                                       ; +0x2c, 0x140090d6c\nmov     rcx, [rbx+290h]                                                ; +0x2f, 0x140090d6f\nmov     [rbx+41Ch], edx                                                ; +0x36, 0x140090d76\ntest    rcx, rcx                                                       ; +0x3c, 0x140090d7c\njz      short loc_140090DA6                                            ; +0x3f, 0x140090d7f\ncmp     eax, 2                                                         ; +0x41, 0x140090d81\nsetnz   al                                                             ; +0x44, 0x140090d84\nmov     [rcx+5DEh], al                                                 ; +0x47, 0x140090d87\nmov     rax, [rbx+290h]                                                ; +0x4d, 0x140090d8d\nmov     [rax+5DDh], dil                                                ; +0x54, 0x140090d94\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x5b, 0x140090d9b\nadd     rsp, 20h                                                       ; +0x60, 0x140090da0\npop     rdi                                                            ; +0x64, 0x140090da4\nretn                                                                   ; +0x65, 0x140090da5\nmov     rcx, [rbx+298h]                                                ; +0x66, 0x140090da6\ntest    rcx, rcx                                                       ; +0x6d, 0x140090dad\njz      short loc_140090E04                                            ; +0x70, 0x140090db0\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x72, 0x140090db2\ntest    eax, eax                                                       ; +0x78, 0x140090db8\njz      short loc_140090E13                                            ; +0x7a, 0x140090dba\nnop     dword ptr [rax+00h]                                            ; +0x7c, 0x140090dbc\nmov     rcx, [rbx+298h]                                                ; +0x80, 0x140090dc0\nmov     edx, edi                                                       ; +0x87, 0x140090dc7\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0x89, 0x140090dc9\ncmp     dword ptr [rbx+41Ch], 2                                        ; +0x8f, 0x140090dcf\nsetz    cl                                                             ; +0x96, 0x140090dd6\ninc     edi                                                            ; +0x99, 0x140090dd9\nmov     [rax+5DEh], cl                                                 ; +0x9b, 0x140090ddb\nmov     byte ptr [rax+5DDh], 0                                         ; +0xa1, 0x140090de1\nmov     rcx, [rbx+298h]                                                ; +0xa8, 0x140090de8\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xaf, 0x140090def\ncmp     edi, eax                                                       ; +0xb5, 0x140090df5\njb      short loc_140090DC0                                            ; +0xb7, 0x140090df7\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xb9, 0x140090df9\nadd     rsp, 20h                                                       ; +0xbe, 0x140090dfe\npop     rdi                                                            ; +0xc2, 0x140090e02\nretn                                                                   ; +0xc3, 0x140090e03\nmov     rax, [rbx+428h]                                                ; +0xc4, 0x140090e04\ntest    rax, rax                                                       ; +0xcb, 0x140090e0b\njz      short loc_140090E13                                            ; +0xce, 0x140090e0e\nmov     [rax+58h], edx                                                 ; +0xd0, 0x140090e10\nmov     rbx, [rsp+28h+arg_0]                                           ; +0xd3, 0x140090e13\nadd     rsp, 20h                                                       ; +0xd8, 0x140090e18\npop     rdi                                                            ; +0xdc, 0x140090e1c\nretn                                                                   ; +0xdd, 0x140090e1d", "xrefs": ["ColorSelectPopup::init @ 0x14008ead8", "<???> @ 0x1406c6f90"], "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"}