{"type": "func", "start": 5370032112, "end": 5370032386, "name": "CustomizeObjectLayer::onNextColorChannel", "pseudocode": "// \n// CustomizeObjectLayer::onNextColorChannel from 0x140142ff0 to 0x140143102 (274 bytes)\n// \n// 2 xrefs:\n// > CustomizeObjectLayer::init @ 0x14014184b\n// > <???> @ 0x1409173b4\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\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:27:10 +0000\n// \n\n// Hidden C++ exception states: #wind=1\n__int64 __fastcall CustomizeObjectLayer::onNextColorChannel(__int64 a1)\n{\n  __int64 v2; // rcx\n  unsigned int NextColorChannel; // eax\n  int v4; // ebx\n  unsigned int v5; // esi\n  __int64 ButtonByTag; // rax\n  __int64 v7; // rdx\n  const char *CString; // rdx\n  cocos2d::CCString *v9; // rax\n  void *v11; // [rsp+30h] [rbp+8h]\n\n  v2 = qword_14090BFD0;\n  if ( !qword_14090BFD0 )\n  {\n    v11 = operator new(0x6E8u);\n    qword_14090BFD0 = GameManager::GameManager(v11);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    v2 = qword_14090BFD0;\n  }\n  NextColorChannel = LevelEditorLayer::getNextColorChannel(*(_QWORD *)(v2 + 568));\n  v4 = NextColorChannel;\n  v5 = NextColorChannel;\n  if ( NextColorChannel - 10 <= 0x3DD )\n  {\n    *(_DWORD *)(a1 + 748) = NextColorChannel;\n    v5 = 1008;\n    *(_BYTE *)(a1 + 922) = 1;\n    CustomizeObjectLayer::updateCustomColorLabels(a1);\n    *(_BYTE *)(a1 + 922) = 0;\n  }\n  CustomizeObjectLayer::updateSelected(a1);\n  ButtonByTag = CustomizeObjectLayer::getButtonByTag(a1, v5);\n  CustomizeObjectLayer::highlightSelected(a1, ButtonByTag);\n  CustomizeObjectLayer::updateColorSprite(a1, v7);\n  if ( v4 < 1000 )\n  {\n    if ( v4 <= 0 )\n    {\n      CString = \" \";\n    }\n    else\n    {\n      v9 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)v4);\n      CString = cocos2d::CCString::getCString(v9);\n    }\n  }\n  else\n  {\n    CString = (const char *)GJSpecialColorSelect::textForColorIdx((unsigned int)v4);\n  }\n  return (**(__int64 (__fastcall ***)(__int64, const char *))(*(_QWORD *)(a1 + 808) + 360LL))(\n           *(_QWORD *)(a1 + 808) + 360LL,\n           CString);\n}", "assembly": "; \n; CustomizeObjectLayer::onNextColorChannel from 0x140142ff0 to 0x140143102 (274 bytes)\n; \n; 2 xrefs:\n; > CustomizeObjectLayer::init @ 0x14014184b\n; > <???> @ 0x1409173b4\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\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:27:10 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x140142ff0\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x140142ff5\npush    rdi                                                            ; +0xa, 0x140142ffa\nsub     rsp, 20h                                                       ; +0xb, 0x140142ffb\nmov     rdi, rcx                                                       ; +0xf, 0x140142fff\nmov     rcx, cs:qword_14090BFD0                                        ; +0x12, 0x140143002\ntest    rcx, rcx                                                       ; +0x19, 0x140143009\njnz     short loc_140143040                                            ; +0x1c, 0x14014300c\nmov     ecx, 6E8h; Size                                                ; +0x1e, 0x14014300e\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x23, 0x140143013\nmov     [rsp+28h+arg_0], rax                                           ; +0x28, 0x140143018\nmov     rcx, rax                                                       ; +0x2d, 0x14014301d\ncall    GameManager__GameManager                                       ; +0x30, 0x140143020\nnop                                                                    ; +0x35, 0x140143025\nmov     cs:qword_14090BFD0, rax                                        ; +0x36, 0x140143026\nmov     rcx, [rax]                                                     ; +0x3d, 0x14014302d\nmov     rdx, [rcx+48h]                                                 ; +0x40, 0x140143030\nmov     rcx, rax                                                       ; +0x44, 0x140143034\ncall    rdx                                                            ; +0x47, 0x140143037\nmov     rcx, cs:qword_14090BFD0                                        ; +0x49, 0x140143039\nmov     rcx, [rcx+238h]                                                ; +0x50, 0x140143040\ncall    LevelEditorLayer__getNextColorChannel                          ; +0x57, 0x140143047\nmov     ebx, eax                                                       ; +0x5c, 0x14014304c\nmov     esi, eax                                                       ; +0x5e, 0x14014304e\nlea     ecx, [rax-0Ah]                                                 ; +0x60, 0x140143050\ncmp     ecx, 3DDh                                                      ; +0x63, 0x140143053\nja      short loc_14014307C                                            ; +0x69, 0x140143059\nmov     [rdi+2ECh], eax                                                ; +0x6b, 0x14014305b\nmov     esi, 3F0h                                                      ; +0x71, 0x140143061\nmov     byte ptr [rdi+39Ah], 1                                         ; +0x76, 0x140143066\nmov     rcx, rdi                                                       ; +0x7d, 0x14014306d\ncall    CustomizeObjectLayer__updateCustomColorLabels                  ; +0x80, 0x140143070\nmov     byte ptr [rdi+39Ah], 0                                         ; +0x85, 0x140143075\nmov     edx, ebx                                                       ; +0x8c, 0x14014307c\nmov     rcx, rdi                                                       ; +0x8e, 0x14014307e\ncall    CustomizeObjectLayer__updateSelected                           ; +0x91, 0x140143081\nmov     edx, esi                                                       ; +0x96, 0x140143086\nmov     rcx, rdi                                                       ; +0x98, 0x140143088\ncall    CustomizeObjectLayer__getButtonByTag                           ; +0x9b, 0x14014308b\nmov     rdx, rax                                                       ; +0xa0, 0x140143090\nmov     rcx, rdi                                                       ; +0xa3, 0x140143093\ncall    CustomizeObjectLayer__highlightSelected                        ; +0xa6, 0x140143096\nmov     rcx, rdi                                                       ; +0xab, 0x14014309b\ncall    CustomizeObjectLayer__updateColorSprite                        ; +0xae, 0x14014309e\ncmp     ebx, 3E8h                                                      ; +0xb3, 0x1401430a3\njl      short loc_1401430B7                                            ; +0xb9, 0x1401430a9\nmov     ecx, ebx                                                       ; +0xbb, 0x1401430ab\ncall    GJSpecialColorSelect__textForColorIdx                          ; +0xbd, 0x1401430ad\nmov     rdx, rax                                                       ; +0xc2, 0x1401430b2\njmp     short loc_1401430DF                                            ; +0xc5, 0x1401430b5\ntest    ebx, ebx                                                       ; +0xc7, 0x1401430b7\njle     short loc_1401430D8                                            ; +0xc9, 0x1401430b9\nmov     edx, ebx                                                       ; +0xcb, 0x1401430bb\nlea     rcx, word_1406ED6F8                                            ; +0xcd, 0x1401430bd\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0xd4, 0x1401430c4\nmov     rcx, rax                                                       ; +0xda, 0x1401430ca\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0xdd, 0x1401430cd\nmov     rdx, rax                                                       ; +0xe3, 0x1401430d3\njmp     short loc_1401430DF                                            ; +0xe6, 0x1401430d6\nlea     rdx, asc_1406ED6E4; \" \"                                        ; +0xe8, 0x1401430d8\nmov     rcx, [rdi+328h]                                                ; +0xef, 0x1401430df\nadd     rcx, 168h                                                      ; +0xf6, 0x1401430e6\nmov     rax, [rcx]                                                     ; +0xfd, 0x1401430ed\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x100, 0x1401430f0\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x105, 0x1401430f5\nadd     rsp, 20h                                                       ; +0x10a, 0x1401430fa\npop     rdi                                                            ; +0x10e, 0x1401430fe\njmp     qword ptr [rax]                                                ; +0x10f, 0x1401430ff", "xrefs": ["CustomizeObjectLayer::init @ 0x14014184b", "<???> @ 0x1409173b4"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "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"}