{"type": "func", "start": 5369834624, "end": 5369835008, "name": "EditorUI::onDuplicate", "pseudocode": "// \n// EditorUI::onDuplicate from 0x140112c80 to 0x140112e00 (384 bytes)\n// \n// 4 xrefs:\n// > EditorUI::ccTouchBegan @ 0x140123ae8\n// > EditorUI::keyDown @ 0x1401254ac\n// > EditorUI::init @ 0x1400e0b3e\n// > <???> @ 0x1406c9078\n// \n// This function is hookable on this platform!\n// \n// Using BromaIDA 8.0.0 @ https://github.com/Stazzical/BromaIDA\n// Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings\n// \n\n// Hidden C++ exception states: #wind=1\nvoid EditorUI::onDuplicate(EditorUI *a1, cocos2d::CCObject *a2)\n{\n  int v3; // ebx\n  int v4; // eax\n  __int64 v5; // rcx\n  cocos2d::CCArray *m_selectedObjects; // rbx\n  __int64 v7; // rax\n  char v8; // [rsp+20h] [rbp-68h]\n  _BYTE v9[32]; // [rsp+38h] [rbp-50h] BYREF\n  _BYTE v10[32]; // [rsp+58h] [rbp-30h] BYREF\n\n  if ( !a1->m_selectedObject && !cocos2d::CCArray::count(a1->m_selectedObjects) )\n    return;\n  v3 = a1->m_editorLayer->m_objectCount.random - a1->m_editorLayer->m_objectCount.seed;\n  v4 = v3 + cocos2d::CCArray::count(a1->m_selectedObjects);\n  if ( v4 > 80000 )\n  {\n    if ( !a1->m_editorLayer->m_level->m_unlimitedObjectsEnabled )\n    {\n      EditorUI::showMaxError(a1);\n      return;\n    }\nLABEL_7:\n    if ( !a1->m_editorLayer->m_level->m_highObjectsEnabled )\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(a1->m_selectedObjects) )\n  {\n    m_selectedObjects = a1->m_selectedObjects;\n  }\n  else\n  {\n    m_selectedObjects = (cocos2d::CCArray *)cocos2d::CCArray::create(v5);\n    cocos2d::CCArray::addObject(m_selectedObjects, a1->m_selectedObject);\n  }\n  v8 = 0;\n  EditorUI::copyObjects(a1, v10, m_selectedObjects, 0, v8);\n  a1->m_editorLayer->m_keepEditorLayer = 1;\n  v7 = sub_14003BDB0((__int64)v9, (__int64)v10);\n  EditorUI::pasteObjects(a1, v7, 0, 0);\n  a1->m_editorLayer->m_keepEditorLayer = 0;\n  EditorUI::updateButtons(a1);\n  EditorUI::updateObjectInfoLabel(a1);\n  sub_14003A830((__int64)v10);\n}", "assembly": "; \n; EditorUI::onDuplicate from 0x140112c80 to 0x140112e00 (384 bytes)\n; \n; 4 xrefs:\n; > EditorUI::ccTouchBegan @ 0x140123ae8\n; > EditorUI::keyDown @ 0x1401254ac\n; > EditorUI::init @ 0x1400e0b3e\n; > <???> @ 0x1406c9078\n; \n; This function is hookable on this platform!\n; \n; Using BromaIDA 8.0.0 @ https:;github.com/Stazzical/BromaIDA\n; Using bindings at commit ba9f177b at Thu Jul 16 22:52:06 2026 from https:;github.com/geode-sdk/bindings\n; \n\nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x140112c80\nmov     [rsp+arg_10], rsi                                              ; +0x5, 0x140112c85\npush    rdi                                                            ; +0xa, 0x140112c8a\nsub     rsp, 80h                                                       ; +0xb, 0x140112c8b\nmov     rax, cs:__security_cookie                                      ; +0x12, 0x140112c92\nxor     rax, rsp                                                       ; +0x19, 0x140112c99\nmov     [rsp+88h+var_10], rax                                          ; +0x1c, 0x140112c9c\nmov     rdi, rcx                                                       ; +0x21, 0x140112ca1\ncmp     qword ptr [rcx+538h], 0                                        ; +0x24, 0x140112ca4\njnz     short loc_140112CC3                                            ; +0x2c, 0x140112cac\nmov     rcx, [rcx+340h]                                                ; +0x2e, 0x140112cae\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x35, 0x140112cb5\ntest    eax, eax                                                       ; +0x3b, 0x140112cbb\njz      loc_140112DDE                                                  ; +0x3d, 0x140112cbd\nmov     rax, [rdi+500h]                                                ; +0x43, 0x140112cc3\nmov     ebx, [rax+38B8h]                                               ; +0x4a, 0x140112cca\nsub     ebx, [rax+38BCh]                                               ; +0x50, 0x140112cd0\nmov     rcx, [rdi+340h]                                                ; +0x56, 0x140112cd6\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x5d, 0x140112cdd\nadd     eax, ebx                                                       ; +0x63, 0x140112ce3\ncmp     eax, 13880h                                                    ; +0x65, 0x140112ce5\njle     short loc_140112D10                                            ; +0x6a, 0x140112cea\nmov     rax, [rdi+500h]                                                ; +0x6c, 0x140112cec\nmov     rdx, [rax+878h]                                                ; +0x73, 0x140112cf3\ncmp     byte ptr [rdx+4A1h], 0                                         ; +0x7a, 0x140112cfa\njnz     short loc_140112D17                                            ; +0x81, 0x140112d01\nmov     rcx, rdi                                                       ; +0x83, 0x140112d03\ncall    EditorUI__showMaxError                                         ; +0x86, 0x140112d06\njmp     loc_140112DDE                                                  ; +0x8b, 0x140112d0b\ncmp     eax, 9C40h                                                     ; +0x90, 0x140112d10\njle     short loc_140112D3B                                            ; +0x95, 0x140112d15\nmov     rax, [rdi+500h]                                                ; +0x97, 0x140112d17\nmov     rcx, [rax+878h]                                                ; +0x9e, 0x140112d1e\ncmp     byte ptr [rcx+4A0h], 0                                         ; +0xa5, 0x140112d25\njnz     short loc_140112D3B                                            ; +0xac, 0x140112d2c\nmov     rcx, rdi                                                       ; +0xae, 0x140112d2e\ncall    EditorUI__showMaxBasicError                                    ; +0xb1, 0x140112d31\njmp     loc_140112DDE                                                  ; +0xb6, 0x140112d36\nmov     rcx, [rdi+340h]                                                ; +0xbb, 0x140112d3b\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xc2, 0x140112d42\ntest    eax, eax                                                       ; +0xc8, 0x140112d48\njnz     short loc_140112D67                                            ; +0xca, 0x140112d4a\ncall    cs:?create@CCArray@cocos2d@@SAPEAV12@XZ; cocos2d::CCArray::create(void) ; +0xcc, 0x140112d4c\nmov     rbx, rax                                                       ; +0xd2, 0x140112d52\nmov     rdx, [rdi+538h]                                                ; +0xd5, 0x140112d55\nmov     rcx, rax                                                       ; +0xdc, 0x140112d5c\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xdf, 0x140112d5f\njmp     short loc_140112D6E                                            ; +0xe5, 0x140112d65\nmov     rbx, [rdi+340h]                                                ; +0xe7, 0x140112d67\nmov     [rsp+88h+var_68], 0                                            ; +0xee, 0x140112d6e\nxor     r9d, r9d                                                       ; +0xf3, 0x140112d73\nmov     r8, rbx                                                        ; +0xf6, 0x140112d76\nlea     rdx, [rsp+88h+var_30]                                          ; +0xf9, 0x140112d79\nmov     rcx, rdi                                                       ; +0xfe, 0x140112d7e\ncall    EditorUI__copyObjects                                          ; +0x101, 0x140112d81\nnop                                                                    ; +0x106, 0x140112d86\nmov     rax, [rdi+500h]                                                ; +0x107, 0x140112d87\nmov     byte ptr [rax+3840h], 1                                        ; +0x10e, 0x140112d8e\nlea     rdx, [rsp+88h+var_30]                                          ; +0x115, 0x140112d95\nlea     rcx, [rsp+88h+var_50]                                          ; +0x11a, 0x140112d9a\ncall    sub_14003BDB0                                                  ; +0x11f, 0x140112d9f\nxor     r9d, r9d                                                       ; +0x124, 0x140112da4\nxor     r8d, r8d                                                       ; +0x127, 0x140112da7\nmov     rdx, rax                                                       ; +0x12a, 0x140112daa\nmov     rcx, rdi                                                       ; +0x12d, 0x140112dad\ncall    EditorUI__pasteObjects                                         ; +0x130, 0x140112db0\nmov     rax, [rdi+500h]                                                ; +0x135, 0x140112db5\nmov     byte ptr [rax+3840h], 0                                        ; +0x13c, 0x140112dbc\nmov     rcx, rdi                                                       ; +0x143, 0x140112dc3\ncall    EditorUI__updateButtons                                        ; +0x146, 0x140112dc6\nmov     rcx, rdi                                                       ; +0x14b, 0x140112dcb\ncall    EditorUI__updateObjectInfoLabel                                ; +0x14e, 0x140112dce\nnop                                                                    ; +0x153, 0x140112dd3\nlea     rcx, [rsp+88h+var_30]                                          ; +0x154, 0x140112dd4\ncall    sub_14003A830                                                  ; +0x159, 0x140112dd9\nmov     rcx, [rsp+88h+var_10]                                          ; +0x15e, 0x140112dde\nxor     rcx, rsp; StackCookie                                          ; +0x163, 0x140112de3\ncall    __security_check_cookie                                        ; +0x166, 0x140112de6\nlea     r11, [rsp+88h+var_8]                                           ; +0x16b, 0x140112deb\nmov     rbx, [r11+18h]                                                 ; +0x173, 0x140112df3\nmov     rsi, [r11+20h]                                                 ; +0x177, 0x140112df7\nmov     rsp, r11                                                       ; +0x17b, 0x140112dfb\npop     rdi                                                            ; +0x17e, 0x140112dfe\nretn                                                                   ; +0x17f, 0x140112dff", "xrefs": ["EditorUI::ccTouchBegan @ 0x140123ae8", "EditorUI::keyDown @ 0x1401254ac", "EditorUI::init @ 0x1400e0b3e", "<???> @ 0x1406c9078"], "is_objc": false, "is_arm32": false, "is_arm64": false, "bida_info": "8.0.0 @ https://github.com/Stazzical/BromaIDA", "bindings_info": "commit ba9f177b at Thu Jul 16 22:52:06 2026 from https://github.com/geode-sdk/bindings"}