{"type": "func", "start": 4300963520, "end": 4300964068, "name": "EditorUI::doPasteObjects", "pseudocode": "// \n// EditorUI::doPasteObjects from 0x1005b7ec0 to 0x1005b80e4 (548 bytes)\n// \n// 3 xrefs:\n// > EditorUI::onPaste @ 0x1005b7e9e\n// > EditorUI::handleEditorAction @ 0x10060c035\n// > EditorCommandsPopup::onCommand @ 0x1008dee7a\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:42 +0000\n// \n\nvoid __fastcall EditorUI::doPasteObjects(__int64 a1, unsigned __int8 a2)\n{\n  __int64 v3; // rax\n  unsigned int v4; // ecx\n  int v5; // r15d\n  int v6; // r15d\n  __int64 v7; // rax\n  __int64 v8; // rax\n  std::string *v9; // rsi\n  __int64 v10; // r14\n  __int64 v11; // rax\n  __int64 v12; // r15\n  double v13; // xmm0_8\n  __m128 v14; // xmm2\n  float v15; // xmm1_4\n  __int64 v16; // rdx\n  __int64 v17; // [rsp+0h] [rbp-60h] BYREF\n  __int64 v18; // [rsp+8h] [rbp-58h] BYREF\n  std::string v19; // [rsp+10h] [rbp-50h] BYREF\n  __int64 v20; // [rsp+28h] [rbp-38h] BYREF\n  unsigned int v21[12]; // [rsp+30h] [rbp-30h] BYREF\n\n  v3 = GameManager::sharedState();\n  v4 = *(unsigned __int8 *)(v3 + 512);\n  if ( (v4 & 1) != 0 )\n  {\n    if ( !*(_QWORD *)(v3 + 520) )\n      return;\n  }\n  else if ( !(v4 >> 1) )\n  {\n    return;\n  }\n  v5 = *(_DWORD *)(*(_QWORD *)(a1 + 1440) + 14272LL) - *(_DWORD *)(*(_QWORD *)(a1 + 1440) + 14276LL);\n  v6 = *(_DWORD *)(GameManager::sharedState() + 536) + v5;\n  if ( v6 >= 80001 )\n  {\n    v7 = *(_QWORD *)(*(_QWORD *)(a1 + 1440) + 1936LL);\n    if ( !*(_BYTE *)(v7 + 1201) )\n    {\n      EditorUI::showMaxError(a1);\n      return;\n    }\nLABEL_10:\n    if ( !*(_BYTE *)(v7 + 1200) )\n    {\n      EditorUI::showMaxBasicError(a1);\n      return;\n    }\n    goto LABEL_11;\n  }\n  if ( v6 >= 40001 )\n  {\n    v7 = *(_QWORD *)(*(_QWORD *)(a1 + 1440) + 1936LL);\n    goto LABEL_10;\n  }\nLABEL_11:\n  v8 = GameManager::sharedState();\n  if ( (*(_BYTE *)(v8 + 512) & 1) != 0 )\n    sub_10001AD30(&v19, *(const void **)(v8 + 528), *(_QWORD *)(v8 + 520));\n  else\n    v19 = *(std::string *)(v8 + 512);\n  v9 = &v19;\n  v10 = EditorUI::pasteObjects((_QWORD *)a1, &v19, a2, 0);\n  if ( (*(_BYTE *)&v19.__r_.__value_.__s.0 & 1) != 0 )\n    operator delete(v19.__r_.__value_.__l.__data_);\n  EditorBuildStats::noteAction(*(_QWORD *)(a1 + 1440) + 14704LL);\n  if ( v10 )\n  {\n    if ( (unsigned int)sub_1007FEF90(v10) )\n    {\n      v11 = cocos2d::CCDirector::sharedDirector();\n      cocos2d::CCDirector::getWinSize(&v20, v11);\n      v12 = *(_QWORD *)(*(_QWORD *)(a1 + 1440) + 3920LL);\n      *(_QWORD *)&v13 = (unsigned int)v20;\n      *(float *)&v13 = *(float *)&v20 * 0.5;\n      v14 = (__m128)HIDWORD(v20);\n      v14.f32[0] = *((float *)&v20 + 1) * 0.5;\n      v15 = (float)(0.5 * *(float *)(a1 + 856)) + (float)(*((float *)&v20 + 1) * 0.5);\n      sub_100278250((float *)v21, *(float *)&v20 * 0.5, v15);\n      cocos2d::CCNode::convertToNodeSpace((double *)&v17, v12, v21);\n      sub_1002782D0(&v18, &v17);\n      EditorUI::getGridSnappedPos(\n        (__int64)v21,\n        a1,\n        (unsigned int *)&v18,\n        v13,\n        COERCE_DOUBLE((unsigned __int64)LODWORD(v15)),\n        v14);\n      sub_100278300(&v17, v21);\n      sub_1002782D0(v21, &v17);\n      v9 = (std::string *)v10;\n      EditorUI::repositionObjectsToCenter(a1, v10, v21, 0);\n    }\n  }\n  EditorUI::updateButtons(a1);\n  EditorUI::updateObjectInfoLabel(a1, (__int64)v9, v16);\n}", "assembly": "; \n; EditorUI::doPasteObjects from 0x1005b7ec0 to 0x1005b80e4 (548 bytes)\n; \n; 3 xrefs:\n; > EditorUI::onPaste @ 0x1005b7e9e\n; > EditorUI::handleEditorAction @ 0x10060c035\n; > EditorCommandsPopup::onCommand @ 0x1008dee7a\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:42 +0000\n; \npush    rbp                                                            ; +0x0, 0x1005b7ec0\nmov     rbp, rsp                                                       ; +0x1, 0x1005b7ec1\npush    r15                                                            ; +0x4, 0x1005b7ec4\npush    r14                                                            ; +0x6, 0x1005b7ec6\npush    r13                                                            ; +0x8, 0x1005b7ec8\npush    r12                                                            ; +0xa, 0x1005b7eca\npush    rbx                                                            ; +0xc, 0x1005b7ecc\nsub     rsp, 38h                                                       ; +0xd, 0x1005b7ecd\nmov     r14d, esi                                                      ; +0x11, 0x1005b7ed1\nmov     rbx, rdi                                                       ; +0x14, 0x1005b7ed4\ncall    GameManager__sharedState                                       ; +0x17, 0x1005b7ed7\nmovzx   ecx, byte ptr [rax+200h]                                       ; +0x1c, 0x1005b7edc\ntest    cl, 1                                                          ; +0x23, 0x1005b7ee3\njnz     short loc_1005B7EF4                                            ; +0x26, 0x1005b7ee6\nshr     ecx, 1                                                         ; +0x28, 0x1005b7ee8\ntest    rcx, rcx                                                       ; +0x2a, 0x1005b7eea\njnz     short loc_1005B7F04                                            ; +0x2d, 0x1005b7eed\njmp     loc_1005B80D5                                                  ; +0x2f, 0x1005b7eef\nmov     rcx, [rax+208h]                                                ; +0x34, 0x1005b7ef4\ntest    rcx, rcx                                                       ; +0x3b, 0x1005b7efb\njz      loc_1005B80D5                                                  ; +0x3e, 0x1005b7efe\nmov     rax, [rbx+5A0h]                                                ; +0x44, 0x1005b7f04\nmov     r15d, [rax+37C0h]                                              ; +0x4b, 0x1005b7f0b\nsub     r15d, [rax+37C4h]                                              ; +0x52, 0x1005b7f12\ncall    GameManager__sharedState                                       ; +0x59, 0x1005b7f19\nadd     r15d, [rax+218h]                                               ; +0x5e, 0x1005b7f1e\ncmp     r15d, 13881h                                                   ; +0x65, 0x1005b7f25\njl      short loc_1005B7F5B                                            ; +0x6c, 0x1005b7f2c\nmov     rax, [rbx+5A0h]                                                ; +0x6e, 0x1005b7f2e\nmov     rax, [rax+790h]                                                ; +0x75, 0x1005b7f35\ncmp     byte ptr [rax+4B1h], 0                                         ; +0x7c, 0x1005b7f3c\njnz     short loc_1005B7F72                                            ; +0x83, 0x1005b7f43\nmov     rdi, rbx                                                       ; +0x85, 0x1005b7f45\nadd     rsp, 38h                                                       ; +0x88, 0x1005b7f48\npop     rbx                                                            ; +0x8c, 0x1005b7f4c\npop     r12                                                            ; +0x8d, 0x1005b7f4d\npop     r13                                                            ; +0x8f, 0x1005b7f4f\npop     r14                                                            ; +0x91, 0x1005b7f51\npop     r15                                                            ; +0x93, 0x1005b7f53\npop     rbp                                                            ; +0x95, 0x1005b7f55\njmp     EditorUI__showMaxError                                         ; +0x96, 0x1005b7f56\ncmp     r15d, 9C41h                                                    ; +0x9b, 0x1005b7f5b\njl      short loc_1005B7F7B                                            ; +0xa2, 0x1005b7f62\nmov     rax, [rbx+5A0h]                                                ; +0xa4, 0x1005b7f64\nmov     rax, [rax+790h]                                                ; +0xab, 0x1005b7f6b\ncmp     byte ptr [rax+4B0h], 0                                         ; +0xb2, 0x1005b7f72\njz      short loc_1005B7FA0                                            ; +0xb9, 0x1005b7f79\ncall    GameManager__sharedState                                       ; +0xbb, 0x1005b7f7b\ntest    byte ptr [rax+200h], 1                                         ; +0xc0, 0x1005b7f80\njnz     short loc_1005B7FB6                                            ; +0xc7, 0x1005b7f87\nadd     rax, 200h                                                      ; +0xc9, 0x1005b7f89\nmov     rcx, [rax+10h]                                                 ; +0xcf, 0x1005b7f8f\nmov     [rbp+__p], rcx                                                 ; +0xd3, 0x1005b7f93\nmovups  xmm0, xmmword ptr [rax]                                        ; +0xd7, 0x1005b7f97\nmovaps  [rbp+var_50], xmm0                                             ; +0xda, 0x1005b7f9a\njmp     short loc_1005B7FCD                                            ; +0xde, 0x1005b7f9e\nmov     rdi, rbx                                                       ; +0xe0, 0x1005b7fa0\nadd     rsp, 38h                                                       ; +0xe3, 0x1005b7fa3\npop     rbx                                                            ; +0xe7, 0x1005b7fa7\npop     r12                                                            ; +0xe8, 0x1005b7fa8\npop     r13                                                            ; +0xea, 0x1005b7faa\npop     r14                                                            ; +0xec, 0x1005b7fac\npop     r15                                                            ; +0xee, 0x1005b7fae\npop     rbp                                                            ; +0xf0, 0x1005b7fb0\njmp     EditorUI__showMaxBasicError                                    ; +0xf1, 0x1005b7fb1\nmov     rdx, [rax+208h]                                                ; +0xf6, 0x1005b7fb6\nmov     rsi, [rax+210h]                                                ; +0xfd, 0x1005b7fbd\nlea     rdi, [rbp+var_50]                                              ; +0x104, 0x1005b7fc4\ncall    sub_10001AD30                                                  ; +0x108, 0x1005b7fc8\nmovzx   edx, r14b                                                      ; +0x10d, 0x1005b7fcd\nlea     rsi, [rbp+var_50]                                              ; +0x111, 0x1005b7fd1\nmov     rdi, rbx                                                       ; +0x115, 0x1005b7fd5\nxor     ecx, ecx                                                       ; +0x118, 0x1005b7fd8\ncall    EditorUI__pasteObjects                                         ; +0x11a, 0x1005b7fda\nmov     r14, rax                                                       ; +0x11f, 0x1005b7fdf\ntest    byte ptr [rbp+var_50], 1                                       ; +0x122, 0x1005b7fe2\njz      short loc_1005B7FF1                                            ; +0x126, 0x1005b7fe6\nmov     rdi, [rbp+__p]; __p                                            ; +0x128, 0x1005b7fe8\ncall    __ZdlPv; operator delete(void *)                               ; +0x12c, 0x1005b7fec\nmov     edi, 3970h                                                     ; +0x131, 0x1005b7ff1\nadd     rdi, [rbx+5A0h]                                                ; +0x136, 0x1005b7ff6\ncall    EditorBuildStats__noteAction                                   ; +0x13d, 0x1005b7ffd\ntest    r14, r14                                                       ; +0x142, 0x1005b8002\njz      loc_1005B80C5                                                  ; +0x145, 0x1005b8005\nmov     rdi, r14                                                       ; +0x14b, 0x1005b800b\ncall    sub_1007FEF90                                                  ; +0x14e, 0x1005b800e\ntest    eax, eax                                                       ; +0x153, 0x1005b8013\njz      loc_1005B80C5                                                  ; +0x155, 0x1005b8015\ncall    cocos2d__CCDirector__sharedDirector                            ; +0x15b, 0x1005b801b\nlea     rdi, [rbp+var_38]                                              ; +0x160, 0x1005b8020\nmov     rsi, rax                                                       ; +0x164, 0x1005b8024\ncall    cocos2d__CCDirector__getWinSize                                ; +0x167, 0x1005b8027\nmov     rax, [rbx+5A0h]                                                ; +0x16c, 0x1005b802c\nmov     r15, [rax+0F50h]                                               ; +0x173, 0x1005b8033\nmovss   xmm1, cs:dword_100A03578                                       ; +0x17a, 0x1005b803a\nmovss   xmm0, [rbp+var_38]                                             ; +0x182, 0x1005b8042\nmulss   xmm0, xmm1                                                     ; +0x187, 0x1005b8047\nmovss   xmm2, [rbp+var_34]                                             ; +0x18b, 0x1005b804b\nmulss   xmm2, xmm1                                                     ; +0x190, 0x1005b8050\nmulss   xmm1, dword ptr [rbx+358h]                                     ; +0x194, 0x1005b8054\naddss   xmm1, xmm2                                                     ; +0x19c, 0x1005b805c\nlea     r12, [rbp+var_30]                                              ; +0x1a0, 0x1005b8060\nmov     rdi, r12                                                       ; +0x1a4, 0x1005b8064\ncall    sub_100278250                                                  ; +0x1a7, 0x1005b8067\nlea     r13, [rbp+var_60]                                              ; +0x1ac, 0x1005b806c\nmov     rdi, r13                                                       ; +0x1b0, 0x1005b8070\nmov     rsi, r15                                                       ; +0x1b3, 0x1005b8073\nmov     rdx, r12                                                       ; +0x1b6, 0x1005b8076\ncall    cocos2d__CCNode__convertToNodeSpace                            ; +0x1b9, 0x1005b8079\nlea     r15, [rbp+var_58]                                              ; +0x1be, 0x1005b807e\nmov     rdi, r15                                                       ; +0x1c2, 0x1005b8082\nmov     rsi, r13                                                       ; +0x1c5, 0x1005b8085\ncall    sub_1002782D0                                                  ; +0x1c8, 0x1005b8088\nmov     rdi, r12                                                       ; +0x1cd, 0x1005b808d\nmov     rsi, rbx                                                       ; +0x1d0, 0x1005b8090\nmov     rdx, r15                                                       ; +0x1d3, 0x1005b8093\ncall    EditorUI__getGridSnappedPos                                    ; +0x1d6, 0x1005b8096\nmov     rdi, r13                                                       ; +0x1db, 0x1005b809b\nmov     rsi, r12                                                       ; +0x1de, 0x1005b809e\ncall    sub_100278300                                                  ; +0x1e1, 0x1005b80a1\nlea     r15, [rbp+var_30]                                              ; +0x1e6, 0x1005b80a6\nmov     rdi, r15                                                       ; +0x1ea, 0x1005b80aa\nmov     rsi, r13                                                       ; +0x1ed, 0x1005b80ad\ncall    sub_1002782D0                                                  ; +0x1f0, 0x1005b80b0\nmov     rdi, rbx                                                       ; +0x1f5, 0x1005b80b5\nmov     rsi, r14                                                       ; +0x1f8, 0x1005b80b8\nmov     rdx, r15                                                       ; +0x1fb, 0x1005b80bb\nxor     ecx, ecx                                                       ; +0x1fe, 0x1005b80be\ncall    EditorUI__repositionObjectsToCenter                            ; +0x200, 0x1005b80c0\nmov     rdi, rbx                                                       ; +0x205, 0x1005b80c5\ncall    EditorUI__updateButtons                                        ; +0x208, 0x1005b80c8\nmov     rdi, rbx                                                       ; +0x20d, 0x1005b80cd\ncall    EditorUI__updateObjectInfoLabel                                ; +0x210, 0x1005b80d0\nadd     rsp, 38h                                                       ; +0x215, 0x1005b80d5\npop     rbx                                                            ; +0x219, 0x1005b80d9\npop     r12                                                            ; +0x21a, 0x1005b80da\npop     r13                                                            ; +0x21c, 0x1005b80dc\npop     r14                                                            ; +0x21e, 0x1005b80de\npop     r15                                                            ; +0x220, 0x1005b80e0\npop     rbp                                                            ; +0x222, 0x1005b80e2\nretn                                                                   ; +0x223, 0x1005b80e3", "xrefs": ["EditorUI::onPaste @ 0x1005b7e9e", "EditorUI::handleEditorAction @ 0x10060c035", "EditorCommandsPopup::onCommand @ 0x1008dee7a"], "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"}