{"type": "func", "start": 5369836336, "end": 5369836972, "name": "EditorUI::doPasteObjects", "pseudocode": "// \n// EditorUI::doPasteObjects from 0x140113330 to 0x1401135ac (636 bytes)\n// \n// 4 xrefs:\n// > EditorPauseLayer::onPasteWColor @ 0x1400dcd50\n// > EditorUI::onPaste @ 0x140113322\n// > EditorUI::keyDown @ 0x14012554a\n// > <???> @ 0x1406c909c\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=3\nvoid EditorUI::doPasteObjects(EditorUI *a1, bool a2)\n{\n  __int64 v4; // r8\n  LevelEditorLayer *m_editorLayer; // rdx\n  int v6; // r9d\n  __int64 v7; // rax\n  cocos2d::CCArray *v8; // rax\n  cocos2d::CCArray *v9; // rsi\n  __int64 v10; // rcx\n  cocos2d::CCDirector *v11; // rax\n  cocos2d::CCLayer *m_objectLayer; // rbx\n  float *v13; // rax\n  float *v14; // rbx\n  float m_gridSize; // xmm7_4\n  float v16; // xmm6_4\n  float v17; // xmm0_4\n  cocos2d::CCPoint v18; // rax\n  cocos2d::CCPoint v19; // [rsp+20h] [rbp-78h] BYREF\n  cocos2d::CCPoint v20; // [rsp+28h] [rbp-70h] BYREF\n  cocos2d::CCPoint v21; // [rsp+30h] [rbp-68h] BYREF\n  _BYTE v22[56]; // [rsp+38h] [rbp-60h] BYREF\n  struct cocos2d::CCPoint v23; // [rsp+B0h] [rbp+18h] BYREF\n  float v24; // [rsp+B8h] [rbp+20h]\n  float v25; // [rsp+BCh] [rbp+24h]\n\n  v4 = qword_1406C2ED8;\n  if ( !qword_1406C2ED8 )\n  {\n    v23 = (struct cocos2d::CCPoint)operator new(0x668u);\n    qword_1406C2ED8 = ((__int64 (__fastcall *)(_QWORD))sub_14017AB00)(v23);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_1406C2ED8 + 72LL))(qword_1406C2ED8);\n    v4 = qword_1406C2ED8;\n  }\n  if ( *(_QWORD *)(v4 + 496) )\n  {\n    m_editorLayer = a1->m_editorLayer;\n    v6 = *(_DWORD *)(v4 + 512) + m_editorLayer->m_objectCount.random - m_editorLayer->m_objectCount.seed;\n    if ( v6 <= 80000 || m_editorLayer->m_level->m_unlimitedObjectsEnabled )\n    {\n      if ( v6 <= 40000 || m_editorLayer->m_level->m_highObjectsEnabled )\n      {\n        v7 = sub_14003BDB0((__int64)v22, v4 + 480);\n        v8 = (cocos2d::CCArray *)EditorUI::pasteObjects(a1, v7, a2, 0);\n        v9 = v8;\n        if ( v8 )\n        {\n          if ( cocos2d::CCArray::count(v8) )\n          {\n            v11 = (cocos2d::CCDirector *)cocos2d::CCDirector::sharedDirector(v10);\n            cocos2d::CCDirector::getWinSize(v11);\n            m_objectLayer = a1->m_editorLayer->m_objectLayer;\n            cocos2d::CCPoint::CCPoint(&v19, v24 * 0.5, (float)(a1->m_toolbarHeight * 0.5) + (float)(v25 * 0.5));\n            cocos2d::CCNode::convertToNodeSpace(m_objectLayer, &v23);\n            cocos2d::CCPoint::CCPoint(&v20, &v23);\n            v14 = v13;\n            m_gridSize = a1->m_editorLayer->m_drawGridLayer->m_gridSize;\n            v16 = (float)(floorf(*v13 / m_gridSize) + 0.5) * m_gridSize;\n            v17 = floorf(v14[1] / m_gridSize);\n            cocos2d::CCPoint::CCPoint(&v21, v16, (float)(v17 + 0.5) * m_gridSize);\n            EditorUI::getLimitedPosition(a1, (cocos2d::CCPoint)&v19);\n            cocos2d::CCPoint::operator=(&v23, &v19);\n            cocos2d::CCPoint::CCPoint(&v21, &v23);\n            EditorUI::repositionObjectsToCenter(a1, v9, v18, 0);\n          }\n        }\n        EditorUI::updateButtons(a1);\n        EditorUI::updateObjectInfoLabel(a1);\n      }\n      else\n      {\n        EditorUI::showMaxBasicError(a1);\n      }\n    }\n    else\n    {\n      EditorUI::showMaxError(a1);\n    }\n  }\n}", "assembly": "; \n; EditorUI::doPasteObjects from 0x140113330 to 0x1401135ac (636 bytes)\n; \n; 4 xrefs:\n; > EditorPauseLayer::onPasteWColor @ 0x1400dcd50\n; > EditorUI::onPaste @ 0x140113322\n; > EditorUI::keyDown @ 0x14012554a\n; > <???> @ 0x1406c909c\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     rax, rsp                                                       ; +0x0, 0x140113330\nmov     [rax+8], rbx                                                   ; +0x3, 0x140113333\nmov     [rax+10h], rsi                                                 ; +0x7, 0x140113337\npush    rdi                                                            ; +0xb, 0x14011333b\nsub     rsp, 90h                                                       ; +0xc, 0x14011333c\nmovaps  xmmword ptr [rax-18h], xmm6                                    ; +0x13, 0x140113343\nmovaps  xmmword ptr [rax-28h], xmm7                                    ; +0x17, 0x140113347\nmovaps  xmmword ptr [rax-38h], xmm8                                    ; +0x1b, 0x14011334b\nmovzx   ebx, dl                                                        ; +0x20, 0x140113350\nmov     rdi, rcx                                                       ; +0x23, 0x140113353\nmov     r8, cs:qword_1406C2ED8                                         ; +0x26, 0x140113356\ntest    r8, r8                                                         ; +0x2d, 0x14011335d\njnz     short loc_140113394                                            ; +0x30, 0x140113360\nmov     ecx, 668h; Size                                                ; +0x32, 0x140113362\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x37, 0x140113367\nmov     [rsp+98h+arg_10], rax                                          ; +0x3c, 0x14011336c\nmov     rcx, rax                                                       ; +0x44, 0x140113374\ncall    sub_14017AB00                                                  ; +0x47, 0x140113377\nnop                                                                    ; +0x4c, 0x14011337c\nmov     cs:qword_1406C2ED8, rax                                        ; +0x4d, 0x14011337d\nmov     rdx, [rax]                                                     ; +0x54, 0x140113384\nmov     rcx, rax                                                       ; +0x57, 0x140113387\ncall    qword ptr [rdx+48h]                                            ; +0x5a, 0x14011338a\nmov     r8, cs:qword_1406C2ED8                                         ; +0x5d, 0x14011338d\ncmp     qword ptr [r8+1F0h], 0                                         ; +0x64, 0x140113394\njz      loc_140113588                                                  ; +0x6c, 0x14011339c\nmov     rdx, [rdi+500h]                                                ; +0x72, 0x1401133a2\nmov     r9d, [rdx+38B8h]                                               ; +0x79, 0x1401133a9\nsub     r9d, [rdx+38BCh]                                               ; +0x80, 0x1401133b0\nadd     r9d, [r8+200h]                                                 ; +0x87, 0x1401133b7\ncmp     r9d, 13880h                                                    ; +0x8e, 0x1401133be\njle     short loc_1401133E4                                            ; +0x95, 0x1401133c5\nmov     rax, [rdx+878h]                                                ; +0x97, 0x1401133c7\ncmp     byte ptr [rax+4A1h], 0                                         ; +0x9e, 0x1401133ce\njnz     short loc_1401133E4                                            ; +0xa5, 0x1401133d5\nmov     rcx, rdi                                                       ; +0xa7, 0x1401133d7\ncall    EditorUI__showMaxError                                         ; +0xaa, 0x1401133da\njmp     loc_140113588                                                  ; +0xaf, 0x1401133df\ncmp     r9d, 9C40h                                                     ; +0xb4, 0x1401133e4\njle     short loc_14011340A                                            ; +0xbb, 0x1401133eb\nmov     rax, [rdx+878h]                                                ; +0xbd, 0x1401133ed\ncmp     byte ptr [rax+4A0h], 0                                         ; +0xc4, 0x1401133f4\njnz     short loc_14011340A                                            ; +0xcb, 0x1401133fb\nmov     rcx, rdi                                                       ; +0xcd, 0x1401133fd\ncall    EditorUI__showMaxBasicError                                    ; +0xd0, 0x140113400\njmp     loc_140113588                                                  ; +0xd5, 0x140113405\nlea     rdx, [r8+1E0h]                                                 ; +0xda, 0x14011340a\nlea     rcx, [rsp+98h+var_60]                                          ; +0xe1, 0x140113411\ncall    sub_14003BDB0                                                  ; +0xe6, 0x140113416\nxor     r9d, r9d                                                       ; +0xeb, 0x14011341b\nmovzx   r8d, bl                                                        ; +0xee, 0x14011341e\nmov     rdx, rax                                                       ; +0xf2, 0x140113422\nmov     rcx, rdi                                                       ; +0xf5, 0x140113425\ncall    EditorUI__pasteObjects                                         ; +0xf8, 0x140113428\nmov     rsi, rax                                                       ; +0xfd, 0x14011342d\ntest    rax, rax                                                       ; +0x100, 0x140113430\njz      loc_140113578                                                  ; +0x103, 0x140113433\nmov     rcx, rax                                                       ; +0x109, 0x140113439\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x10c, 0x14011343c\ntest    eax, eax                                                       ; +0x112, 0x140113442\njz      loc_140113578                                                  ; +0x114, 0x140113444\ncall    cs:?sharedDirector@CCDirector@cocos2d@@SAPEAV12@XZ; cocos2d::CCDirector::sharedDirector(void) ; +0x11a, 0x14011344a\nmov     rcx, rax                                                       ; +0x120, 0x140113450\nlea     rdx, [rsp+98h+arg_18]                                          ; +0x123, 0x140113453\ncall    cs:?getWinSize@CCDirector@cocos2d@@QEAA?AVCCSize@2@XZ; cocos2d::CCDirector::getWinSize(void) ; +0x12b, 0x14011345b\nmov     rcx, [rdi+500h]                                                ; +0x131, 0x140113461\nmov     rbx, [rcx+0FE8h]                                               ; +0x138, 0x140113468\nmovss   xmm2, dword ptr [rdi+318h]                                     ; +0x13f, 0x14011346f\nmovss   xmm8, cs:dword_140622B08                                       ; +0x147, 0x140113477\nmulss   xmm2, xmm8                                                     ; +0x150, 0x140113480\nmovss   xmm0, [rsp+98h+arg_1C]                                         ; +0x155, 0x140113485\nmulss   xmm0, xmm8                                                     ; +0x15e, 0x14011348e\naddss   xmm2, xmm0                                                     ; +0x163, 0x140113493\nmovss   xmm1, [rsp+98h+arg_18]                                         ; +0x167, 0x140113497\nmulss   xmm1, xmm8                                                     ; +0x170, 0x1401134a0\nlea     rcx, [rsp+98h+var_78]                                          ; +0x175, 0x1401134a5\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x17a, 0x1401134aa\nmov     r8, rax                                                        ; +0x180, 0x1401134b0\nlea     rdx, [rsp+98h+arg_10]                                          ; +0x183, 0x1401134b3\nmov     rcx, rbx                                                       ; +0x18b, 0x1401134bb\ncall    cs:?convertToNodeSpace@CCNode@cocos2d@@QEAA?AVCCPoint@2@AEBV32@@Z; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const &) ; +0x18e, 0x1401134be\nlea     rdx, [rsp+98h+arg_10]                                          ; +0x194, 0x1401134c4\nlea     rcx, [rsp+98h+var_70]                                          ; +0x19c, 0x1401134cc\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x1a1, 0x1401134d1\nmov     rbx, rax                                                       ; +0x1a7, 0x1401134d7\nmov     rcx, [rdi+500h]                                                ; +0x1aa, 0x1401134da\nmov     rdx, [rcx+38C8h]                                               ; +0x1b1, 0x1401134e1\nmovss   xmm7, dword ptr [rdx+27Ch]                                     ; +0x1b8, 0x1401134e8\nmovss   xmm0, dword ptr [rax]                                          ; +0x1c0, 0x1401134f0\ndivss   xmm0, xmm7; X                                                  ; +0x1c4, 0x1401134f4\ncall    floorf                                                         ; +0x1c8, 0x1401134f8\nmovaps  xmm6, xmm0                                                     ; +0x1cd, 0x1401134fd\naddss   xmm6, xmm8                                                     ; +0x1d0, 0x140113500\nmulss   xmm6, xmm7                                                     ; +0x1d5, 0x140113505\nmovss   xmm0, dword ptr [rbx+4]                                        ; +0x1d9, 0x140113509\ndivss   xmm0, xmm7; X                                                  ; +0x1de, 0x14011350e\ncall    floorf                                                         ; +0x1e2, 0x140113512\naddss   xmm0, xmm8                                                     ; +0x1e7, 0x140113517\nmulss   xmm0, xmm7                                                     ; +0x1ec, 0x14011351c\nmovaps  xmm2, xmm0                                                     ; +0x1f0, 0x140113520\nmovaps  xmm1, xmm6                                                     ; +0x1f3, 0x140113523\nlea     rcx, [rsp+98h+var_68]                                          ; +0x1f6, 0x140113526\ncall    cs:??0CCPoint@cocos2d@@QEAA@MM@Z; cocos2d::CCPoint::CCPoint(float,float) ; +0x1fb, 0x14011352b\nmov     r8, rax                                                        ; +0x201, 0x140113531\nlea     rdx, [rsp+98h+var_78]                                          ; +0x204, 0x140113534\nmov     rcx, rdi                                                       ; +0x209, 0x140113539\ncall    EditorUI__getLimitedPosition                                   ; +0x20c, 0x14011353c\nlea     rdx, [rsp+98h+var_78]                                          ; +0x211, 0x140113541\nlea     rcx, [rsp+98h+arg_10]                                          ; +0x216, 0x140113546\ncall    cs:??4CCPoint@cocos2d@@QEAAAEAV01@AEBV01@@Z; cocos2d::CCPoint::operator=(cocos2d::CCPoint const &) ; +0x21e, 0x14011354e\nlea     rdx, [rsp+98h+arg_10]                                          ; +0x224, 0x140113554\nlea     rcx, [rsp+98h+var_68]                                          ; +0x22c, 0x14011355c\ncall    cs:??0CCPoint@cocos2d@@QEAA@AEBV01@@Z; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const &) ; +0x231, 0x140113561\nmov     r8, rax                                                        ; +0x237, 0x140113567\nxor     r9d, r9d                                                       ; +0x23a, 0x14011356a\nmov     rdx, rsi                                                       ; +0x23d, 0x14011356d\nmov     rcx, rdi                                                       ; +0x240, 0x140113570\ncall    EditorUI__repositionObjectsToCenter                            ; +0x243, 0x140113573\nmov     rcx, rdi                                                       ; +0x248, 0x140113578\ncall    EditorUI__updateButtons                                        ; +0x24b, 0x14011357b\nmov     rcx, rdi                                                       ; +0x250, 0x140113580\ncall    EditorUI__updateObjectInfoLabel                                ; +0x253, 0x140113583\nlea     r11, [rsp+98h+var_8]                                           ; +0x258, 0x140113588\nmov     rbx, [r11+10h]                                                 ; +0x260, 0x140113590\nmov     rsi, [r11+18h]                                                 ; +0x264, 0x140113594\nmovaps  xmm6, xmmword ptr [r11-10h]                                    ; +0x268, 0x140113598\nmovaps  xmm7, [rsp+98h+var_28]                                         ; +0x26d, 0x14011359d\nmovaps  xmm8, xmmword ptr [r11-30h]                                    ; +0x272, 0x1401135a2\nmov     rsp, r11                                                       ; +0x277, 0x1401135a7\npop     rdi                                                            ; +0x27a, 0x1401135aa\nretn                                                                   ; +0x27b, 0x1401135ab", "xrefs": ["EditorPauseLayer::onPasteWColor @ 0x1400dcd50", "EditorUI::onPaste @ 0x140113322", "EditorUI::keyDown @ 0x14012554a", "<???> @ 0x1406c909c"], "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"}