{"type": "func", "start": 5369404784, "end": 5369405141, "name": "CustomizeObjectLayer::updateSelected", "pseudocode": "// \n// CustomizeObjectLayer::updateSelected from 0x1400a9d70 to 0x1400a9ed5 (357 bytes)\n// \n// 8 xrefs:\n// > CustomizeObjectLayer::colorSetupClosed @ 0x1400a83c0\n// > CustomizeObjectLayer::onNextColorChannel @ 0x1400a8f6e\n// > CustomizeObjectLayer::onUpdateCustomColor @ 0x1400a960a\n// > CustomizeObjectLayer::textChanged @ 0x1400a9925\n// > CustomizeObjectLayer::onSelectColor @ 0x1400a9cdb\n// > <???> @ 0x14066abe0\n// > <???> @ 0x14066abf0\n// > <???> @ 0x1406c78a8\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 CustomizeObjectLayer::updateSelected(CustomizeObjectLayer *a1, int a2)\n{\n  GameObject *m_targetObject; // rcx\n  GJSpriteColor *RelativeSpriteColor; // rax\n  GJSpriteColor *v6; // rcx\n  int v7; // ebx\n  int m_defaultColorID; // eax\n  cocos2d::CCArray *m_targetObjects; // rcx\n  unsigned int v10; // ebp\n  GameObject *v11; // rax\n  GJSpriteColor *v12; // rax\n  __int64 v13; // r10\n  GJSpriteColor *v14; // r9\n  int v15; // ecx\n  int v16; // eax\n\n  m_targetObject = a1->m_targetObject;\n  if ( m_targetObject )\n  {\n    RelativeSpriteColor = GameObject::getRelativeSpriteColor(m_targetObject, a1->m_selectedMode);\n    v6 = RelativeSpriteColor;\n    if ( RelativeSpriteColor )\n    {\n      v7 = 1101;\n      if ( a2 )\n      {\n        if ( a2 < 0 )\n          a2 = 0;\n        if ( a2 <= 1101 )\n          v7 = a2;\n      }\n      else\n      {\n        m_defaultColorID = RelativeSpriteColor->m_defaultColorID;\n        if ( m_defaultColorID < 0 )\n          m_defaultColorID = 0;\n        if ( m_defaultColorID <= 1101 )\n          v7 = m_defaultColorID;\n        v6->m_defaultColorID = v7;\n        v7 = 0;\n      }\n      v6->m_colorID = v7;\n      a1->m_targetObject->m_updateParents = 1;\n    }\n  }\n  else\n  {\n    m_targetObjects = a1->m_targetObjects;\n    if ( m_targetObjects )\n    {\n      v10 = 0;\n      if ( cocos2d::CCArray::count(m_targetObjects) )\n      {\n        do\n        {\n          v11 = (GameObject *)cocos2d::CCArray::objectAtIndex(a1->m_targetObjects, v10);\n          v12 = GameObject::getRelativeSpriteColor(v11, a1->m_selectedMode);\n          v14 = v12;\n          if ( v12 )\n          {\n            if ( a2 )\n            {\n              v15 = a2;\n              if ( a2 < 0 )\n                v15 = 0;\n              if ( v15 <= 1101 )\n              {\n                if ( v15 < 0 )\n                  v15 = 1011;\n              }\n              else\n              {\n                v15 = 1101;\n              }\n            }\n            else\n            {\n              v16 = v12->m_defaultColorID;\n              if ( v16 < 0 )\n                v16 = 0;\n              if ( v16 > 1101 )\n                v16 = 1101;\n              v14->m_defaultColorID = v16;\n              v15 = 0;\n            }\n            v14->m_colorID = v15;\n            *(_BYTE *)(v13 + 1156) = 1;\n          }\n          ++v10;\n        }\n        while ( v10 < cocos2d::CCArray::count(a1->m_targetObjects) );\n      }\n    }\n  }\n}", "assembly": "; \n; CustomizeObjectLayer::updateSelected from 0x1400a9d70 to 0x1400a9ed5 (357 bytes)\n; \n; 8 xrefs:\n; > CustomizeObjectLayer::colorSetupClosed @ 0x1400a83c0\n; > CustomizeObjectLayer::onNextColorChannel @ 0x1400a8f6e\n; > CustomizeObjectLayer::onUpdateCustomColor @ 0x1400a960a\n; > CustomizeObjectLayer::textChanged @ 0x1400a9925\n; > CustomizeObjectLayer::onSelectColor @ 0x1400a9cdb\n; > <???> @ 0x14066abe0\n; > <???> @ 0x14066abf0\n; > <???> @ 0x1406c78a8\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_8], rbx                                               ; +0x0, 0x1400a9d70\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x1400a9d75\npush    rdi                                                            ; +0xa, 0x1400a9d7a\npush    r14                                                            ; +0xb, 0x1400a9d7b\npush    r15                                                            ; +0xd, 0x1400a9d7d\nsub     rsp, 20h                                                       ; +0xf, 0x1400a9d7f\nmov     r14, rcx                                                       ; +0x13, 0x1400a9d83\nmov     edi, edx                                                       ; +0x16, 0x1400a9d86\nmov     rcx, [rcx+298h]                                                ; +0x18, 0x1400a9d88\ntest    rcx, rcx                                                       ; +0x1f, 0x1400a9d8f\njz      short loc_1400A9E02                                            ; +0x22, 0x1400a9d92\nmov     edx, [r14+2D0h]                                                ; +0x24, 0x1400a9d94\ncall    GameObject__getRelativeSpriteColor                             ; +0x2b, 0x1400a9d9b\nmov     rcx, rax                                                       ; +0x30, 0x1400a9da0\ntest    rax, rax                                                       ; +0x33, 0x1400a9da3\njz      loc_1400A9EC1                                                  ; +0x36, 0x1400a9da6\nxor     esi, esi                                                       ; +0x3c, 0x1400a9dac\nmov     ebx, 44Dh                                                      ; +0x3e, 0x1400a9dae\ntest    edi, edi                                                       ; +0x43, 0x1400a9db3\njz      short loc_1400A9DCE                                            ; +0x45, 0x1400a9db5\ncmovs   edi, esi                                                       ; +0x47, 0x1400a9db7\ncmp     edi, ebx                                                       ; +0x4a, 0x1400a9dba\njg      short loc_1400A9DED                                            ; +0x4c, 0x1400a9dbc\ntest    edi, edi                                                       ; +0x4e, 0x1400a9dbe\nmov     ebx, edi                                                       ; +0x50, 0x1400a9dc0\nmov     r15d, 3F3h                                                     ; +0x52, 0x1400a9dc2\ncmovs   ebx, r15d                                                      ; +0x58, 0x1400a9dc8\njmp     short loc_1400A9DED                                            ; +0x5c, 0x1400a9dcc\nmov     eax, [rax+4]                                                   ; +0x5e, 0x1400a9dce\ntest    eax, eax                                                       ; +0x61, 0x1400a9dd1\ncmovs   eax, esi                                                       ; +0x63, 0x1400a9dd3\ncmp     eax, ebx                                                       ; +0x66, 0x1400a9dd6\njg      short loc_1400A9DE8                                            ; +0x68, 0x1400a9dd8\ntest    eax, eax                                                       ; +0x6a, 0x1400a9dda\nmov     ebx, eax                                                       ; +0x6c, 0x1400a9ddc\nmov     r15d, 3F3h                                                     ; +0x6e, 0x1400a9dde\ncmovs   ebx, r15d                                                      ; +0x74, 0x1400a9de4\nmov     [rcx+4], ebx                                                   ; +0x78, 0x1400a9de8\nmov     ebx, esi                                                       ; +0x7b, 0x1400a9deb\nmov     [rcx], ebx                                                     ; +0x7d, 0x1400a9ded\nmov     rax, [r14+298h]                                                ; +0x7f, 0x1400a9def\nmov     byte ptr [rax+484h], 1                                         ; +0x86, 0x1400a9df6\njmp     loc_1400A9EC1                                                  ; +0x8d, 0x1400a9dfd\nmov     rcx, [r14+2A0h]                                                ; +0x92, 0x1400a9e02\ntest    rcx, rcx                                                       ; +0x99, 0x1400a9e09\njz      loc_1400A9EC1                                                  ; +0x9c, 0x1400a9e0c\nxor     esi, esi                                                       ; +0xa2, 0x1400a9e12\nmov     [rsp+38h+arg_0], rbp                                           ; +0xa4, 0x1400a9e14\nmov     ebp, esi                                                       ; +0xa9, 0x1400a9e19\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xab, 0x1400a9e1b\ntest    eax, eax                                                       ; +0xb1, 0x1400a9e21\njz      loc_1400A9EBC                                                  ; +0xb3, 0x1400a9e23\nmov     ebx, 44Dh                                                      ; +0xb9, 0x1400a9e29\nlea     r15d, [rbx-5Ah]                                                ; +0xbe, 0x1400a9e2e\nnop     dword ptr [rax+00h]                                            ; +0xc2, 0x1400a9e32\nnop     word ptr [rax+rax+00000000h]                                   ; +0xc6, 0x1400a9e36\nmov     rcx, [r14+2A0h]                                                ; +0xd0, 0x1400a9e40\nmov     edx, ebp                                                       ; +0xd7, 0x1400a9e47\ncall    cs:?objectAtIndex@CCArray@cocos2d@@QEAAPEAVCCObject@2@I@Z; cocos2d::CCArray::objectAtIndex(uint) ; +0xd9, 0x1400a9e49\nmov     edx, [r14+2D0h]                                                ; +0xdf, 0x1400a9e4f\nmov     rcx, rax                                                       ; +0xe6, 0x1400a9e56\nmov     r10, rax                                                       ; +0xe9, 0x1400a9e59\ncall    GameObject__getRelativeSpriteColor                             ; +0xec, 0x1400a9e5c\nmov     r9, rax                                                        ; +0xf1, 0x1400a9e61\ntest    rax, rax                                                       ; +0xf4, 0x1400a9e64\njz      short loc_1400A9EA9                                            ; +0xf7, 0x1400a9e67\ntest    edi, edi                                                       ; +0xf9, 0x1400a9e69\njz      short loc_1400A9E82                                            ; +0xfb, 0x1400a9e6b\nmov     ecx, edi                                                       ; +0xfd, 0x1400a9e6d\ncmovs   ecx, esi                                                       ; +0xff, 0x1400a9e6f\ncmp     ecx, ebx                                                       ; +0x102, 0x1400a9e72\njle     short loc_1400A9E7A                                            ; +0x104, 0x1400a9e74\nmov     ecx, ebx                                                       ; +0x106, 0x1400a9e76\njmp     short loc_1400A9E9E                                            ; +0x108, 0x1400a9e78\ntest    ecx, ecx                                                       ; +0x10a, 0x1400a9e7a\ncmovs   ecx, r15d                                                      ; +0x10c, 0x1400a9e7c\njmp     short loc_1400A9E9E                                            ; +0x110, 0x1400a9e80\nmov     eax, [rax+4]                                                   ; +0x112, 0x1400a9e82\ntest    eax, eax                                                       ; +0x115, 0x1400a9e85\ncmovs   eax, esi                                                       ; +0x117, 0x1400a9e87\ncmp     eax, ebx                                                       ; +0x11a, 0x1400a9e8a\njle     short loc_1400A9E92                                            ; +0x11c, 0x1400a9e8c\nmov     eax, ebx                                                       ; +0x11e, 0x1400a9e8e\njmp     short loc_1400A9E98                                            ; +0x120, 0x1400a9e90\ntest    eax, eax                                                       ; +0x122, 0x1400a9e92\ncmovs   eax, r15d                                                      ; +0x124, 0x1400a9e94\nmov     [r9+4], eax                                                    ; +0x128, 0x1400a9e98\nmov     ecx, esi                                                       ; +0x12c, 0x1400a9e9c\nmov     [r9], ecx                                                      ; +0x12e, 0x1400a9e9e\nmov     byte ptr [r10+484h], 1                                         ; +0x131, 0x1400a9ea1\nmov     rcx, [r14+2A0h]                                                ; +0x139, 0x1400a9ea9\ninc     ebp                                                            ; +0x140, 0x1400a9eb0\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x142, 0x1400a9eb2\ncmp     ebp, eax                                                       ; +0x148, 0x1400a9eb8\njb      short loc_1400A9E40                                            ; +0x14a, 0x1400a9eba\nmov     rbp, [rsp+38h+arg_0]                                           ; +0x14c, 0x1400a9ebc\nmov     rbx, [rsp+38h+arg_8]                                           ; +0x151, 0x1400a9ec1\nmov     rsi, [rsp+38h+arg_10]                                          ; +0x156, 0x1400a9ec6\nadd     rsp, 20h                                                       ; +0x15b, 0x1400a9ecb\npop     r15                                                            ; +0x15f, 0x1400a9ecf\npop     r14                                                            ; +0x161, 0x1400a9ed1\npop     rdi                                                            ; +0x163, 0x1400a9ed3\nretn                                                                   ; +0x164, 0x1400a9ed4", "xrefs": ["CustomizeObjectLayer::colorSetupClosed @ 0x1400a83c0", "CustomizeObjectLayer::onNextColorChannel @ 0x1400a8f6e", "CustomizeObjectLayer::onUpdateCustomColor @ 0x1400a960a", "CustomizeObjectLayer::textChanged @ 0x1400a9925", "CustomizeObjectLayer::onSelectColor @ 0x1400a9cdb", "<???> @ 0x14066abe0", "<???> @ 0x14066abf0", "<???> @ 0x1406c78a8"], "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"}