{"type": "func", "start": 5369401056, "end": 5369401327, "name": "CustomizeObjectLayer::onNextColorChannel", "pseudocode": "// \n// CustomizeObjectLayer::onNextColorChannel from 0x1400a8ee0 to 0x1400a8fef (271 bytes)\n// \n// 2 xrefs:\n// > CustomizeObjectLayer::init @ 0x1400a77ee\n// > <???> @ 0x1406c77f4\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\n// Hidden C++ exception states: #wind=1\nvoid CustomizeObjectLayer::onNextColorChannel(CustomizeObjectLayer *a1, cocos2d::CCObject *a2)\n{\n  __int64 v3; // rcx\n  int NextColorChannel; // eax\n  int v5; // ebx\n  int v6; // esi\n  ButtonSprite *ButtonByTag; // rax\n  const char *CString; // rdx\n  cocos2d::CCString *v9; // rax\n  void *v10; // [rsp+30h] [rbp+8h]\n\n  v3 = qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v10 = operator new(0x668u);\n    qword_1406C2ED8 = sub_14017AB00(v10);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v3 = qword_1406C2ED8;\n  }\n  NextColorChannel = LevelEditorLayer::getNextColorChannel(*(LevelEditorLayer **)(v3 + 528));\n  v5 = NextColorChannel;\n  v6 = NextColorChannel;\n  if ( (unsigned int)(NextColorChannel - 10) <= 0x3DD )\n  {\n    a1->m_customColorChannel = NextColorChannel;\n    v6 = 1008;\n    a1->m_disableTextDelegate = 1;\n    CustomizeObjectLayer::updateCustomColorLabels(a1);\n    a1->m_disableTextDelegate = 0;\n  }\n  CustomizeObjectLayer::updateSelected(a1, v5);\n  ButtonByTag = CustomizeObjectLayer::getButtonByTag(a1, v6);\n  CustomizeObjectLayer::highlightSelected(a1, ButtonByTag);\n  CustomizeObjectLayer::updateColorSprite(a1);\n  if ( v5 < 1000 )\n  {\n    if ( v5 <= 0 )\n    {\n      CString = \" \";\n    }\n    else\n    {\n      v9 = cocos2d::CCString::createWithFormat(\"%i\", v5);\n      CString = cocos2d::CCString::getCString(v9);\n    }\n  }\n  else\n  {\n    CString = GJSpecialColorSelect::textForColorIdx(v5);\n  }\n  a1->m_selectedColorLabel->setString(&a1->m_selectedColorLabel->cocos2d::CCLabelProtocol, CString);\n}", "assembly": "; \n; CustomizeObjectLayer::onNextColorChannel from 0x1400a8ee0 to 0x1400a8fef (271 bytes)\n; \n; 2 xrefs:\n; > CustomizeObjectLayer::init @ 0x1400a77ee\n; > <???> @ 0x1406c77f4\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, 0x1400a8ee0\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x1400a8ee5\npush    rdi                                                            ; +0xa, 0x1400a8eea\nsub     rsp, 20h                                                       ; +0xb, 0x1400a8eeb\nmov     rdi, rcx                                                       ; +0xf, 0x1400a8eef\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x12, 0x1400a8ef2\ntest    rcx, rcx                                                       ; +0x19, 0x1400a8ef9\njnz     short loc_1400A8F2D                                            ; +0x1c, 0x1400a8efc\nmov     ecx, 668h; Size                                                ; +0x1e, 0x1400a8efe\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x23, 0x1400a8f03\nmov     [rsp+28h+arg_0], rax                                           ; +0x28, 0x1400a8f08\nmov     rcx, rax                                                       ; +0x2d, 0x1400a8f0d\ncall    sub_14017AB00                                                  ; +0x30, 0x1400a8f10\nnop                                                                    ; +0x35, 0x1400a8f15\nmov     cs:qword_1406C2ED8, rax                                        ; +0x36, 0x1400a8f16\nmov     rdx, [rax]                                                     ; +0x3d, 0x1400a8f1d\nmov     rcx, rax                                                       ; +0x40, 0x1400a8f20\ncall    qword ptr [rdx+48h]                                            ; +0x43, 0x1400a8f23\nmov     rcx, cs:qword_1406C2ED8                                        ; +0x46, 0x1400a8f26\nmov     rcx, [rcx+210h]                                                ; +0x4d, 0x1400a8f2d\ncall    LevelEditorLayer__getNextColorChannel                          ; +0x54, 0x1400a8f34\nmov     ebx, eax                                                       ; +0x59, 0x1400a8f39\nmov     esi, eax                                                       ; +0x5b, 0x1400a8f3b\nlea     ecx, [rax-0Ah]                                                 ; +0x5d, 0x1400a8f3d\ncmp     ecx, 3DDh                                                      ; +0x60, 0x1400a8f40\nja      short loc_1400A8F69                                            ; +0x66, 0x1400a8f46\nmov     [rdi+2D4h], eax                                                ; +0x68, 0x1400a8f48\nmov     esi, 3F0h                                                      ; +0x6e, 0x1400a8f4e\nmov     byte ptr [rdi+382h], 1                                         ; +0x73, 0x1400a8f53\nmov     rcx, rdi                                                       ; +0x7a, 0x1400a8f5a\ncall    CustomizeObjectLayer__updateCustomColorLabels                  ; +0x7d, 0x1400a8f5d\nmov     byte ptr [rdi+382h], 0                                         ; +0x82, 0x1400a8f62\nmov     edx, ebx                                                       ; +0x89, 0x1400a8f69\nmov     rcx, rdi                                                       ; +0x8b, 0x1400a8f6b\ncall    CustomizeObjectLayer__updateSelected                           ; +0x8e, 0x1400a8f6e\nmov     edx, esi                                                       ; +0x93, 0x1400a8f73\nmov     rcx, rdi                                                       ; +0x95, 0x1400a8f75\ncall    CustomizeObjectLayer__getButtonByTag                           ; +0x98, 0x1400a8f78\nmov     rdx, rax                                                       ; +0x9d, 0x1400a8f7d\nmov     rcx, rdi                                                       ; +0xa0, 0x1400a8f80\ncall    CustomizeObjectLayer__highlightSelected                        ; +0xa3, 0x1400a8f83\nmov     rcx, rdi                                                       ; +0xa8, 0x1400a8f88\ncall    CustomizeObjectLayer__updateColorSprite                        ; +0xab, 0x1400a8f8b\ncmp     ebx, 3E8h                                                      ; +0xb0, 0x1400a8f90\njl      short loc_1400A8FA4                                            ; +0xb6, 0x1400a8f96\nmov     ecx, ebx                                                       ; +0xb8, 0x1400a8f98\ncall    GJSpecialColorSelect__textForColorIdx                          ; +0xba, 0x1400a8f9a\nmov     rdx, rax                                                       ; +0xbf, 0x1400a8f9f\njmp     short loc_1400A8FCC                                            ; +0xc2, 0x1400a8fa2\ntest    ebx, ebx                                                       ; +0xc4, 0x1400a8fa4\njle     short loc_1400A8FC5                                            ; +0xc6, 0x1400a8fa6\nmov     edx, ebx                                                       ; +0xc8, 0x1400a8fa8\nlea     rcx, aI_11; \"%i\"                                               ; +0xca, 0x1400a8faa\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xd1, 0x1400a8fb1\nmov     rcx, rax                                                       ; +0xd7, 0x1400a8fb7\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xda, 0x1400a8fba\nmov     rdx, rax                                                       ; +0xe0, 0x1400a8fc0\njmp     short loc_1400A8FCC                                            ; +0xe3, 0x1400a8fc3\nlea     rdx, asc_140518984; \" \"                                        ; +0xe5, 0x1400a8fc5\nmov     rcx, [rdi+310h]                                                ; +0xec, 0x1400a8fcc\nadd     rcx, 168h                                                      ; +0xf3, 0x1400a8fd3\nmov     rax, [rcx]                                                     ; +0xfa, 0x1400a8fda\nmov     rbx, [rsp+28h+arg_8]                                           ; +0xfd, 0x1400a8fdd\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x102, 0x1400a8fe2\nadd     rsp, 20h                                                       ; +0x107, 0x1400a8fe7\npop     rdi                                                            ; +0x10b, 0x1400a8feb\njmp     qword ptr [rax]                                                ; +0x10c, 0x1400a8fec", "xrefs": ["CustomizeObjectLayer::init @ 0x1400a77ee", "<???> @ 0x1406c77f4"], "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"}