{"type": "func", "start": 3825156, "end": 3825500, "name": "EditorUI::doPasteObjects", "pseudocode": "// \n// EditorUI::doPasteObjects from 0x3a5e04 to 0x3a5f5c (344 bytes)\n// \n// 2 xrefs:\n// > EditorUI::onPaste @ 0x3a5f66\n// > EditorPauseLayer::onPasteWColor @ 0x3ff2c4\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  _BOOL4 v3; // r8\n  int v4; // r6\n  int v5; // r5\n  GameManager *v6; // r0\n  cocos2d::CCArray *v7; // r8\n  cocos2d::CCDirector *v8; // r0\n  cocos2d::CCLayer *m_objectLayer; // r9\n  cocos2d::CCPoint v10; // r2\n  int v11; // r2\n  bool v12; // r3\n  bool v13; // [sp+0h] [bp-2Ch]\n  cocos2d::CCSize v14; // [sp+4h] [bp-28h] BYREF\n  cocos2d::CCPoint v15; // [sp+Ch] [bp-20h] BYREF\n  cocos2d::CCPoint v16; // [sp+14h] [bp-18h] BYREF\n  cocos2d::CCPoint v17; // [sp+1Ch] [bp-10h] BYREF\n\n  v3 = a2;\n  if ( !*((_DWORD *)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 = GameManager::sharedState()->m_copiedObjectCount + v4;\n  if ( v5 > 80000 )\n  {\n    if ( !a1->m_editorLayer->m_level->m_unlimitedObjectsEnabled )\n    {\n      EditorUI::showMaxError(a1);\n      return;\n    }\n    goto LABEL_4;\n  }\n  if ( v5 > 40000 )\n  {\nLABEL_4:\n    if ( !a1->m_editorLayer->m_level->m_highObjectsEnabled )\n    {\n      EditorUI::showMaxBasicError(a1);\n      return;\n    }\n  }\n  v6 = GameManager::sharedState();\n  sub_775C20(&v17, &v6->m_editorClipboard);\n  v7 = EditorUI::pasteObjects(a1, &v17, v3, 0);\n  sub_774008(&v17);\n  if ( v7 )\n  {\n    if ( cocos2d::CCArray::count(v7) )\n    {\n      v8 = cocos2d::CCDirector::sharedDirector();\n      cocos2d::CCDirector::getWinSize(&v14, v8);\n      m_objectLayer = a1->m_editorLayer->m_objectLayer;\n      cocos2d::CCPoint::CCPoint(&v17, v14.width * 0.5, (float)(a1->m_toolbarHeight * 0.5) + (float)(v14.height * 0.5));\n      cocos2d::CCNode::convertToNodeSpace(&v15, m_objectLayer, &v17);\n      cocos2d::CCPoint::CCPoint(&v16, &v15);\n      LODWORD(v10.x) = &v16;\n      EditorUI::getGridSnappedPos(&v17, a1, v10);\n      cocos2d::CCPoint::operator=((PlayerObject *)&v15, COERCE_FLOAT(&v17), v11, v12);\n      cocos2d::CCPoint::CCPoint(&v17, &v15);\n      EditorUI::repositionObjectsToCenter(a1, v7, (cocos2d::CCPoint)(unsigned int)&v17, v13);\n    }\n  }\n  EditorUI::updateButtons(a1);\n  EditorUI::updateObjectInfoLabel(a1);\n}", "assembly": "; \n; EditorUI::doPasteObjects from 0x3a5e04 to 0x3a5f5c (344 bytes)\n; \n; 2 xrefs:\n; > EditorUI::onPaste @ 0x3a5f66\n; > EditorPauseLayer::onPasteWColor @ 0x3ff2c4\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\nPUSH.W          {R4-R9,LR}                                             ; +0x0, 0x3a5e04\nSUB             SP, SP, #0x2C                                          ; +0x4, 0x3a5e08\nLDR             R7, =(__stack_chk_guard_ptr - 0x3A5E14)                ; +0x6, 0x3a5e0a\nMOV             R4, R0                                                 ; +0x8, 0x3a5e0c\nMOV             R8, R1                                                 ; +0xa, 0x3a5e0e\nADD             R7, PC; __stack_chk_guard_ptr                          ; +0xc, 0x3a5e10\nLDR             R7, [R7]; __stack_chk_guard                            ; +0xe, 0x3a5e12\nLDR             R3, [R7]                                               ; +0x10, 0x3a5e14\nSTR             R3, [SP,#0x2C+var_8]                                   ; +0x12, 0x3a5e16\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x14, 0x3a5e18\nLDR.W           R3, [R0,#0x164]                                        ; +0x18, 0x3a5e1c\nLDR.W           R3, [R3,#-0xC]                                         ; +0x1c, 0x3a5e20\nCMP             R3, #0                                                 ; +0x20, 0x3a5e24\nBEQ.W           loc_3A5F4A                                             ; +0x22, 0x3a5e26\nLDR.W           R2, [R4,#0x340]                                        ; +0x26, 0x3a5e2a\nMOVW            R1, #0x2EA4                                            ; +0x2a, 0x3a5e2e\nMOVW            R3, #0x2EA0                                            ; +0x2e, 0x3a5e32\nLDR             R3, [R2,R3]                                            ; +0x32, 0x3a5e36\nLDR             R6, [R2,R1]                                            ; +0x34, 0x3a5e38\nSUBS            R6, R3, R6                                             ; +0x36, 0x3a5e3a\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x38, 0x3a5e3c\nLDR             R3, =0x13880                                           ; +0x3c, 0x3a5e40\nLDR.W           R5, [R0,#0x168]                                        ; +0x3e, 0x3a5e42\nADD             R5, R6                                                 ; +0x42, 0x3a5e46\nCMP             R5, R3                                                 ; +0x44, 0x3a5e48\nBLE             loc_3A5E78                                             ; +0x46, 0x3a5e4a\nLDR.W           R3, [R4,#0x340]                                        ; +0x48, 0x3a5e4c\nLDR.W           R3, [R3,#0x608]                                        ; +0x4c, 0x3a5e50\nLDRB.W          R3, [R3,#0x309]                                        ; +0x50, 0x3a5e54\nCBZ             R3, loc_3A5E70                                         ; +0x54, 0x3a5e58\nLDR.W           R3, [R4,#0x340]                                        ; +0x56, 0x3a5e5a\nLDR.W           R3, [R3,#0x608]                                        ; +0x5a, 0x3a5e5e\nLDRB.W          R3, [R3,#0x308]                                        ; +0x5e, 0x3a5e62\nCBNZ            R3, loc_3A5E80                                         ; +0x62, 0x3a5e66\nMOV             R0, R4; this                                           ; +0x64, 0x3a5e68\nBL              _ZN8EditorUI17showMaxBasicErrorEv; EditorUI::showMaxBasicError(void) ; +0x66, 0x3a5e6a\nB               loc_3A5F4A                                             ; +0x6a, 0x3a5e6e\nMOV             R0, R4; this                                           ; +0x6c, 0x3a5e70\nBL              _ZN8EditorUI12showMaxErrorEv; EditorUI::showMaxError(void) ; +0x6e, 0x3a5e72\nB               loc_3A5F4A                                             ; +0x72, 0x3a5e76\nMOVW            R3, #0x9C40                                            ; +0x74, 0x3a5e78\nCMP             R5, R3                                                 ; +0x78, 0x3a5e7c\nBGT             loc_3A5E5A                                             ; +0x7a, 0x3a5e7e\nBL              _ZN11GameManager11sharedStateEv; GameManager::sharedState(void) ; +0x7c, 0x3a5e80\nADD             R5, SP, #0x2C+var_10                                   ; +0x80, 0x3a5e84\nADD.W           R1, R0, #0x164                                         ; +0x82, 0x3a5e86\nMOV             R0, R5                                                 ; +0x86, 0x3a5e8a\nBL              sub_775C20                                             ; +0x88, 0x3a5e8c\nMOV             R0, R4; int                                            ; +0x8c, 0x3a5e90\nMOV             R1, R5; int                                            ; +0x8e, 0x3a5e92\nMOV             R2, R8                                                 ; +0x90, 0x3a5e94\nMOVS            R3, #0                                                 ; +0x92, 0x3a5e96\nBL              _ZN8EditorUI12pasteObjectsESsbb; EditorUI::pasteObjects(std::string,bool,bool) ; +0x94, 0x3a5e98\nB               loc_3A5EA8                                             ; +0x98, 0x3a5e9c\nMOV             R0, R5                                                 ; +0x9a, 0x3a5e9e\nBL              sub_774008                                             ; +0x9c, 0x3a5ea0\nBL              __cxa_end_cleanup                                      ; +0xa0, 0x3a5ea4\nMOV             R8, R0                                                 ; +0xa4, 0x3a5ea8\nMOV             R0, R5                                                 ; +0xa6, 0x3a5eaa\nBL              sub_774008                                             ; +0xa8, 0x3a5eac\nCMP.W           R8, #0                                                 ; +0xac, 0x3a5eb0\nBEQ             loc_3A5EBE                                             ; +0xb0, 0x3a5eb4\nMOV             R0, R8; this                                           ; +0xb2, 0x3a5eb6\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0xb4, 0x3a5eb8\nCBNZ            R0, loc_3A5ECC                                         ; +0xb8, 0x3a5ebc\nMOV             R0, R4; this                                           ; +0xba, 0x3a5ebe\nBL              _ZN8EditorUI13updateButtonsEv; EditorUI::updateButtons(void) ; +0xbc, 0x3a5ec0\nMOV             R0, R4; this                                           ; +0xc0, 0x3a5ec4\nBL              _ZN8EditorUI21updateObjectInfoLabelEv; EditorUI::updateObjectInfoLabel(void) ; +0xc2, 0x3a5ec6\nB               loc_3A5F4A                                             ; +0xc6, 0x3a5eca\nBL              _ZN7cocos2d10CCDirector14sharedDirectorEv; cocos2d::CCDirector::sharedDirector(void) ; +0xc8, 0x3a5ecc\nADD             R6, SP, #0x2C+var_20                                   ; +0xcc, 0x3a5ed0\nMOV             R1, R0                                                 ; +0xce, 0x3a5ed2\nADD             R0, SP, #0x2C+var_28; this                             ; +0xd0, 0x3a5ed4\nBL              _ZN7cocos2d10CCDirector10getWinSizeEv; cocos2d::CCDirector::getWinSize(void) ; +0xd2, 0x3a5ed6\nVMOV.F32        S14, #0.5                                              ; +0xd6, 0x3a5eda\nVLDR            S13, [SP,#0x2C+var_28]                                 ; +0xda, 0x3a5ede\nMOV             R0, R5; this                                           ; +0xde, 0x3a5ee2\nLDR.W           R3, [R4,#0x340]                                        ; +0xe0, 0x3a5ee4\nVLDR            S15, [R4,#0x23C]                                       ; +0xe4, 0x3a5ee8\nLDR.W           R9, [R3,#0x9F0]                                        ; +0xe8, 0x3a5eec\nVMUL.F32        S13, S13, S14                                          ; +0xec, 0x3a5ef0\nVMUL.F32        S15, S15, S14                                          ; +0xf0, 0x3a5ef4\nVMOV            R1, S13; float                                         ; +0xf4, 0x3a5ef8\nVLDR            S13, [SP,#0x2C+var_24]                                 ; +0xf8, 0x3a5efc\nVMLA.F32        S15, S13, S14                                          ; +0xfc, 0x3a5f00\nVMOV            R2, S15; float                                         ; +0x100, 0x3a5f04\nBL              _ZN7cocos2d7CCPointC1Eff; cocos2d::CCPoint::CCPoint(float,float) ; +0x104, 0x3a5f08\nMOV             R1, R9; cocos2d::CCPoint *                             ; +0x108, 0x3a5f0c\nADD.W           R9, SP, #0x2C+var_18                                   ; +0x10a, 0x3a5f0e\nMOV             R2, R5                                                 ; +0x10e, 0x3a5f12\nMOV             R0, R6; this                                           ; +0x110, 0x3a5f14\nBL              _ZN7cocos2d6CCNode18convertToNodeSpaceERKNS_7CCPointE; cocos2d::CCNode::convertToNodeSpace(cocos2d::CCPoint const&) ; +0x112, 0x3a5f16\nMOV             R1, R6; cocos2d::CCPoint *                             ; +0x116, 0x3a5f1a\nMOV             R0, R9; this                                           ; +0x118, 0x3a5f1c\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x11a, 0x3a5f1e\nMOV             R2, R9                                                 ; +0x11e, 0x3a5f22\nMOV             R0, R5                                                 ; +0x120, 0x3a5f24\nMOV             R1, R4                                                 ; +0x122, 0x3a5f26\nBL              _ZN8EditorUI17getGridSnappedPosEN7cocos2d7CCPointE; EditorUI::getGridSnappedPos(cocos2d::CCPoint) ; +0x124, 0x3a5f28\nMOV             R1, R5                                                 ; +0x128, 0x3a5f2c\nMOV             R0, R6                                                 ; +0x12a, 0x3a5f2e\nBL              _ZN7cocos2d7CCPointaSERKS0_; cocos2d::CCPoint::operator=(cocos2d::CCPoint const&) ; +0x12c, 0x3a5f30\nMOV             R1, R6; cocos2d::CCPoint *                             ; +0x130, 0x3a5f34\nMOV             R0, R5; this                                           ; +0x132, 0x3a5f36\nBL              _ZN7cocos2d7CCPointC1ERKS0_; cocos2d::CCPoint::CCPoint(cocos2d::CCPoint const&) ; +0x134, 0x3a5f38\nMOV             R0, R4                                                 ; +0x138, 0x3a5f3c\nMOV             R1, R8                                                 ; +0x13a, 0x3a5f3e\nMOV             R2, R5                                                 ; +0x13c, 0x3a5f40\nMOVS            R3, #0                                                 ; +0x13e, 0x3a5f42\nBL              _ZN8EditorUI25repositionObjectsToCenterEPN7cocos2d7CCArrayENS0_7CCPointEb; EditorUI::repositionObjectsToCenter(cocos2d::CCArray *,cocos2d::CCPoint,bool) ; +0x140, 0x3a5f44\nB               loc_3A5EBE                                             ; +0x144, 0x3a5f48\nLDR             R2, [SP,#0x2C+var_8]                                   ; +0x146, 0x3a5f4a\nLDR             R3, [R7]                                               ; +0x148, 0x3a5f4c\nCMP             R2, R3                                                 ; +0x14a, 0x3a5f4e\nBEQ             loc_3A5F56                                             ; +0x14c, 0x3a5f50\nBLX             __stack_chk_fail                                       ; +0x14e, 0x3a5f52\nADD             SP, SP, #0x2C ; ','                                    ; +0x152, 0x3a5f56\nPOP.W           {R4-R9,PC}                                             ; +0x154, 0x3a5f58", "xrefs": ["EditorUI::onPaste @ 0x3a5f66", "EditorPauseLayer::onPasteWColor @ 0x3ff2c4"], "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"}