{"type": "func", "start": 5370565920, "end": 5370566392, "name": "EditorUI::onDuplicate", "pseudocode": "// \n// EditorUI::onDuplicate from 0x1401c5520 to 0x1401c56f8 (472 bytes)\n// \n// 5 xrefs:\n// > EditorUI::startFreeMoveTouch @ 0x1401bfb87\n// > EditorUI::handleEditorAction @ 0x1401c23ec\n// > EditorUI::init @ 0x1401ab48e\n// > <???> @ 0x14091a720\n// > <???> @ 0x14091a72c\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:28:04 +0000\n// \n\n// Hidden C++ exception states: #wind=1\nvoid __fastcall EditorUI::onDuplicate(__int64 a1)\n{\n  __int64 v2; // rax\n  int v3; // ebx\n  int v4; // ecx\n  __int64 v5; // rcx\n  cocos2d::CCArray *v6; // rbx\n  __int64 v7; // rax\n  __int64 v8; // rdx\n  int v9; // ecx\n  int v10; // eax\n  int v11; // ecx\n  char v12; // [rsp+20h] [rbp-68h]\n  _BYTE v13[32]; // [rsp+38h] [rbp-50h] BYREF\n  _BYTE v14[32]; // [rsp+58h] [rbp-30h] BYREF\n\n  if ( !*(_QWORD *)(a1 + 1568) && !cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944)) )\n    return;\n  v2 = EditorSFXManager::sharedState();\n  EditorSFXManager::playAction(v2, 103);\n  v3 = *(_DWORD *)(*(_QWORD *)(a1 + 1512) + 14928LL) - *(_DWORD *)(*(_QWORD *)(a1 + 1512) + 14932LL);\n  v4 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944)) + v3;\n  if ( v4 > 80000 )\n  {\n    if ( !*(_BYTE *)(*(_QWORD *)(*(_QWORD *)(a1 + 1512) + 2168LL) + 1297LL) )\n    {\n      EditorUI::showMaxError(a1);\n      return;\n    }\nLABEL_7:\n    if ( !*(_BYTE *)(*(_QWORD *)(*(_QWORD *)(a1 + 1512) + 2168LL) + 1296LL) )\n    {\n      EditorUI::showMaxBasicError(a1);\n      return;\n    }\n    goto LABEL_9;\n  }\n  if ( v4 > 40000 )\n    goto LABEL_7;\nLABEL_9:\n  if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944)) )\n  {\n    v6 = *(cocos2d::CCArray **)(a1 + 944);\n  }\n  else\n  {\n    v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);\n    cocos2d::CCArray::addObject(v6, *(struct cocos2d::CCObject **)(a1 + 1568));\n  }\n  v12 = 0;\n  EditorUI::copyObjects(a1, v14, v6, 0, v12);\n  *(_BYTE *)(*(_QWORD *)(a1 + 1512) + 14808LL) = 1;\n  v7 = sub_14003F4F0((__int64)v13, (__int64)v14);\n  EditorUI::pasteObjects(a1, v7, 0, 0);\n  *(_BYTE *)(*(_QWORD *)(a1 + 1512) + 14808LL) = 0;\n  v8 = *(_QWORD *)(a1 + 1512) + 15408LL;\n  v9 = *(_DWORD *)(*(_QWORD *)(a1 + 1512) + 15504LL);\n  if ( v9 >= 0 )\n  {\n    v10 = *(_DWORD *)(*(_QWORD *)(a1 + 1512) + 15440LL) - v9;\n    v11 = 0;\n    if ( v10 > 1 )\n    {\n      do\n      {\n        if ( v11 >= 7 )\n          break;\n        v10 = (unsigned int)v10 >> 1;\n        ++v11;\n      }\n      while ( (unsigned int)v10 > 1 );\n    }\n    ++*(_DWORD *)(v8 + 4LL * v11 + 64);\n  }\n  *(_DWORD *)(v8 + 96) = *(_DWORD *)(v8 + 32);\n  EditorUI::updateButtons(a1);\n  EditorUI::updateObjectInfoLabel(a1);\n  sub_14003D310((__int64)v14);\n}", "assembly": "; \n; EditorUI::onDuplicate from 0x1401c5520 to 0x1401c56f8 (472 bytes)\n; \n; 5 xrefs:\n; > EditorUI::startFreeMoveTouch @ 0x1401bfb87\n; > EditorUI::handleEditorAction @ 0x1401c23ec\n; > EditorUI::init @ 0x1401ab48e\n; > <???> @ 0x14091a720\n; > <???> @ 0x14091a72c\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:28:04 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1401c5520\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x1401c5525\npush    rdi                                                            ; +0xa, 0x1401c552a\nsub     rsp, 80h                                                       ; +0xb, 0x1401c552b\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x1401c5532\nxor     rax, rsp                                                       ; +0x19, 0x1401c5539\nmov     [rsp+88h+var_10], rax                                          ; +0x1c, 0x1401c553c\nmov     rdi, rcx                                                       ; +0x21, 0x1401c5541\ncmp     qword ptr [rcx+620h], 0                                        ; +0x24, 0x1401c5544\njnz     short loc_1401C5563                                            ; +0x2c, 0x1401c554c\nmov     rcx, [rcx+3B0h]                                                ; +0x2e, 0x1401c554e\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x35, 0x1401c5555\ntest    eax, eax                                                       ; +0x3b, 0x1401c555b\njz      loc_1401C56D6                                                  ; +0x3d, 0x1401c555d\ncall    EditorSFXManager__sharedState                                  ; +0x43, 0x1401c5563\nmov     rcx, rax                                                       ; +0x48, 0x1401c5568\nmov     edx, 67h ; 'g'                                                 ; +0x4b, 0x1401c556b\ncall    EditorSFXManager__playAction                                   ; +0x50, 0x1401c5570\nmov     rax, [rdi+5E8h]                                                ; +0x55, 0x1401c5575\nmov     ebx, [rax+3A50h]                                               ; +0x5c, 0x1401c557c\nsub     ebx, [rax+3A54h]                                               ; +0x62, 0x1401c5582\nmov     rcx, [rdi+3B0h]                                                ; +0x68, 0x1401c5588\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x6f, 0x1401c558f\nlea     ecx, [rax+rbx]                                                 ; +0x75, 0x1401c5595\ncmp     ecx, 13880h                                                    ; +0x78, 0x1401c5598\njle     short loc_1401C55C4                                            ; +0x7e, 0x1401c559e\nmov     rax, [rdi+5E8h]                                                ; +0x80, 0x1401c55a0\nmov     rdx, [rax+878h]                                                ; +0x87, 0x1401c55a7\ncmp     byte ptr [rdx+511h], 0                                         ; +0x8e, 0x1401c55ae\njnz     short loc_1401C55CC                                            ; +0x95, 0x1401c55b5\nmov     rcx, rdi                                                       ; +0x97, 0x1401c55b7\ncall    EditorUI__showMaxError                                         ; +0x9a, 0x1401c55ba\njmp     loc_1401C56D6                                                  ; +0x9f, 0x1401c55bf\ncmp     ecx, 9C40h                                                     ; +0xa4, 0x1401c55c4\njle     short loc_1401C55F0                                            ; +0xaa, 0x1401c55ca\nmov     rax, [rdi+5E8h]                                                ; +0xac, 0x1401c55cc\nmov     rcx, [rax+878h]                                                ; +0xb3, 0x1401c55d3\ncmp     byte ptr [rcx+510h], 0                                         ; +0xba, 0x1401c55da\njnz     short loc_1401C55F0                                            ; +0xc1, 0x1401c55e1\nmov     rcx, rdi                                                       ; +0xc3, 0x1401c55e3\ncall    EditorUI__showMaxBasicError                                    ; +0xc6, 0x1401c55e6\njmp     loc_1401C56D6                                                  ; +0xcb, 0x1401c55eb\nmov     rcx, [rdi+3B0h]                                                ; +0xd0, 0x1401c55f0\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xd7, 0x1401c55f7\ntest    eax, eax                                                       ; +0xdd, 0x1401c55fd\njnz     short loc_1401C561C                                            ; +0xdf, 0x1401c55ff\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0xe1, 0x1401c5601\nmov     rbx, rax                                                       ; +0xe7, 0x1401c5607\nmov     rdx, [rdi+620h]                                                ; +0xea, 0x1401c560a\nmov     rcx, rax                                                       ; +0xf1, 0x1401c5611\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xf4, 0x1401c5614\njmp     short loc_1401C5623                                            ; +0xfa, 0x1401c561a\nmov     rbx, [rdi+3B0h]                                                ; +0xfc, 0x1401c561c\nmov     [rsp+88h+var_68], 0                                            ; +0x103, 0x1401c5623\nxor     r9d, r9d                                                       ; +0x108, 0x1401c5628\nmov     r8, rbx                                                        ; +0x10b, 0x1401c562b\nlea     rdx, [rsp+88h+var_30]                                          ; +0x10e, 0x1401c562e\nmov     rcx, rdi                                                       ; +0x113, 0x1401c5633\ncall    EditorUI__copyObjects                                          ; +0x116, 0x1401c5636\nnop                                                                    ; +0x11b, 0x1401c563b\nmov     rax, [rdi+5E8h]                                                ; +0x11c, 0x1401c563c\nmov     byte ptr [rax+39D8h], 1                                        ; +0x123, 0x1401c5643\nlea     rdx, [rsp+88h+var_30]                                          ; +0x12a, 0x1401c564a\nlea     rcx, [rsp+88h+var_50]                                          ; +0x12f, 0x1401c564f\ncall    sub_14003F4F0                                                  ; +0x134, 0x1401c5654\nxor     r9d, r9d                                                       ; +0x139, 0x1401c5659\nxor     r8d, r8d                                                       ; +0x13c, 0x1401c565c\nmov     rdx, rax                                                       ; +0x13f, 0x1401c565f\nmov     rcx, rdi                                                       ; +0x142, 0x1401c5662\ncall    EditorUI__pasteObjects                                         ; +0x145, 0x1401c5665\nmov     rax, [rdi+5E8h]                                                ; +0x14a, 0x1401c566a\nmov     byte ptr [rax+39D8h], 0                                        ; +0x151, 0x1401c5671\nmov     rdx, [rdi+5E8h]                                                ; +0x158, 0x1401c5678\nadd     rdx, 3C30h                                                     ; +0x15f, 0x1401c567f\nmov     ecx, [rdx+60h]                                                 ; +0x166, 0x1401c5686\ntest    ecx, ecx                                                       ; +0x169, 0x1401c5689\njs      short loc_1401C56B5                                            ; +0x16b, 0x1401c568b\nmov     eax, [rdx+20h]                                                 ; +0x16d, 0x1401c568d\nsub     eax, ecx                                                       ; +0x170, 0x1401c5690\nxor     ecx, ecx                                                       ; +0x172, 0x1401c5692\ncmp     eax, 1                                                         ; +0x174, 0x1401c5694\njle     short loc_1401C56AE                                            ; +0x177, 0x1401c5697\nnop     dword ptr [rax+00000000h]                                      ; +0x179, 0x1401c5699\ncmp     ecx, 7                                                         ; +0x180, 0x1401c56a0\njge     short loc_1401C56AE                                            ; +0x183, 0x1401c56a3\nshr     eax, 1                                                         ; +0x185, 0x1401c56a5\ninc     ecx                                                            ; +0x187, 0x1401c56a7\ncmp     eax, 1                                                         ; +0x189, 0x1401c56a9\nja      short loc_1401C56A0                                            ; +0x18c, 0x1401c56ac\nmovsxd  rax, ecx                                                       ; +0x18e, 0x1401c56ae\ninc     dword ptr [rdx+rax*4+40h]                                      ; +0x191, 0x1401c56b1\nmov     eax, [rdx+20h]                                                 ; +0x195, 0x1401c56b5\nmov     [rdx+60h], eax                                                 ; +0x198, 0x1401c56b8\nmov     rcx, rdi                                                       ; +0x19b, 0x1401c56bb\ncall    EditorUI__updateButtons                                        ; +0x19e, 0x1401c56be\nmov     rcx, rdi                                                       ; +0x1a3, 0x1401c56c3\ncall    EditorUI__updateObjectInfoLabel                                ; +0x1a6, 0x1401c56c6\nnop                                                                    ; +0x1ab, 0x1401c56cb\nlea     rcx, [rsp+88h+var_30]                                          ; +0x1ac, 0x1401c56cc\ncall    sub_14003D310                                                  ; +0x1b1, 0x1401c56d1\nmov     rcx, [rsp+88h+var_10]                                          ; +0x1b6, 0x1401c56d6\nxor     rcx, rsp; StackCookie                                          ; +0x1bb, 0x1401c56db\ncall    __security_check_cookie                                        ; +0x1be, 0x1401c56de\nlea     r11, [rsp+88h+var_8]                                           ; +0x1c3, 0x1401c56e3\nmov     rbx, [r11+18h]                                                 ; +0x1cb, 0x1401c56eb\nmov     rsi, [r11+20h]                                                 ; +0x1cf, 0x1401c56ef\nmov     rsp, r11                                                       ; +0x1d3, 0x1401c56f3\npop     rdi                                                            ; +0x1d6, 0x1401c56f6\nretn                                                                   ; +0x1d7, 0x1401c56f7", "xrefs": ["EditorUI::startFreeMoveTouch @ 0x1401bfb87", "EditorUI::handleEditorAction @ 0x1401c23ec", "EditorUI::init @ 0x1401ab48e", "<???> @ 0x14091a720", "<???> @ 0x14091a72c"], "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"}