{"type": "func", "start": 4300955040, "end": 4300955450, "name": "EditorUI::onDuplicate", "pseudocode": "// \n// EditorUI::onDuplicate from 0x1005b5da0 to 0x1005b5f3a (410 bytes)\n// \n// 3 xrefs:\n// > EditorUI::startFreeMoveTouch @ 0x10060998e\n// > EditorUI::handleEditorAction @ 0x10060c6a2\n// > EditorUI::init @ 0x100006a9e\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:32:41 +0000\n// \n\nvoid __fastcall EditorUI::onDuplicate(_QWORD *a1)\n{\n  _QWORD *v1; // rbx\n  __int64 v2; // rax\n  int v3; // r14d\n  int v4; // eax\n  __int64 v5; // rax\n  __int64 v6; // rdi\n  __int64 v7; // r14\n  __int64 v8; // rdi\n  __int64 v9; // rdx\n  __int128 v10; // [rsp+0h] [rbp-40h] BYREF\n  void *__p; // [rsp+10h] [rbp-30h]\n  __int128 v12; // [rsp+18h] [rbp-28h] BYREF\n  void *v13; // [rsp+28h] [rbp-18h]\n\n  v1 = a1;\n  if ( !a1[187] )\n  {\n    a1 = (_QWORD *)a1[112];\n    if ( !(unsigned int)sub_1007FEF90(a1) )\n      return;\n  }\n  v2 = EditorSFXManager::sharedState(a1);\n  EditorSFXManager::playAction_1(v2, 103);\n  v3 = *(_DWORD *)(v1[180] + 14272LL) - *(_DWORD *)(v1[180] + 14276LL);\n  v4 = v3 + sub_1007FEF90(v1[112]);\n  if ( v4 >= 80001 )\n  {\n    v5 = *(_QWORD *)(v1[180] + 1936LL);\n    if ( !*(_BYTE *)(v5 + 1201) )\n    {\n      EditorUI::showMaxError((__int64)v1);\n      return;\n    }\nLABEL_8:\n    if ( !*(_BYTE *)(v5 + 1200) )\n    {\n      EditorUI::showMaxBasicError((__int64)v1);\n      return;\n    }\n    goto LABEL_9;\n  }\n  if ( v4 >= 40001 )\n  {\n    v5 = *(_QWORD *)(v1[180] + 1936LL);\n    goto LABEL_8;\n  }\nLABEL_9:\n  v6 = v1[112];\n  if ( (unsigned int)sub_1007FEF90(v6) )\n  {\n    v7 = v1[112];\n  }\n  else\n  {\n    v7 = sub_1007FE900(v6);\n    sub_1007FEBF0(v7, v1[187]);\n  }\n  EditorUI::copyObjects(&v12, v1, v7, 0, 0);\n  *(_BYTE *)(v1[180] + 14152LL) = 1;\n  if ( (v12 & 1) != 0 )\n  {\n    sub_10001AD30(&v10, v13, *((unsigned __int64 *)&v12 + 1));\n  }\n  else\n  {\n    __p = v13;\n    v10 = v12;\n  }\n  EditorUI::pasteObjects(v1, &v10, 0, 0);\n  if ( (v10 & 1) != 0 )\n    operator delete(__p);\n  v8 = v1[180];\n  *(_BYTE *)(v8 + 14152) = 0;\n  EditorBuildStats::noteAction(v8 + 14704);\n  EditorUI::updateButtons((__int64)v1);\n  EditorUI::updateObjectInfoLabel((__int64)v1, (__int64)&v10, v9);\n  if ( (v12 & 1) != 0 )\n    operator delete(v13);\n}", "assembly": "; \n; EditorUI::onDuplicate from 0x1005b5da0 to 0x1005b5f3a (410 bytes)\n; \n; 3 xrefs:\n; > EditorUI::startFreeMoveTouch @ 0x10060998e\n; > EditorUI::handleEditorAction @ 0x10060c6a2\n; > EditorUI::init @ 0x100006a9e\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:32:41 +0000\n; \npush    rbp                                                            ; +0x0, 0x1005b5da0\nmov     rbp, rsp                                                       ; +0x1, 0x1005b5da1\npush    r14                                                            ; +0x4, 0x1005b5da4\npush    rbx                                                            ; +0x6, 0x1005b5da6\nsub     rsp, 30h                                                       ; +0x7, 0x1005b5da7\nmov     rbx, rdi                                                       ; +0xb, 0x1005b5dab\ncmp     qword ptr [rdi+5D8h], 0                                        ; +0xe, 0x1005b5dae\njnz     short loc_1005B5DCC                                            ; +0x16, 0x1005b5db6\nmov     rdi, [rbx+380h]                                                ; +0x18, 0x1005b5db8\ncall    sub_1007FEF90                                                  ; +0x1f, 0x1005b5dbf\ntest    eax, eax                                                       ; +0x24, 0x1005b5dc4\njz      loc_1005B5F31                                                  ; +0x26, 0x1005b5dc6\ncall    EditorSFXManager__sharedState                                  ; +0x2c, 0x1005b5dcc\nmov     rdi, rax                                                       ; +0x31, 0x1005b5dd1\nmov     esi, 67h ; 'g'                                                 ; +0x34, 0x1005b5dd4\ncall    EditorSFXManager__playAction_1                                 ; +0x39, 0x1005b5dd9\nmov     rax, [rbx+5A0h]                                                ; +0x3e, 0x1005b5dde\nmov     r14d, [rax+37C0h]                                              ; +0x45, 0x1005b5de5\nsub     r14d, [rax+37C4h]                                              ; +0x4c, 0x1005b5dec\nmov     rdi, [rbx+380h]                                                ; +0x53, 0x1005b5df3\ncall    sub_1007FEF90                                                  ; +0x5a, 0x1005b5dfa\nadd     eax, r14d                                                      ; +0x5f, 0x1005b5dff\ncmp     eax, 13881h                                                    ; +0x62, 0x1005b5e02\njl      short loc_1005B5E30                                            ; +0x67, 0x1005b5e07\nmov     rax, [rbx+5A0h]                                                ; +0x69, 0x1005b5e09\nmov     rax, [rax+790h]                                                ; +0x70, 0x1005b5e10\ncmp     byte ptr [rax+4B1h], 0                                         ; +0x77, 0x1005b5e17\njnz     short loc_1005B5E45                                            ; +0x7e, 0x1005b5e1e\nmov     rdi, rbx                                                       ; +0x80, 0x1005b5e20\nadd     rsp, 30h                                                       ; +0x83, 0x1005b5e23\npop     rbx                                                            ; +0x87, 0x1005b5e27\npop     r14                                                            ; +0x88, 0x1005b5e28\npop     rbp                                                            ; +0x8a, 0x1005b5e2a\njmp     EditorUI__showMaxError                                         ; +0x8b, 0x1005b5e2b\ncmp     eax, 9C41h                                                     ; +0x90, 0x1005b5e30\njl      short loc_1005B5E4E                                            ; +0x95, 0x1005b5e35\nmov     rax, [rbx+5A0h]                                                ; +0x97, 0x1005b5e37\nmov     rax, [rax+790h]                                                ; +0x9e, 0x1005b5e3e\ncmp     byte ptr [rax+4B0h], 0                                         ; +0xa5, 0x1005b5e45\njz      short loc_1005B5E67                                            ; +0xac, 0x1005b5e4c\nmov     rdi, [rbx+380h]                                                ; +0xae, 0x1005b5e4e\ncall    sub_1007FEF90                                                  ; +0xb5, 0x1005b5e55\ntest    eax, eax                                                       ; +0xba, 0x1005b5e5a\njz      short loc_1005B5E77                                            ; +0xbc, 0x1005b5e5c\nmov     r14, [rbx+380h]                                                ; +0xbe, 0x1005b5e5e\njmp     short loc_1005B5E8E                                            ; +0xc5, 0x1005b5e65\nmov     rdi, rbx                                                       ; +0xc7, 0x1005b5e67\nadd     rsp, 30h                                                       ; +0xca, 0x1005b5e6a\npop     rbx                                                            ; +0xce, 0x1005b5e6e\npop     r14                                                            ; +0xcf, 0x1005b5e6f\npop     rbp                                                            ; +0xd1, 0x1005b5e71\njmp     EditorUI__showMaxBasicError                                    ; +0xd2, 0x1005b5e72\ncall    sub_1007FE900                                                  ; +0xd7, 0x1005b5e77\nmov     r14, rax                                                       ; +0xdc, 0x1005b5e7c\nmov     rsi, [rbx+5D8h]                                                ; +0xdf, 0x1005b5e7f\nmov     rdi, rax                                                       ; +0xe6, 0x1005b5e86\ncall    sub_1007FEBF0                                                  ; +0xe9, 0x1005b5e89\nlea     rdi, [rbp+var_28]                                              ; +0xee, 0x1005b5e8e\nmov     rsi, rbx                                                       ; +0xf2, 0x1005b5e92\nmov     rdx, r14                                                       ; +0xf5, 0x1005b5e95\nxor     ecx, ecx                                                       ; +0xf8, 0x1005b5e98\nxor     r8d, r8d                                                       ; +0xfa, 0x1005b5e9a\ncall    EditorUI__copyObjects                                          ; +0xfd, 0x1005b5e9d\nmov     rax, [rbx+5A0h]                                                ; +0x102, 0x1005b5ea2\nmov     byte ptr [rax+3748h], 1                                        ; +0x109, 0x1005b5ea9\ntest    byte ptr [rbp+var_28], 1                                       ; +0x110, 0x1005b5eb0\njnz     short loc_1005B5EC8                                            ; +0x114, 0x1005b5eb4\nmov     rax, [rbp+var_18]                                              ; +0x116, 0x1005b5eb6\nmov     [rbp+__p], rax                                                 ; +0x11a, 0x1005b5eba\nmovups  xmm0, [rbp+var_28]                                             ; +0x11e, 0x1005b5ebe\nmovaps  [rbp+var_40], xmm0                                             ; +0x122, 0x1005b5ec2\njmp     short loc_1005B5ED9                                            ; +0x126, 0x1005b5ec6\nmov     rdx, qword ptr [rbp+var_28+8]                                  ; +0x128, 0x1005b5ec8\nmov     rsi, [rbp+var_18]                                              ; +0x12c, 0x1005b5ecc\nlea     rdi, [rbp+var_40]                                              ; +0x130, 0x1005b5ed0\ncall    sub_10001AD30                                                  ; +0x134, 0x1005b5ed4\nlea     rsi, [rbp+var_40]                                              ; +0x139, 0x1005b5ed9\nmov     rdi, rbx                                                       ; +0x13d, 0x1005b5edd\nxor     edx, edx                                                       ; +0x140, 0x1005b5ee0\nxor     ecx, ecx                                                       ; +0x142, 0x1005b5ee2\ncall    EditorUI__pasteObjects                                         ; +0x144, 0x1005b5ee4\ntest    byte ptr [rbp+var_40], 1                                       ; +0x149, 0x1005b5ee9\njz      short loc_1005B5EF8                                            ; +0x14d, 0x1005b5eed\nmov     rdi, [rbp+__p]; __p                                            ; +0x14f, 0x1005b5eef\ncall    __ZdlPv; operator delete(void *)                               ; +0x153, 0x1005b5ef3\nmov     rdi, [rbx+5A0h]                                                ; +0x158, 0x1005b5ef8\nmov     byte ptr [rdi+3748h], 0                                        ; +0x15f, 0x1005b5eff\nadd     rdi, 3970h                                                     ; +0x166, 0x1005b5f06\ncall    EditorBuildStats__noteAction                                   ; +0x16d, 0x1005b5f0d\nmov     rdi, rbx                                                       ; +0x172, 0x1005b5f12\ncall    EditorUI__updateButtons                                        ; +0x175, 0x1005b5f15\nmov     rdi, rbx                                                       ; +0x17a, 0x1005b5f1a\ncall    EditorUI__updateObjectInfoLabel                                ; +0x17d, 0x1005b5f1d\ntest    byte ptr [rbp+var_28], 1                                       ; +0x182, 0x1005b5f22\njz      short loc_1005B5F31                                            ; +0x186, 0x1005b5f26\nmov     rdi, [rbp+var_18]; __p                                         ; +0x188, 0x1005b5f28\ncall    __ZdlPv; operator delete(void *)                               ; +0x18c, 0x1005b5f2c\nadd     rsp, 30h                                                       ; +0x191, 0x1005b5f31\npop     rbx                                                            ; +0x195, 0x1005b5f35\npop     r14                                                            ; +0x196, 0x1005b5f36\npop     rbp                                                            ; +0x198, 0x1005b5f38\nretn                                                                   ; +0x199, 0x1005b5f39", "xrefs": ["EditorUI::startFreeMoveTouch @ 0x10060998e", "EditorUI::handleEditorAction @ 0x10060c6a2", "EditorUI::init @ 0x100006a9e"], "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"}