{"type": "func", "start": 7092128, "end": 7092720, "name": "EditorUI::doPasteObjects", "pseudocode": "// \n// EditorUI::doPasteObjects from 0x6c37a0 to 0x6c39f0 (592 bytes)\n// \n// 3 xrefs:\n// > EditorUI::onPaste @ 0x6c39f4\n// > EditorPauseLayer::onPasteWColor @ 0x78ab98\n// > <???> @ 0x505b0\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\nvoid EditorUI::doPasteObjects(EditorUI *a1, bool a2)\n{\n  int v4; // w21\n  int v5; // w0\n  LevelEditorLayer *m_editorLayer; // x0\n  GameManager *v7; // x0\n  cocos2d::CCArray *v8; // x22\n  void *v9; // x0\n  cocos2d::CCDirector *v10; // x0\n  cocos2d::CCLayer *m_objectLayer; // x25\n  unsigned int *v12; // x2\n  int v13; // w1\n  __int64 v14; // [xsp+0h] [xbp+0h] BYREF\n  float v15; // [xsp+58h] [xbp+58h]\n  float v16; // [xsp+5Ch] [xbp+5Ch]\n  cocos2d::CCPoint v17; // [xsp+60h] [xbp+60h] BYREF\n  cocos2d::CCPoint v18; // [xsp+68h] [xbp+68h] BYREF\n  cocos2d::CCPoint v19; // [xsp+70h] [xbp+70h] BYREF\n  cocos2d::CCPoint GridSnappedPos; // 0:kr10_8.8\n  cocos2d::CCPoint v21; // 0:s0.4,4:s1.4\n  cocos2d::CCPoint v22; // 0:s0.4,4:s1.4\n\n  if ( !*((_QWORD *)GameManager::sharedState()->m_editorClipboard.m_data.m_data - 3) )\n    return;\n  v4 = a1->m_editorLayer->m_objectCount.random - a1->m_editorLayer->m_objectCount.seed;\n  v5 = v4 + GameManager::sharedState()->m_copiedObjectCount;\n  if ( v5 > 80000 )\n  {\n    m_editorLayer = a1->m_editorLayer;\n    if ( !m_editorLayer->m_level->m_unlimitedObjectsEnabled )\n    {\n      EditorUI::showMaxError(a1);\n      return;\n    }\nLABEL_12:\n    if ( !m_editorLayer->m_level->m_highObjectsEnabled )\n    {\n      EditorUI::showMaxBasicError(a1);\n      return;\n    }\n    goto LABEL_6;\n  }\n  if ( v5 > 40000 )\n  {\n    m_editorLayer = a1->m_editorLayer;\n    goto LABEL_12;\n  }\nLABEL_6:\n  v7 = GameManager::sharedState();\n  sub_D18D28(&v19, &v7->m_editorClipboard);\n  v8 = EditorUI::pasteObjects(a1, (const void **)&v19, a2, 0);\n  v9 = (void *)(*(_QWORD *)&v19 - 24LL);\n  if ( (__int64 *)(*(_QWORD *)&v19 - 24LL) != &qword_124B6B0 )\n  {\n    if ( &pthread_create )\n    {\n      v12 = (unsigned int *)(*(_QWORD *)&v19 - 8LL);\n      do\n        v13 = __ldaxr(v12);\n      while ( __stlxr(v13 - 1, v12) );\n    }\n    else\n    {\n      v13 = *(_DWORD *)(*(_QWORD *)&v19 - 8LL);\n      *(_DWORD *)(*(_QWORD *)&v19 - 8LL) = v13 - 1;\n    }\n    if ( v13 <= 0 )\n      operator delete(v9);\n  }\n  if ( v8 )\n  {\n    if ( (unsigned int)cocos2d::CCArray::count(v8) )\n    {\n      v10 = cocos2d::CCDirector::sharedDirector();\n      cocos2d::CCDirector::getWinSize(v10);\n      m_objectLayer = a1->m_editorLayer->m_objectLayer;\n      cocos2d::CCPoint::CCPoint(&v19, v15 * 0.5, (float)(a1->m_toolbarHeight * 0.5) + (float)(v16 * 0.5));\n      cocos2d::CCNode::convertToNodeSpace(m_objectLayer, &v19);\n      cocos2d::CCPoint::CCPoint(&v18, &v17);\n      GridSnappedPos = EditorUI::getGridSnappedPos(a1, v21);\n      cocos2d::CCPoint::operator=(&v17, GridSnappedPos.x, GridSnappedPos.y);\n      cocos2d::CCPoint::CCPoint(&v19, &v17);\n      EditorUI::repositionObjectsToCenter(a1, v8, v22, (unsigned __int8)&v14 + 112);\n    }\n  }\n  EditorUI::updateButtons(a1);\n  EditorUI::updateObjectInfoLabel(a1);\n}", "assembly": "; \n; EditorUI::doPasteObjects from 0x6c37a0 to 0x6c39f0 (592 bytes)\n; \n; 3 xrefs:\n; > EditorUI::onPaste @ 0x6c39f4\n; > EditorPauseLayer::onPasteWColor @ 0x78ab98\n; > <???> @ 0x505b0\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\nSTP             X29, X30, [SP,#var_80]!                                ; +0x0, 0x6c37a0\nMOV             X29, SP                                                ; +0x4, 0x6c37a4\nSTP             X19, X20, [SP,#0x80+var_70]                            ; +0x8, 0x6c37a8\nADRP            X19, #__stack_chk_guard_ptr@PAGE                       ; +0xc, 0x6c37ac\nMOV             X20, X0                                                ; +0x10, 0x6c37b0\nSTP             X21, X22, [SP,#0x80+var_60]                            ; +0x14, 0x6c37b4\nSTP             X23, X24, [SP,#0x80+var_50]                            ; +0x18, 0x6c37b8\nLDR             X0, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x1c, 0x6c37bc\nUXTB            W22, W1                                                ; +0x20, 0x6c37c0\nSTR             X25, [SP,#0x80+var_40]                                 ; +0x24, 0x6c37c4\nLDR             X0, [X0]; this                                         ; +0x28, 0x6c37c8\nSTR             X0, [X29,#0x80+var_8]                                  ; +0x2c, 0x6c37cc\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x30, 0x6c37d0\nLDR             X0, [X0,#0x1C8]                                        ; +0x34, 0x6c37d4\nLDUR            X0, [X0,#-0x18]                                        ; +0x38, 0x6c37d8\nCBNZ            X0, loc_6C380C                                         ; +0x3c, 0x6c37dc\nLDR             X19, [X19,#__stack_chk_guard_ptr@PAGEOFF]; __stack_chk_guard ; +0x40, 0x6c37e0\nLDR             X1, [X29,#0x80+var_8]                                  ; +0x44, 0x6c37e4\nLDR             X0, [X19]                                              ; +0x48, 0x6c37e8\nCMP             X1, X0                                                 ; +0x4c, 0x6c37ec\nB.NE            loc_6C39C0                                             ; +0x50, 0x6c37f0\nLDP             X19, X20, [SP,#0x80+var_70]                            ; +0x54, 0x6c37f4\nLDP             X21, X22, [SP,#0x80+var_60]                            ; +0x58, 0x6c37f8\nLDP             X23, X24, [SP,#0x80+var_50]                            ; +0x5c, 0x6c37fc\nLDR             X25, [SP,#0x80+var_40]                                 ; +0x60, 0x6c3800\nLDP             X29, X30, [SP+0x80+var_80],#0x80                       ; +0x64, 0x6c3804\nRET                                                                    ; +0x68, 0x6c3808\nLDR             X1, [X20,#0x4F8]                                       ; +0x6c, 0x6c380c\nLDR             W0, [X1,#0x3898]; this                                 ; +0x70, 0x6c3810\nLDR             W21, [X1,#0x389C]                                      ; +0x74, 0x6c3814\nSUB             W21, W0, W21                                           ; +0x78, 0x6c3818\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x7c, 0x6c381c\nLDR             W0, [X0,#0x1D0]                                        ; +0x80, 0x6c3820\nMOV             W1, #0x13880                                           ; +0x84, 0x6c3824\nADD             W0, W21, W0; this                                      ; +0x8c, 0x6c382c\nCMP             W0, W1                                                 ; +0x90, 0x6c3830\nB.LE            loc_6C3854                                             ; +0x94, 0x6c3834\nLDR             X0, [X20,#0x4F8]                                       ; +0x98, 0x6c3838\nLDR             X1, [X0,#0x8A0]                                        ; +0x9c, 0x6c383c\nLDRB            W1, [X1,#0x381]                                        ; +0xa0, 0x6c3840\nCBNZ            W1, loc_6C3964                                         ; +0xa4, 0x6c3844\nMOV             X0, X20; this                                          ; +0xa8, 0x6c3848\nBL              _ZN8EditorUI12showMaxErrorEv; EditorUI::showMaxError(void) ; +0xac, 0x6c384c\nB               loc_6C37E0                                             ; +0xb0, 0x6c3850\nMOV             W1, #0x9C40                                            ; +0xb4, 0x6c3854\nCMP             W0, W1                                                 ; +0xb8, 0x6c3858\nB.GT            loc_6C3960                                             ; +0xbc, 0x6c385c\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0xc0, 0x6c3860\nADD             X21, X29, #0x80+var_10                                 ; +0xc4, 0x6c3864\nADD             X1, X0, #0x1C8                                         ; +0xc8, 0x6c3868\nMOV             X0, X21                                                ; +0xcc, 0x6c386c\nBL              sub_D18D28                                             ; +0xd0, 0x6c3870\nMOV             X0, X20; int                                           ; +0xd4, 0x6c3874\nMOV             X1, X21; int                                           ; +0xd8, 0x6c3878\nMOV             W2, W22                                                ; +0xdc, 0x6c387c\nMOV             W3, #0                                                 ; +0xe0, 0x6c3880\nBL              _ZN8EditorUI12pasteObjectsESsbb; EditorUI::pasteObjects(std::string,bool,bool) ; +0xe4, 0x6c3884\nADRP            X1, #off_122EFE8@PAGE                                  ; +0xe8, 0x6c3888\nLDR             X2, [X29,#0x80+var_10]                                 ; +0xec, 0x6c388c\nMOV             X22, X0                                                ; +0xf0, 0x6c3890\nSUB             X0, X2, #0x18; p                                       ; +0xf4, 0x6c3894\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0xf8, 0x6c3898\nCMP             X0, X1                                                 ; +0xfc, 0x6c389c\nB.NE            loc_6C397C                                             ; +0x100, 0x6c38a0\nCBZ             X22, loc_6C394C                                        ; +0x104, 0x6c38a4\nMOV             X0, X22; this                                          ; +0x108, 0x6c38a8\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x10c, 0x6c38ac\nCBZ             W0, loc_6C394C                                         ; +0x110, 0x6c38b0\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0x114, 0x6c38b4\nADD             X23, X29, #0x80+var_20                                 ; +0x118, 0x6c38b8\nADD             X8, X29, #0x80+var_28                                  ; +0x11c, 0x6c38bc\nADD             X24, X29, #0x80+var_18                                 ; +0x120, 0x6c38c0\nBL              _ZN7cocos2d10CCDirector10getWinSizeEv; cocos2d::CCDirector::getWinSize(void) ; +0x124, 0x6c38c4\nFMOV            S1, #0.5                                               ; +0x128, 0x6c38c8\nLDR             X1, [X20,#0x4F8]                                       ; +0x12c, 0x6c38cc\nLDR             S0, [X20,#0x310]                                       ; +0x130, 0x6c38d0\nMOV             X0, X21; this                                          ; +0x134, 0x6c38d4\nLDR             S3, [X29,#0x80+var_24]                                 ; +0x138, 0x6c38d8\nFMUL            S2, S0, S1                                             ; +0x13c, 0x6c38dc\nLDR             X25, [X1,#0x1030]                                      ; +0x140, 0x6c38e0\nLDR             S0, [X29,#0x80+var_28]                                 ; +0x144, 0x6c38e4\nFMUL            S0, S0, S1; float                                      ; +0x148, 0x6c38e8\nFMADD           S1, S3, S1, S2; float                                  ; +0x14c, 0x6c38ec\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x150, 0x6c38f0\nMOV             X8, X23                                                ; +0x154, 0x6c38f4\nMOV             X0, X25; this                                          ; +0x158, 0x6c38f8\nMOV             X1, X21; cocos2d::CCPoint *                            ; +0x15c, 0x6c38fc\nBL              _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0x160, 0x6c3900\nMOV             X0, X24; this                                          ; +0x164, 0x6c3904\nMOV             X1, X23; cocos2d::CCPoint *                            ; +0x168, 0x6c3908\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x16c, 0x6c390c\nMOV             X8, X21                                                ; +0x170, 0x6c3910\nMOV             X0, X20                                                ; +0x174, 0x6c3914\nMOV             X1, X24                                                ; +0x178, 0x6c3918\nBL              _ZN8EditorUI17getGridSnappedPosEN7cocos2d7CCPointE; EditorUI::getGridSnappedPos(cocos2d::CCPoint) ; +0x17c, 0x6c391c\nMOV             X1, X21                                                ; +0x180, 0x6c3920\nMOV             X0, X23                                                ; +0x184, 0x6c3924\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x188, 0x6c3928\nMOV             X0, X21; this                                          ; +0x18c, 0x6c392c\nMOV             X1, X23; cocos2d::CCPoint *                            ; +0x190, 0x6c3930\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x194, 0x6c3934\nMOV             X0, X20                                                ; +0x198, 0x6c3938\nMOV             X1, X22                                                ; +0x19c, 0x6c393c\nMOV             X2, X21                                                ; +0x1a0, 0x6c3940\nMOV             W3, #0                                                 ; +0x1a4, 0x6c3944\nBL              _ZN8EditorUI25repositionObjectsToCenterEPN7cocos2d7CCArrayENS0_7CCPointEb; EditorUI::repositionObjectsToCenter(cocos2d::CCArray *,cocos2d::CCPoint,bool) ; +0x1a8, 0x6c3948\nMOV             X0, X20; this                                          ; +0x1ac, 0x6c394c\nBL              _ZN8EditorUI13updateButtonsEv; EditorUI::updateButtons(void) ; +0x1b0, 0x6c3950\nMOV             X0, X20; this                                          ; +0x1b4, 0x6c3954\nBL              _ZN8EditorUI21updateObjectInfoLabelEv; EditorUI::updateObjectInfoLabel(void) ; +0x1b8, 0x6c3958\nB               loc_6C37E0                                             ; +0x1bc, 0x6c395c\nLDR             X0, [X20,#0x4F8]                                       ; +0x1c0, 0x6c3960\nLDR             X0, [X0,#0x8A0]                                        ; +0x1c4, 0x6c3964\nLDRB            W0, [X0,#0x380]                                        ; +0x1c8, 0x6c3968\nCBNZ            W0, loc_6C3860                                         ; +0x1cc, 0x6c396c\nMOV             X0, X20; this                                          ; +0x1d0, 0x6c3970\nBL              _ZN8EditorUI17showMaxBasicErrorEv; EditorUI::showMaxBasicError(void) ; +0x1d4, 0x6c3974\nB               loc_6C37E0                                             ; +0x1d8, 0x6c3978\nADRP            X1, #pthread_create_ptr_0@PAGE                         ; +0x1dc, 0x6c397c\nLDR             X1, [X1,#pthread_create_ptr_0@PAGEOFF]; pthread_create ; +0x1e0, 0x6c3980\nCBZ             X1, loc_6C39B0                                         ; +0x1e4, 0x6c3984\nSUB             X2, X2, #8                                             ; +0x1e8, 0x6c3988\nLDAXR           W1, [X2]                                               ; +0x1ec, 0x6c398c\nSUB             W3, W1, #1                                             ; +0x1f0, 0x6c3990\nSTLXR           W4, W3, [X2]                                           ; +0x1f4, 0x6c3994\nCBNZ            W4, loc_6C398C                                         ; +0x1f8, 0x6c3998\nCMP             W1, WZR                                                ; +0x1fc, 0x6c399c\nB.GT            loc_6C38A4                                             ; +0x200, 0x6c39a0\nADD             X1, X29, #0x80+var_18                                  ; +0x204, 0x6c39a4\nBL              j__ZdlPv; operator delete(void *)                      ; +0x208, 0x6c39a8\nB               loc_6C38A4                                             ; +0x20c, 0x6c39ac\nLDUR            W1, [X2,#-8]                                           ; +0x210, 0x6c39b0\nSUB             W3, W1, #1                                             ; +0x214, 0x6c39b4\nSTUR            W3, [X2,#-8]                                           ; +0x218, 0x6c39b8\nB               loc_6C399C                                             ; +0x21c, 0x6c39bc\nBL              .__stack_chk_fail                                      ; +0x220, 0x6c39c0\nADRP            X1, #off_122EFE8@PAGE                                  ; +0x224, 0x6c39c4\nMOV             X19, X0                                                ; +0x228, 0x6c39c8\nLDR             X0, [X29,#0x80+var_10]                                 ; +0x22c, 0x6c39cc\nLDR             X1, [X1,#off_122EFE8@PAGEOFF]; qword_124B6B0           ; +0x230, 0x6c39d0\nSUB             X0, X0, #0x18                                          ; +0x234, 0x6c39d4\nCMP             X0, X1                                                 ; +0x238, 0x6c39d8\nB.EQ            loc_6C39E8                                             ; +0x23c, 0x6c39dc\nADD             X1, X29, #0x80+var_18                                  ; +0x240, 0x6c39e0\nBL              sub_6865FC                                             ; +0x244, 0x6c39e4\nMOV             X0, X19                                                ; +0x248, 0x6c39e8\nBL              _Unwind_Resume                                         ; +0x24c, 0x6c39ec", "xrefs": ["EditorUI::onPaste @ 0x6c39f4", "EditorPauseLayer::onPasteWColor @ 0x78ab98", "<???> @ 0x505b0"], "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"}