{"type": "func", "start": 5370028304, "end": 5370028649, "name": "CustomizeObjectLayer::onPaste", "pseudocode": "// \n// CustomizeObjectLayer::onPaste from 0x140142110 to 0x140142269 (345 bytes)\n// \n// 2 xrefs:\n// > CustomizeObjectLayer::init @ 0x140141aa5\n// > <???> @ 0x14091733c\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::onPaste(_QWORD *a1)\n{\n  __int64 v2; // r14\n  __int64 v3; // rax\n  __int64 v4; // rbx\n  __int64 v5; // r14\n  __int64 v6; // rdx\n  unsigned int *v7; // rbx\n  __int64 v8; // rax\n  _QWORD *v9; // rbx\n  _QWORD *i; // rbp\n  __int64 v11; // rdi\n  __int64 v12; // rdx\n  int ActiveMode; // eax\n  const char *CString; // rdx\n  cocos2d::CCString *v15; // rax\n  void *v17; // [rsp+40h] [rbp+8h]\n\n  v2 = qword_14090BFD0;\n  if ( !qword_14090BFD0 )\n  {\n    v17 = operator new(0x6E8u);\n    qword_14090BFD0 = GameManager::GameManager(v17);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    v2 = qword_14090BFD0;\n  }\n  v3 = a1[87];\n  v4 = a1[86];\n  v5 = *(_QWORD *)(v2 + 568);\n  v6 = *(_QWORD *)(v5 + 14776);\n  if ( v6 )\n  {\n    if ( v4 )\n    {\n      GameObject::duplicateColorMode(a1[86], v6);\n      *(_BYTE *)(v4 + 1156) = 1;\n    }\n    else if ( v3 )\n    {\n      v7 = *(unsigned int **)(v3 + 56);\n      v8 = *v7;\n      if ( (_DWORD)v8 )\n      {\n        v9 = *((_QWORD **)v7 + 2);\n        for ( i = &v9[v8 - 1]; v9 <= i; ++v9 )\n        {\n          v11 = *v9;\n          if ( !*v9 )\n            break;\n          GameObject::duplicateColorMode(*v9, *(_QWORD *)(v5 + 14776));\n          *(_BYTE *)(v11 + 1156) = 1;\n        }\n      }\n    }\n  }\n  CustomizeObjectLayer::updateCurrentSelection(a1);\n  CustomizeObjectLayer::updateColorSprite(a1);\n  LOBYTE(v12) = 1;\n  ActiveMode = CustomizeObjectLayer::getActiveMode(a1, v12);\n  if ( ActiveMode < 1000 )\n  {\n    if ( ActiveMode <= 0 )\n    {\n      CString = \" \";\n    }\n    else\n    {\n      v15 = cocos2d::CCString::createWithFormat((const char *)&word_1406ED6F8, (unsigned int)ActiveMode);\n      CString = cocos2d::CCString::getCString(v15);\n    }\n  }\n  else\n  {\n    CString = (const char *)GJSpecialColorSelect::textForColorIdx((unsigned int)ActiveMode);\n  }\n  (**(void (__fastcall ***)(__int64, const char *))(a1[101] + 360LL))(a1[101] + 360LL, CString);\n  return CustomizeObjectLayer::updateHSVButtons(a1);\n}", "assembly": "; \n; CustomizeObjectLayer::onPaste from 0x140142110 to 0x140142269 (345 bytes)\n; \n; 2 xrefs:\n; > CustomizeObjectLayer::init @ 0x140141aa5\n; > <???> @ 0x14091733c\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, 0x140142110\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x140142115\npush    rsi                                                            ; +0xa, 0x14014211a\npush    rdi                                                            ; +0xb, 0x14014211b\npush    r14                                                            ; +0xc, 0x14014211c\nsub     rsp, 20h                                                       ; +0xe, 0x14014211e\nmov     rsi, rcx                                                       ; +0x12, 0x140142122\nmov     r14, cs:qword_14090BFD0                                        ; +0x15, 0x140142125\ntest    r14, r14                                                       ; +0x1c, 0x14014212c\njnz     short loc_140142163                                            ; +0x1f, 0x14014212f\nmov     ecx, 6E8h; Size                                                ; +0x21, 0x140142131\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x26, 0x140142136\nmov     [rsp+38h+arg_0], rax                                           ; +0x2b, 0x14014213b\nmov     rcx, rax                                                       ; +0x30, 0x140142140\ncall    GameManager__GameManager                                       ; +0x33, 0x140142143\nnop                                                                    ; +0x38, 0x140142148\nmov     cs:qword_14090BFD0, rax                                        ; +0x39, 0x140142149\nmov     rcx, [rax]                                                     ; +0x40, 0x140142150\nmov     rdx, [rcx+48h]                                                 ; +0x43, 0x140142153\nmov     rcx, rax                                                       ; +0x47, 0x140142157\ncall    rdx                                                            ; +0x4a, 0x14014215a\nmov     r14, cs:qword_14090BFD0                                        ; +0x4c, 0x14014215c\nmov     rax, [rsi+2B8h]                                                ; +0x53, 0x140142163\nmov     rbx, [rsi+2B0h]                                                ; +0x5a, 0x14014216a\nmov     r14, [r14+238h]                                                ; +0x61, 0x140142171\nmov     rdx, [r14+39B8h]                                               ; +0x68, 0x140142178\ntest    rdx, rdx                                                       ; +0x6f, 0x14014217f\njz      short loc_1401421E7                                            ; +0x72, 0x140142182\ntest    rbx, rbx                                                       ; +0x74, 0x140142184\njz      short loc_14014219A                                            ; +0x77, 0x140142187\nmov     rcx, rbx                                                       ; +0x79, 0x140142189\ncall    GameObject__duplicateColorMode                                 ; +0x7c, 0x14014218c\nmov     byte ptr [rbx+484h], 1                                         ; +0x81, 0x140142191\njmp     short loc_1401421E7                                            ; +0x88, 0x140142198\ntest    rax, rax                                                       ; +0x8a, 0x14014219a\njz      short loc_1401421E7                                            ; +0x8d, 0x14014219d\nmov     rbx, [rax+38h]                                                 ; +0x8f, 0x14014219f\nmov     eax, [rbx]                                                     ; +0x93, 0x1401421a3\ntest    eax, eax                                                       ; +0x95, 0x1401421a5\njz      short loc_1401421E7                                            ; +0x97, 0x1401421a7\nmov     rbx, [rbx+10h]                                                 ; +0x99, 0x1401421a9\nlea     rbp, [rax-1]                                                   ; +0x9d, 0x1401421ad\nlea     rbp, [rbx+rbp*8]                                               ; +0xa1, 0x1401421b1\ncmp     rbx, rbp                                                       ; +0xa5, 0x1401421b5\nja      short loc_1401421E7                                            ; +0xa8, 0x1401421b8\nnop     word ptr [rax+rax+00h]                                         ; +0xaa, 0x1401421ba\nmov     rdi, [rbx]                                                     ; +0xb0, 0x1401421c0\ntest    rdi, rdi                                                       ; +0xb3, 0x1401421c3\njz      short loc_1401421E7                                            ; +0xb6, 0x1401421c6\nmov     rdx, [r14+39B8h]                                               ; +0xb8, 0x1401421c8\nmov     rcx, rdi                                                       ; +0xbf, 0x1401421cf\ncall    GameObject__duplicateColorMode                                 ; +0xc2, 0x1401421d2\nmov     byte ptr [rdi+484h], 1                                         ; +0xc7, 0x1401421d7\nadd     rbx, 8                                                         ; +0xce, 0x1401421de\ncmp     rbx, rbp                                                       ; +0xd2, 0x1401421e2\njbe     short loc_1401421C0                                            ; +0xd5, 0x1401421e5\nmov     rcx, rsi                                                       ; +0xd7, 0x1401421e7\ncall    CustomizeObjectLayer__updateCurrentSelection                   ; +0xda, 0x1401421ea\nmov     rcx, rsi                                                       ; +0xdf, 0x1401421ef\ncall    CustomizeObjectLayer__updateColorSprite                        ; +0xe2, 0x1401421f2\nmov     dl, 1                                                          ; +0xe7, 0x1401421f7\nmov     rcx, rsi                                                       ; +0xe9, 0x1401421f9\ncall    CustomizeObjectLayer__getActiveMode                            ; +0xec, 0x1401421fc\ncmp     eax, 3E8h                                                      ; +0xf1, 0x140142201\njl      short loc_140142214                                            ; +0xf6, 0x140142206\nmov     ecx, eax                                                       ; +0xf8, 0x140142208\ncall    GJSpecialColorSelect__textForColorIdx                          ; +0xfa, 0x14014220a\nmov     rdx, rax                                                       ; +0xff, 0x14014220f\njmp     short loc_14014223C                                            ; +0x102, 0x140142212\ntest    eax, eax                                                       ; +0x104, 0x140142214\njle     short loc_140142235                                            ; +0x106, 0x140142216\nmov     edx, eax                                                       ; +0x108, 0x140142218\nlea     rcx, word_1406ED6F8                                            ; +0x10a, 0x14014221a\ncall    cs:?createWithFormat@CCString@cocos2d@@SAPEAV12@PEBDZZ; cocos2d::CCString::createWithFormat(char const *,...) ; +0x111, 0x140142221\nmov     rcx, rax                                                       ; +0x117, 0x140142227\ncall    cs:?getCString@CCString@cocos2d@@QEBAPEBDXZ; cocos2d::CCString::getCString(void) ; +0x11a, 0x14014222a\nmov     rdx, rax                                                       ; +0x120, 0x140142230\njmp     short loc_14014223C                                            ; +0x123, 0x140142233\nlea     rdx, asc_1406ED6E4; \" \"                                        ; +0x125, 0x140142235\nmov     rcx, [rsi+328h]                                                ; +0x12c, 0x14014223c\nadd     rcx, 168h                                                      ; +0x133, 0x140142243\nmov     rax, [rcx]                                                     ; +0x13a, 0x14014224a\ncall    qword ptr [rax]                                                ; +0x13d, 0x14014224d\nmov     rcx, rsi                                                       ; +0x13f, 0x14014224f\nmov     rbx, [rsp+38h+arg_8]                                           ; +0x142, 0x140142252\nmov     rbp, [rsp+38h+arg_10]                                          ; +0x147, 0x140142257\nadd     rsp, 20h                                                       ; +0x14c, 0x14014225c\npop     r14                                                            ; +0x150, 0x140142260\npop     rdi                                                            ; +0x152, 0x140142262\npop     rsi                                                            ; +0x153, 0x140142263\njmp     CustomizeObjectLayer__updateHSVButtons                         ; +0x154, 0x140142264", "xrefs": ["CustomizeObjectLayer::init @ 0x140141aa5", "<???> @ 0x14091733c"], "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"}