{"type": "func", "start": 5370029536, "end": 5370030056, "name": "CustomizeObjectLayer::updateColorSprite", "pseudocode": "// \n// CustomizeObjectLayer::updateColorSprite from 0x1401425e0 to 0x1401427e8 (520 bytes)\n// \n// 9 xrefs:\n// > CustomizeObjectLayer::onPaste @ 0x1401421f2\n// > CustomizeObjectLayer::colorSetupClosed @ 0x1401424c7\n// > CustomizeObjectLayer::colorSelectClosed @ 0x1401427f7\n// > CustomizeObjectLayer::onNextColorChannel @ 0x14014309e\n// > CustomizeObjectLayer::onSelectMode @ 0x1401432a4\n// > CustomizeObjectLayer::onUpdateCustomColor @ 0x14014374d\n// > CustomizeObjectLayer::textChanged @ 0x140143a99\n// > CustomizeObjectLayer::onSelectColor @ 0x140143e8a\n// > <???> @ 0x140917378\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=2\n__int64 __fastcall CustomizeObjectLayer::updateColorSprite(__int64 a1, __int64 a2)\n{\n  int ActiveMode; // edi\n  __int64 v4; // rax\n  int v5; // edx\n  __int64 v6; // rcx\n  __int64 ColorAction; // rax\n  __int64 v8; // rsi\n  __int64 v9; // rbx\n  void *v11; // [rsp+30h] [rbp+8h] BYREF\n\n  ActiveMode = 0;\n  if ( *(_DWORD *)(a1 + 744) == 3 )\n    goto LABEL_18;\n  LOBYTE(a2) = 1;\n  ActiveMode = CustomizeObjectLayer::getActiveMode(a1, a2);\n  if ( ActiveMode <= 0 )\n    goto LABEL_13;\n  v4 = 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    v4 = qword_14090BFD0;\n  }\n  v5 = ActiveMode;\n  if ( ActiveMode > 1101 )\n    v5 = 1101;\n  v6 = *(_QWORD *)(*(_QWORD *)(*(_QWORD *)(v4 + 568) + 3528LL) + 320LL);\n  if ( *(_QWORD *)(*(_QWORD *)(v6 + 736) + 8LL * v5) )\n  {\n    ColorAction = GJEffectManager::getColorAction(v6, (unsigned int)ActiveMode);\n    v8 = ColorAction;\n    v9 = *(_QWORD *)(a1 + 896);\n    if ( ColorAction )\n    {\n      ColorChannelSprite::updateCopyLabel(\n        *(_QWORD *)(a1 + 896),\n        *(unsigned int *)(ColorAction + 120),\n        *(unsigned __int8 *)(ColorAction + 126));\n      ColorChannelSprite::updateOpacity(v9);\n      ColorChannelSprite::updateBlending(v9, *(unsigned __int8 *)(v8 + 84));\n      LOWORD(v11) = *(_WORD *)(v8 + 72);\n      BYTE2(v11) = *(_BYTE *)(v8 + 74);\n      if ( *(_DWORD *)(v8 + 120) && !*(_BYTE *)(v8 + 126) )\n      {\n        LOWORD(v11) = -22874;\n        BYTE2(v11) = -90;\n      }\n      (**(void (__fastcall ***)(__int64, void **))(v9 + 320))(v9 + 320, &v11);\n      goto LABEL_18;\n    }\n  }\n  else\n  {\nLABEL_13:\n    v9 = *(_QWORD *)(a1 + 896);\n  }\n  (**(void (__fastcall ***)(__int64, __int16 *))(v9 + 320))(v9 + 320, &word_140703460);\n  if ( *(_QWORD *)(v9 + 600) )\n    (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v9 + 600) + 336LL))(*(_QWORD *)(v9 + 600), 0);\n  ColorChannelSprite::updateOpacity(v9);\n  if ( *(_QWORD *)(v9 + 616) )\n    (*(void (__fastcall **)(_QWORD, _QWORD))(**(_QWORD **)(v9 + 616) + 336LL))(*(_QWORD *)(v9 + 616), 0);\nLABEL_18:\n  LOBYTE(a2) = ActiveMode < 1;\n  switch ( ActiveMode )\n  {\n    case 1005:\n    case 1006:\n    case 1007:\n    case 1010:\n    case 1011:\n    case 1012:\n      LOBYTE(a2) = 1;\n      break;\n    default:\n      break;\n  }\n  LOBYTE(a2) = a2 ^ 1;\n  return (*(__int64 (__fastcall **)(_QWORD, __int64))(**(_QWORD **)(a1 + 904) + 336LL))(*(_QWORD *)(a1 + 904), a2);\n}", "assembly": "; \n; CustomizeObjectLayer::updateColorSprite from 0x1401425e0 to 0x1401427e8 (520 bytes)\n; \n; 9 xrefs:\n; > CustomizeObjectLayer::onPaste @ 0x1401421f2\n; > CustomizeObjectLayer::colorSetupClosed @ 0x1401424c7\n; > CustomizeObjectLayer::colorSelectClosed @ 0x1401427f7\n; > CustomizeObjectLayer::onNextColorChannel @ 0x14014309e\n; > CustomizeObjectLayer::onSelectMode @ 0x1401432a4\n; > CustomizeObjectLayer::onUpdateCustomColor @ 0x14014374d\n; > CustomizeObjectLayer::textChanged @ 0x140143a99\n; > CustomizeObjectLayer::onSelectColor @ 0x140143e8a\n; > <???> @ 0x140917378\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, 0x1401425e0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1401425e5\nmov     [rsp+arg_18], rsi                                              ; +0xa, 0x1401425ea\npush    rdi                                                            ; +0xf, 0x1401425ef\nsub     rsp, 20h                                                       ; +0x10, 0x1401425f0\nmov     rbp, rcx                                                       ; +0x14, 0x1401425f4\nxor     edi, edi                                                       ; +0x17, 0x1401425f7\ncmp     dword ptr [rcx+2E8h], 3                                        ; +0x19, 0x1401425f9\njz      loc_140142773                                                  ; +0x20, 0x140142600\nmov     dl, 1                                                          ; +0x26, 0x140142606\ncall    CustomizeObjectLayer__getActiveMode                            ; +0x28, 0x140142608\nmov     edi, eax                                                       ; +0x2d, 0x14014260d\ntest    eax, eax                                                       ; +0x2f, 0x14014260f\njle     loc_140142711                                                  ; +0x31, 0x140142611\nmov     rax, cs:qword_14090BFD0                                        ; +0x37, 0x140142617\ntest    rax, rax                                                       ; +0x3e, 0x14014261e\njnz     short loc_140142655                                            ; +0x41, 0x140142621\nmov     ecx, 6E8h; Size                                                ; +0x43, 0x140142623\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x48, 0x140142628\nmov     [rsp+28h+arg_0], rax                                           ; +0x4d, 0x14014262d\nmov     rcx, rax                                                       ; +0x52, 0x140142632\ncall    GameManager__GameManager                                       ; +0x55, 0x140142635\nnop                                                                    ; +0x5a, 0x14014263a\nmov     cs:qword_14090BFD0, rax                                        ; +0x5b, 0x14014263b\nmov     rcx, [rax]                                                     ; +0x62, 0x140142642\nmov     rdx, [rcx+48h]                                                 ; +0x65, 0x140142645\nmov     rcx, rax                                                       ; +0x69, 0x140142649\ncall    rdx                                                            ; +0x6c, 0x14014264c\nmov     rax, cs:qword_14090BFD0                                        ; +0x6e, 0x14014264e\nmov     edx, edi                                                       ; +0x75, 0x140142655\nmov     ecx, 44Dh                                                      ; +0x77, 0x140142657\ncmp     edi, ecx                                                       ; +0x7c, 0x14014265c\ncmovg   edx, ecx                                                       ; +0x7e, 0x14014265e\nmov     rax, [rax+238h]                                                ; +0x81, 0x140142661\nmov     rcx, [rax+0DC8h]                                               ; +0x88, 0x140142668\nmov     rcx, [rcx+140h]                                                ; +0x8f, 0x14014266f\nmovsxd  rdx, edx                                                       ; +0x96, 0x140142676\nmov     rax, [rcx+2E0h]                                                ; +0x99, 0x140142679\ncmp     qword ptr [rax+rdx*8], 0                                       ; +0xa0, 0x140142680\njz      loc_140142711                                                  ; +0xa5, 0x140142685\nmov     edx, edi                                                       ; +0xab, 0x14014268b\ncall    GJEffectManager__getColorAction                                ; +0xad, 0x14014268d\nmov     rsi, rax                                                       ; +0xb2, 0x140142692\nmov     rbx, [rbp+380h]                                                ; +0xb5, 0x140142695\ntest    rax, rax                                                       ; +0xbc, 0x14014269c\njz      short loc_140142718                                            ; +0xbf, 0x14014269f\nmovzx   r8d, byte ptr [rax+7Eh]                                        ; +0xc1, 0x1401426a1\nmov     edx, [rax+78h]                                                 ; +0xc6, 0x1401426a6\nmov     rcx, rbx                                                       ; +0xc9, 0x1401426a9\ncall    ColorChannelSprite__updateCopyLabel                            ; +0xcc, 0x1401426ac\nmovss   xmm1, dword ptr [rsi+60h]                                      ; +0xd1, 0x1401426b1\nmov     rcx, rbx                                                       ; +0xd6, 0x1401426b6\ncall    ColorChannelSprite__updateOpacity                              ; +0xd9, 0x1401426b9\nmovzx   edx, byte ptr [rsi+54h]                                        ; +0xde, 0x1401426be\nmov     rcx, rbx                                                       ; +0xe2, 0x1401426c2\ncall    ColorChannelSprite__updateBlending                             ; +0xe5, 0x1401426c5\nmovzx   eax, word ptr [rsi+48h]                                        ; +0xea, 0x1401426ca\nmov     word ptr [rsp+28h+arg_0], ax                                   ; +0xee, 0x1401426ce\nmovzx   eax, byte ptr [rsi+4Ah]                                        ; +0xf3, 0x1401426d3\nmov     byte ptr [rsp+28h+arg_0+2], al                                 ; +0xf7, 0x1401426d7\ncmp     dword ptr [rsi+78h], 0                                         ; +0xfb, 0x1401426db\njz      short loc_1401426FE                                            ; +0xff, 0x1401426df\ncmp     byte ptr [rsi+7Eh], 0                                          ; +0x101, 0x1401426e1\njnz     short loc_1401426FE                                            ; +0x105, 0x1401426e5\nmovzx   eax, cs:word_14070345C                                         ; +0x107, 0x1401426e7\nmov     word ptr [rsp+28h+arg_0], ax                                   ; +0x10e, 0x1401426ee\nmovzx   eax, cs:byte_14070345E                                         ; +0x113, 0x1401426f3\nmov     byte ptr [rsp+28h+arg_0+2], al                                 ; +0x11a, 0x1401426fa\nlea     rcx, [rbx+140h]                                                ; +0x11e, 0x1401426fe\nmov     rax, [rcx]                                                     ; +0x125, 0x140142705\nlea     rdx, [rsp+28h+arg_0]                                           ; +0x128, 0x140142708\ncall    qword ptr [rax]                                                ; +0x12d, 0x14014270d\njmp     short loc_140142773                                            ; +0x12f, 0x14014270f\nmov     rbx, [rbp+380h]                                                ; +0x131, 0x140142711\nlea     rcx, [rbx+140h]                                                ; +0x138, 0x140142718\nmov     rax, [rcx]                                                     ; +0x13f, 0x14014271f\nlea     rdx, word_140703460                                            ; +0x142, 0x140142722\ncall    qword ptr [rax]                                                ; +0x149, 0x140142729\ncmp     qword ptr [rbx+258h], 0                                        ; +0x14b, 0x14014272b\njz      short loc_140142747                                            ; +0x153, 0x140142733\nmov     rcx, [rbx+258h]                                                ; +0x155, 0x140142735\nmov     rax, [rcx]                                                     ; +0x15c, 0x14014273c\nxor     edx, edx                                                       ; +0x15f, 0x14014273f\ncall    qword ptr [rax+150h]                                           ; +0x161, 0x140142741\nmovss   xmm1, cs:flt_140835080                                         ; +0x167, 0x140142747\nmov     rcx, rbx                                                       ; +0x16f, 0x14014274f\ncall    ColorChannelSprite__updateOpacity                              ; +0x172, 0x140142752\ncmp     qword ptr [rbx+268h], 0                                        ; +0x177, 0x140142757\njz      short loc_140142773                                            ; +0x17f, 0x14014275f\nmov     rcx, [rbx+268h]                                                ; +0x181, 0x140142761\nmov     rax, [rcx]                                                     ; +0x188, 0x140142768\nxor     edx, edx                                                       ; +0x18b, 0x14014276b\ncall    qword ptr [rax+150h]                                           ; +0x18d, 0x14014276d\ncmp     edi, 1                                                         ; +0x193, 0x140142773\nsetl    dl                                                             ; +0x196, 0x140142776\nadd     edi, 0FFFFFC13h; switch 8 cases                                ; +0x199, 0x140142779\ncmp     edi, 7                                                         ; +0x19f, 0x14014277f\nja      short def_140142799; jumptable 0000000140142799 default case, cases 1008,1009 ; +0x1a2, 0x140142782\nmovsxd  rax, edi                                                       ; +0x1a4, 0x140142784\nlea     r8, cs:140000000h                                              ; +0x1a7, 0x140142787\nmov     ecx, ds:(jpt_140142799 - 140000000h)[r8+rax*4]                 ; +0x1ae, 0x14014278e\nadd     rcx, r8                                                        ; +0x1b6, 0x140142796\njmp     rcx; switch jump                                               ; +0x1b9, 0x140142799\nmov     dl, 1; jumptable 0000000140142799 cases 1005-1007,1010-1012    ; +0x1bb, 0x14014279b\nmov     rcx, [rbp+388h]; jumptable 0000000140142799 default case, cases 1008,1009 ; +0x1bd, 0x14014279d\nxor     dl, 1                                                          ; +0x1c4, 0x1401427a4\nmov     rax, [rcx]                                                     ; +0x1c7, 0x1401427a7\nmov     rbx, [rsp+28h+arg_8]                                           ; +0x1ca, 0x1401427aa\nmov     rbp, [rsp+28h+arg_10]                                          ; +0x1cf, 0x1401427af\nmov     rsi, [rsp+28h+arg_18]                                          ; +0x1d4, 0x1401427b4\nadd     rsp, 20h                                                       ; +0x1d9, 0x1401427b9\npop     rdi                                                            ; +0x1dd, 0x1401427bd\njmp     qword ptr [rax+150h]                                           ; +0x1de, 0x1401427be\nalign 8                                                                ; +0x1e5, 0x1401427c5\ndd offset loc_14014279B - 140000000h; jump table for switch statement  ; +0x1e8, 0x1401427c8", "xrefs": ["CustomizeObjectLayer::onPaste @ 0x1401421f2", "CustomizeObjectLayer::colorSetupClosed @ 0x1401424c7", "CustomizeObjectLayer::colorSelectClosed @ 0x1401427f7", "CustomizeObjectLayer::onNextColorChannel @ 0x14014309e", "CustomizeObjectLayer::onSelectMode @ 0x1401432a4", "CustomizeObjectLayer::onUpdateCustomColor @ 0x14014374d", "CustomizeObjectLayer::textChanged @ 0x140143a99", "CustomizeObjectLayer::onSelectColor @ 0x140143e8a", "<???> @ 0x140917378"], "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"}