{"type": "func", "start": 4303397344, "end": 4303398095, "name": "ColorSelectPopup::colorSelectClosed", "pseudocode": "// \n// ColorSelectPopup::colorSelectClosed from 0x10080a1e0 to 0x10080a4cf (751 bytes)\n// \n// 2 xrefs:\n// > sub_10080A510 @ 0x10080a51c\n// > <???> @ 0x100b9f2b0\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 12:36:41 +0000\n// \n\nvoid __fastcall ColorSelectPopup::colorSelectClosed(__int64 a1, __int64 a2, int a3)\n{\n  _QWORD *v5; // rdi\n  __int64 v6; // r15\n  const char *v7; // r12\n  size_t v8; // rax\n  std::string::size_type v9; // r14\n  char *data; // r13\n  _QWORD *v11; // rdi\n  __int64 v12; // r15\n  const char *v13; // r12\n  size_t v14; // rax\n  std::string::size_type v15; // r14\n  char *v16; // r13\n  size_t v17; // r15\n  int v18; // eax\n  __int64 v19; // rcx\n  _BYTE *v20; // r14\n  __int64 v21; // rdi\n  unsigned int v22; // r14d\n  size_t v23; // r15\n  __int16 v24; // [rsp+0h] [rbp-90h] BYREF\n  char v25; // [rsp+2h] [rbp-8Eh]\n  void *__p; // [rsp+10h] [rbp-80h]\n  __int16 v27; // [rsp+18h] [rbp-78h] BYREF\n  char v28; // [rsp+1Ah] [rbp-76h]\n  void *v29; // [rsp+28h] [rbp-68h]\n  std::string __dst; // [rsp+30h] [rbp-60h] BYREF\n  std::string v31; // [rsp+48h] [rbp-48h] BYREF\n  __int64 v32; // [rsp+60h] [rbp-30h]\n\n  if ( a3 >= 1000 )\n  {\n    if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) == 6 )\n    {\n      *(_DWORD *)(a1 + 1168) = a3;\n      *(_BYTE *)(a1 + 744) = 1;\n      v5 = *(_QWORD **)(a1 + 1152);\n      v24 = 12290;\n      v25 = 0;\n      CCTextInputNode::setString(v5, (__int64)&v24);\n      if ( (v24 & 1) != 0 )\n        operator delete(__p);\n      v6 = *(_QWORD *)(a1 + 1152);\n      v7 = GJSpecialColorSelect::textForColorIdx(a3);\n      v8 = strlen(v7);\n      if ( v8 < 0xFFFFFFFFFFFFFFF8LL )\n      {\n        v9 = v8;\n        v32 = v6;\n        if ( v8 >= 0x17 )\n        {\n          v17 = 26;\n          if ( (v8 | 7) != 0x17 )\n            v17 = (v8 | 7) + 1;\n          data = (char *)operator new(v17);\n          __dst.__r_.__value_.__r.__words[2] = (std::string::size_type)data;\n          __dst.__r_.__value_.__r.__words[0] = v17 + 1;\n          __dst.__r_.__value_.__l.__size_ = v9;\n        }\n        else\n        {\n          __dst.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v8);\n          data = __dst.__r_.__value_.__s.__data_;\n          if ( !v8 )\n            goto LABEL_20;\n        }\n        memmove(data, v7, v9);\nLABEL_20:\n        data[v9] = 0;\n        CCTextInputNode::updateLabel(v32, &__dst);\n        if ( (*(_BYTE *)&__dst.__r_.__value_.__s.0 & 1) != 0 )\n          operator delete(__dst.__r_.__value_.__l.__data_);\n        v18 = 1;\n        if ( *(int *)(a1 + 1168) >= 2 )\n          v18 = *(_DWORD *)(a1 + 1168);\n        *(_DWORD *)(a1 + 1168) = v18;\n        v19 = *(_QWORD *)(a1 + 680);\n        if ( v19 )\n        {\n          *(_DWORD *)(v19 + 1024) = v18;\n        }\n        else\n        {\n          v21 = *(_QWORD *)(a1 + 688);\n          if ( v21 && (unsigned int)sub_1007FEF90(v21) )\n          {\n            v22 = 0;\n            do\n              *(_DWORD *)(sub_1007FEFE0(*(_QWORD *)(a1 + 688), v22++) + 1024) = *(_DWORD *)(a1 + 1168);\n            while ( v22 < (unsigned int)sub_1007FEF90(*(_QWORD *)(a1 + 688)) );\n          }\n        }\n        v20 = (_BYTE *)(a1 + 744);\n        SetupTriggerPopup::updateEditorLabel(a1);\nLABEL_39:\n        *v20 = 0;\n        return;\n      }\nLABEL_41:\n      sub_100003630();\n    }\n    if ( (*(unsigned int (__fastcall **)(__int64))(*(_QWORD *)a2 + 64LL))(a2) != 7 )\n      return;\n    *(_DWORD *)(a1 + 1176) = a3;\n    *(_BYTE *)(a1 + 744) = 1;\n    v11 = *(_QWORD **)(a1 + 1224);\n    v27 = 12290;\n    v28 = 0;\n    CCTextInputNode::setString(v11, (__int64)&v27);\n    if ( (v27 & 1) != 0 )\n      operator delete(v29);\n    v12 = *(_QWORD *)(a1 + 1224);\n    v13 = GJSpecialColorSelect::textForColorIdx(a3);\n    v14 = strlen(v13);\n    if ( v14 >= 0xFFFFFFFFFFFFFFF8LL )\n      goto LABEL_41;\n    v15 = v14;\n    v32 = v12;\n    if ( v14 >= 0x17 )\n    {\n      v23 = 26;\n      if ( (v14 | 7) != 0x17 )\n        v23 = (v14 | 7) + 1;\n      v16 = (char *)operator new(v23);\n      v31.__r_.__value_.__r.__words[2] = (std::string::size_type)v16;\n      v31.__r_.__value_.__r.__words[0] = v23 + 1;\n      v31.__r_.__value_.__l.__size_ = v15;\n    }\n    else\n    {\n      v31.__r_.__value_.__s.0 = (std::string::__short::$7162EEB0FEF29CC674EFA33D0008C7E0)(2 * v14);\n      v16 = v31.__r_.__value_.__s.__data_;\n      if ( !v14 )\n        goto LABEL_36;\n    }\n    memmove(v16, v13, v15);\nLABEL_36:\n    v16[v15] = 0;\n    CCTextInputNode::updateLabel(v32, &v31);\n    if ( (*(_BYTE *)&v31.__r_.__value_.__s.0 & 1) != 0 )\n      operator delete(v31.__r_.__value_.__l.__data_);\n    v20 = (_BYTE *)(a1 + 744);\n    ColorSelectPopup::updateCopyColor(a1);\n    goto LABEL_39;\n  }\n}", "assembly": "; \n; ColorSelectPopup::colorSelectClosed from 0x10080a1e0 to 0x10080a4cf (751 bytes)\n; \n; 2 xrefs:\n; > sub_10080A510 @ 0x10080a51c\n; > <???> @ 0x100b9f2b0\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 12:36:41 +0000\n; \npush    rbp                                                            ; +0x0, 0x10080a1e0\nmov     rbp, rsp                                                       ; +0x1, 0x10080a1e1\npush    r15                                                            ; +0x4, 0x10080a1e4\npush    r14                                                            ; +0x6, 0x10080a1e6\npush    r13                                                            ; +0x8, 0x10080a1e8\npush    r12                                                            ; +0xa, 0x10080a1ea\npush    rbx                                                            ; +0xc, 0x10080a1ec\nsub     rsp, 68h                                                       ; +0xd, 0x10080a1ed\ncmp     edx, 3E8h                                                      ; +0x11, 0x10080a1f1\njl      loc_10080A4BB                                                  ; +0x17, 0x10080a1f7\nmov     r14d, edx                                                      ; +0x1d, 0x10080a1fd\nmov     r15, rsi                                                       ; +0x20, 0x10080a200\nmov     rbx, rdi                                                       ; +0x23, 0x10080a203\nmov     rax, [rsi]                                                     ; +0x26, 0x10080a206\nmov     rdi, rsi                                                       ; +0x29, 0x10080a209\ncall    qword ptr [rax+40h]                                            ; +0x2c, 0x10080a20c\ncmp     eax, 6                                                         ; +0x2f, 0x10080a20f\njnz     loc_10080A2AD                                                  ; +0x32, 0x10080a212\nlea     r15, [rbp+__p]                                                 ; +0x38, 0x10080a218\nmov     [rbx+490h], r14d                                               ; +0x3c, 0x10080a21c\nmov     byte ptr [rbx+2E8h], 1                                         ; +0x43, 0x10080a223\nmov     rdi, [rbx+480h]                                                ; +0x4a, 0x10080a22a\nmov     [rbp+var_90], 3002h                                            ; +0x51, 0x10080a231\nmov     [rbp+var_8E], 0                                                ; +0x5a, 0x10080a23a\nlea     rsi, [rbp+var_90]                                              ; +0x61, 0x10080a241\ncall    CCTextInputNode__setString                                     ; +0x68, 0x10080a248\ntest    byte ptr [rbp+var_90], 1                                       ; +0x6d, 0x10080a24d\njz      short loc_10080A25F                                            ; +0x74, 0x10080a254\nmov     rdi, [rbp+__p]; __p                                            ; +0x76, 0x10080a256\ncall    __ZdlPv; operator delete(void *)                               ; +0x7a, 0x10080a25a\nmov     r15, [rbx+480h]                                                ; +0x7f, 0x10080a25f\nmov     edi, r14d                                                      ; +0x86, 0x10080a266\ncall    GJSpecialColorSelect__textForColorIdx                          ; +0x89, 0x10080a269\nmov     r12, rax                                                       ; +0x8e, 0x10080a26e\nmov     rdi, rax; __s                                                  ; +0x91, 0x10080a271\ncall    _strlen                                                        ; +0x94, 0x10080a274\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x99, 0x10080a279\njnb     loc_10080A4CA                                                  ; +0x9d, 0x10080a27d\nmov     r14, rax                                                       ; +0xa3, 0x10080a283\nmov     [rbp+var_30], r15                                              ; +0xa6, 0x10080a286\ncmp     rax, 17h                                                       ; +0xaa, 0x10080a28a\njnb     loc_10080A348                                                  ; +0xae, 0x10080a28e\nlea     eax, [r14+r14]                                                 ; +0xb4, 0x10080a294\nmov     byte ptr [rbp+__dst], al                                       ; +0xb8, 0x10080a298\nlea     r13, [rbp+__dst+1]                                             ; +0xbb, 0x10080a29b\ntest    r14, r14                                                       ; +0xbf, 0x10080a29f\njnz     loc_10080A37B                                                  ; +0xc2, 0x10080a2a2\njmp     loc_10080A389                                                  ; +0xc8, 0x10080a2a8\nmov     rax, [r15]                                                     ; +0xcd, 0x10080a2ad\nmov     rdi, r15                                                       ; +0xd0, 0x10080a2b0\ncall    qword ptr [rax+40h]                                            ; +0xd3, 0x10080a2b3\ncmp     eax, 7                                                         ; +0xd6, 0x10080a2b6\njnz     loc_10080A4BB                                                  ; +0xd9, 0x10080a2b9\nlea     r15, [rbp+var_68]                                              ; +0xdf, 0x10080a2bf\nmov     [rbx+498h], r14d                                               ; +0xe3, 0x10080a2c3\nmov     byte ptr [rbx+2E8h], 1                                         ; +0xea, 0x10080a2ca\nmov     rdi, [rbx+4C8h]                                                ; +0xf1, 0x10080a2d1\nmov     [rbp+var_78], 3002h                                            ; +0xf8, 0x10080a2d8\nmov     [rbp+var_76], 0                                                ; +0xfe, 0x10080a2de\nlea     rsi, [rbp+var_78]                                              ; +0x102, 0x10080a2e2\ncall    CCTextInputNode__setString                                     ; +0x106, 0x10080a2e6\ntest    byte ptr [rbp+var_78], 1                                       ; +0x10b, 0x10080a2eb\njz      short loc_10080A2FA                                            ; +0x10f, 0x10080a2ef\nmov     rdi, [rbp+var_68]; __p                                         ; +0x111, 0x10080a2f1\ncall    __ZdlPv; operator delete(void *)                               ; +0x115, 0x10080a2f5\nmov     r15, [rbx+4C8h]                                                ; +0x11a, 0x10080a2fa\nmov     edi, r14d                                                      ; +0x121, 0x10080a301\ncall    GJSpecialColorSelect__textForColorIdx                          ; +0x124, 0x10080a304\nmov     r12, rax                                                       ; +0x129, 0x10080a309\nmov     rdi, rax; __s                                                  ; +0x12c, 0x10080a30c\ncall    _strlen                                                        ; +0x12f, 0x10080a30f\ncmp     rax, 0FFFFFFFFFFFFFFF8h                                        ; +0x134, 0x10080a314\njnb     loc_10080A4CA                                                  ; +0x138, 0x10080a318\nmov     r14, rax                                                       ; +0x13e, 0x10080a31e\nmov     [rbp+var_30], r15                                              ; +0x141, 0x10080a321\ncmp     rax, 17h                                                       ; +0x145, 0x10080a325\njnb     loc_10080A441                                                  ; +0x149, 0x10080a329\nlea     eax, [r14+r14]                                                 ; +0x14f, 0x10080a32f\nmov     byte ptr [rbp+var_48], al                                      ; +0x153, 0x10080a333\nlea     r13, [rbp+var_48+1]                                            ; +0x156, 0x10080a336\ntest    r14, r14                                                       ; +0x15a, 0x10080a33a\njnz     loc_10080A474                                                  ; +0x15d, 0x10080a33d\njmp     loc_10080A482                                                  ; +0x163, 0x10080a343\nmov     rax, r14                                                       ; +0x168, 0x10080a348\nor      rax, 7                                                         ; +0x16b, 0x10080a34b\nlea     rcx, [rax+1]                                                   ; +0x16f, 0x10080a34f\ncmp     rax, 17h                                                       ; +0x173, 0x10080a353\nmov     r15d, 1Ah                                                      ; +0x177, 0x10080a357\ncmovnz  r15, rcx                                                       ; +0x17d, 0x10080a35d\nmov     rdi, r15; __sz                                                 ; +0x181, 0x10080a361\ncall    __Znwm; operator new(ulong)                                    ; +0x184, 0x10080a364\nmov     r13, rax                                                       ; +0x189, 0x10080a369\nmov     [rbp+var_50], rax                                              ; +0x18c, 0x10080a36c\ninc     r15                                                            ; +0x190, 0x10080a370\nmov     [rbp+__dst], r15                                               ; +0x193, 0x10080a373\nmov     [rbp+var_58], r14                                              ; +0x197, 0x10080a377\nmov     rdi, r13; __dst                                                ; +0x19b, 0x10080a37b\nmov     rsi, r12; __src                                                ; +0x19e, 0x10080a37e\nmov     rdx, r14; __len                                                ; +0x1a1, 0x10080a381\ncall    _memmove                                                       ; +0x1a4, 0x10080a384\nlea     r15, [rbp+var_50]                                              ; +0x1a9, 0x10080a389\nmov     byte ptr [r13+r14+0], 0                                        ; +0x1ad, 0x10080a38d\nlea     rsi, [rbp+__dst]                                               ; +0x1b3, 0x10080a393\nmov     rdi, [rbp+var_30]                                              ; +0x1b7, 0x10080a397\ncall    CCTextInputNode__updateLabel                                   ; +0x1bb, 0x10080a39b\ntest    byte ptr [rbp+__dst], 1                                        ; +0x1c0, 0x10080a3a0\njz      short loc_10080A3AF                                            ; +0x1c4, 0x10080a3a4\nmov     rdi, [rbp+var_50]; __p                                         ; +0x1c6, 0x10080a3a6\ncall    __ZdlPv; operator delete(void *)                               ; +0x1ca, 0x10080a3aa\nmov     ecx, [rbx+490h]                                                ; +0x1cf, 0x10080a3af\ncmp     ecx, 2                                                         ; +0x1d5, 0x10080a3b5\nmov     eax, 1                                                         ; +0x1d8, 0x10080a3b8\ncmovge  eax, ecx                                                       ; +0x1dd, 0x10080a3bd\nmov     [rbx+490h], eax                                                ; +0x1e0, 0x10080a3c0\nmov     rcx, [rbx+2A8h]                                                ; +0x1e6, 0x10080a3c6\ntest    rcx, rcx                                                       ; +0x1ed, 0x10080a3cd\njz      short loc_10080A3EC                                            ; +0x1f0, 0x10080a3d0\nmov     [rcx+400h], eax                                                ; +0x1f2, 0x10080a3d2\nlea     r14, [rbx+2E8h]                                                ; +0x1f8, 0x10080a3d8\nmov     rdi, rbx                                                       ; +0x1ff, 0x10080a3df\ncall    SetupTriggerPopup__updateEditorLabel                           ; +0x202, 0x10080a3e2\njmp     loc_10080A4B7                                                  ; +0x207, 0x10080a3e7\nmov     rdi, [rbx+2B0h]                                                ; +0x20c, 0x10080a3ec\ntest    rdi, rdi                                                       ; +0x213, 0x10080a3f3\njz      short loc_10080A3D8                                            ; +0x216, 0x10080a3f6\ncall    sub_1007FEF90                                                  ; +0x218, 0x10080a3f8\ntest    eax, eax                                                       ; +0x21d, 0x10080a3fd\njz      short loc_10080A3D8                                            ; +0x21f, 0x10080a3ff\nxor     r14d, r14d                                                     ; +0x221, 0x10080a401\nnop     word ptr [rax+rax+00000000h]                                   ; +0x224, 0x10080a404\nmov     rdi, [rbx+2B0h]                                                ; +0x230, 0x10080a410\nmov     esi, r14d                                                      ; +0x237, 0x10080a417\ncall    sub_1007FEFE0                                                  ; +0x23a, 0x10080a41a\nmov     ecx, [rbx+490h]                                                ; +0x23f, 0x10080a41f\nmov     [rax+400h], ecx                                                ; +0x245, 0x10080a425\ninc     r14d                                                           ; +0x24b, 0x10080a42b\nmov     rdi, [rbx+2B0h]                                                ; +0x24e, 0x10080a42e\ncall    sub_1007FEF90                                                  ; +0x255, 0x10080a435\ncmp     r14d, eax                                                      ; +0x25a, 0x10080a43a\njb      short loc_10080A410                                            ; +0x25d, 0x10080a43d\njmp     short loc_10080A3D8                                            ; +0x25f, 0x10080a43f\nmov     rax, r14                                                       ; +0x261, 0x10080a441\nor      rax, 7                                                         ; +0x264, 0x10080a444\nlea     rcx, [rax+1]                                                   ; +0x268, 0x10080a448\ncmp     rax, 17h                                                       ; +0x26c, 0x10080a44c\nmov     r15d, 1Ah                                                      ; +0x270, 0x10080a450\ncmovnz  r15, rcx                                                       ; +0x276, 0x10080a456\nmov     rdi, r15; __sz                                                 ; +0x27a, 0x10080a45a\ncall    __Znwm; operator new(ulong)                                    ; +0x27d, 0x10080a45d\nmov     r13, rax                                                       ; +0x282, 0x10080a462\nmov     [rbp+var_38], rax                                              ; +0x285, 0x10080a465\ninc     r15                                                            ; +0x289, 0x10080a469\nmov     [rbp+var_48], r15                                              ; +0x28c, 0x10080a46c\nmov     [rbp+var_40], r14                                              ; +0x290, 0x10080a470\nmov     rdi, r13; __dst                                                ; +0x294, 0x10080a474\nmov     rsi, r12; __src                                                ; +0x297, 0x10080a477\nmov     rdx, r14; __len                                                ; +0x29a, 0x10080a47a\ncall    _memmove                                                       ; +0x29d, 0x10080a47d\nlea     r15, [rbp+var_38]                                              ; +0x2a2, 0x10080a482\nmov     byte ptr [r13+r14+0], 0                                        ; +0x2a6, 0x10080a486\nlea     rsi, [rbp+var_48]                                              ; +0x2ac, 0x10080a48c\nmov     rdi, [rbp+var_30]                                              ; +0x2b0, 0x10080a490\ncall    CCTextInputNode__updateLabel                                   ; +0x2b4, 0x10080a494\ntest    byte ptr [rbp+var_48], 1                                       ; +0x2b9, 0x10080a499\njz      short loc_10080A4A8                                            ; +0x2bd, 0x10080a49d\nmov     rdi, [rbp+var_38]; __p                                         ; +0x2bf, 0x10080a49f\ncall    __ZdlPv; operator delete(void *)                               ; +0x2c3, 0x10080a4a3\nlea     r14, [rbx+2E8h]                                                ; +0x2c8, 0x10080a4a8\nmov     rdi, rbx                                                       ; +0x2cf, 0x10080a4af\ncall    ColorSelectPopup__updateCopyColor                              ; +0x2d2, 0x10080a4b2\nmov     byte ptr [r14], 0                                              ; +0x2d7, 0x10080a4b7\nadd     rsp, 68h                                                       ; +0x2db, 0x10080a4bb\npop     rbx                                                            ; +0x2df, 0x10080a4bf\npop     r12                                                            ; +0x2e0, 0x10080a4c0\npop     r13                                                            ; +0x2e2, 0x10080a4c2\npop     r14                                                            ; +0x2e4, 0x10080a4c4\npop     r15                                                            ; +0x2e6, 0x10080a4c6\npop     rbp                                                            ; +0x2e8, 0x10080a4c8\nretn                                                                   ; +0x2e9, 0x10080a4c9\ncall    sub_100003630                                                  ; +0x2ea, 0x10080a4ca", "xrefs": ["sub_10080A510 @ 0x10080a51c", "<???> @ 0x100b9f2b0"], "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"}