{"type": "func", "start": 3827924, "end": 3828204, "name": "EditorUI::onDuplicate", "pseudocode": "// \n// EditorUI::onDuplicate from 0x3a68d4 to 0x3a69ec (280 bytes)\n// \n// 2 xrefs:\n// > EditorUI::ccTouchBegan @ 0x3a6d7e\n// > EditorUI::keyDown @ 0x3a6fec\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::onDuplicate(EditorUI *a1, cocos2d::CCObject *a2)\n{\n  int v3; // r5\n  int v4; // r0\n  cocos2d::CCArray *m_selectedObjects; // r6\n  char v6; // [sp+Ch] [bp-10h] BYREF\n  int v7; // [sp+10h] [bp-Ch] BYREF\n\n  if ( !a1->m_selectedObject && !cocos2d::CCArray::count(a1->m_selectedObjects) )\n    return;\n  v3 = a1->m_editorLayer->m_objectCount.random - a1->m_editorLayer->m_objectCount.seed;\n  v4 = cocos2d::CCArray::count(a1->m_selectedObjects) + v3;\n  if ( v4 > 80000 )\n  {\n    if ( !a1->m_editorLayer->m_level->m_unlimitedObjectsEnabled )\n    {\n      EditorUI::showMaxError(a1);\n      return;\n    }\n    goto LABEL_5;\n  }\n  if ( v4 > 40000 )\n  {\nLABEL_5:\n    if ( !a1->m_editorLayer->m_level->m_highObjectsEnabled )\n    {\n      EditorUI::showMaxBasicError(a1);\n      return;\n    }\n  }\n  if ( cocos2d::CCArray::count(a1->m_selectedObjects) )\n  {\n    m_selectedObjects = a1->m_selectedObjects;\n  }\n  else\n  {\n    m_selectedObjects = (cocos2d::CCArray *)cocos2d::CCArray::create(nullptr);\n    cocos2d::CCArray::addObject(m_selectedObjects, a1->m_selectedObject);\n  }\n  EditorUI::copyObjects((EditorUI *)&v6, (cocos2d::CCArray *)a1, (int)m_selectedObjects, 0, 0);\n  a1->m_editorLayer->m_keepEditorLayer = 1;\n  sub_775C20(&v7, &v6);\n  EditorUI::pasteObjects(a1, &v7, 0, 0);\n  sub_774008(&v7);\n  a1->m_editorLayer->m_keepEditorLayer = 0;\n  EditorUI::tryUpdateTimeMarkers(a1);\n  EditorUI::updateButtons(a1);\n  EditorUI::updateObjectInfoLabel(a1);\n  sub_774008(&v6);\n}", "assembly": "; \n; EditorUI::onDuplicate from 0x3a68d4 to 0x3a69ec (280 bytes)\n; \n; 2 xrefs:\n; > EditorUI::ccTouchBegan @ 0x3a6d7e\n; > EditorUI::keyDown @ 0x3a6fec\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\nLDR             R3, =(__stack_chk_guard_ptr - 0x3A68DC)                ; +0x0, 0x3a68d4\nPUSH            {R4-R7,LR}                                             ; +0x2, 0x3a68d6\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x4, 0x3a68d8\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x6, 0x3a68da\nSUB             SP, SP, #0x1C                                          ; +0x8, 0x3a68dc\nMOV             R4, R0                                                 ; +0xa, 0x3a68de\nLDR             R2, [R3]                                               ; +0xc, 0x3a68e0\nMOV             R7, R3                                                 ; +0xe, 0x3a68e2\nSTR             R2, [SP,#0x1C+var_8]                                   ; +0x10, 0x3a68e4\nLDR.W           R2, [R0,#0x374]                                        ; +0x12, 0x3a68e6\nCBNZ            R2, loc_3A68F8                                         ; +0x16, 0x3a68ea\nLDR.W           R0, [R0,#0x260]; this                                  ; +0x18, 0x3a68ec\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x1c, 0x3a68f0\nCMP             R0, #0                                                 ; +0x20, 0x3a68f4\nBEQ             loc_3A69DC                                             ; +0x22, 0x3a68f6\nLDR.W           R3, [R4,#0x340]                                        ; +0x24, 0x3a68f8\nMOVW            R2, #0x2EA0                                            ; +0x28, 0x3a68fc\nLDR             R0, [R3,R2]                                            ; +0x2c, 0x3a6900\nMOVW            R2, #0x2EA4                                            ; +0x2e, 0x3a6902\nLDR             R5, [R3,R2]                                            ; +0x32, 0x3a6906\nSUBS            R5, R0, R5                                             ; +0x34, 0x3a6908\nLDR.W           R0, [R4,#0x260]; this                                  ; +0x36, 0x3a690a\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x3a, 0x3a690e\nLDR             R3, =0x13880                                           ; +0x3e, 0x3a6912\nADD             R0, R5                                                 ; +0x40, 0x3a6914\nCMP             R0, R3                                                 ; +0x42, 0x3a6916\nBLE             loc_3A6946                                             ; +0x44, 0x3a6918\nLDR.W           R3, [R4,#0x340]                                        ; +0x46, 0x3a691a\nLDR.W           R3, [R3,#0x608]                                        ; +0x4a, 0x3a691e\nLDRB.W          R3, [R3,#0x309]                                        ; +0x4e, 0x3a6922\nCBZ             R3, loc_3A693E                                         ; +0x52, 0x3a6926\nLDR.W           R3, [R4,#0x340]                                        ; +0x54, 0x3a6928\nLDR.W           R3, [R3,#0x608]                                        ; +0x58, 0x3a692c\nLDRB.W          R3, [R3,#0x308]                                        ; +0x5c, 0x3a6930\nCBNZ            R3, loc_3A694E                                         ; +0x60, 0x3a6934\nMOV             R0, R4; this                                           ; +0x62, 0x3a6936\nBL              _ZN8EditorUI17showMaxBasicErrorEv; EditorUI::showMaxBasicError(void) ; +0x64, 0x3a6938\nB               loc_3A69DC                                             ; +0x68, 0x3a693c\nMOV             R0, R4; this                                           ; +0x6a, 0x3a693e\nBL              _ZN8EditorUI12showMaxErrorEv; EditorUI::showMaxError(void) ; +0x6c, 0x3a6940\nB               loc_3A69DC                                             ; +0x70, 0x3a6944\nMOVW            R3, #0x9C40                                            ; +0x72, 0x3a6946\nCMP             R0, R3                                                 ; +0x76, 0x3a694a\nBGT             loc_3A6928                                             ; +0x78, 0x3a694c\nLDR.W           R0, [R4,#0x260]; this                                  ; +0x7a, 0x3a694e\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x7e, 0x3a6952\nCBNZ            R0, loc_3A6968                                         ; +0x82, 0x3a6956\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x84, 0x3a6958\nLDR.W           R1, [R4,#0x374]; cocos2d::CCObject *                   ; +0x88, 0x3a695c\nMOV             R6, R0                                                 ; +0x8c, 0x3a6960\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x8e, 0x3a6962\nB               loc_3A696C                                             ; +0x92, 0x3a6966\nLDR.W           R6, [R4,#0x260]                                        ; +0x94, 0x3a6968\nADD             R5, SP, #0x1C+var_10                                   ; +0x98, 0x3a696c\nMOVS            R3, #0; bool                                           ; +0x9a, 0x3a696e\nMOV             R2, R6; bool                                           ; +0x9c, 0x3a6970\nSTR             R3, [SP,#0x1C+var_1C]                                  ; +0x9e, 0x3a6972\nMOV             R0, R5; this                                           ; +0xa0, 0x3a6974\nMOV             R1, R4; cocos2d::CCArray *                             ; +0xa2, 0x3a6976\nBL              _ZN8EditorUI11copyObjectsEPN7cocos2d7CCArrayEbb; EditorUI::copyObjects(cocos2d::CCArray *,bool,bool) ; +0xa4, 0x3a6978\nLDR.W           R2, [R4,#0x340]                                        ; +0xa8, 0x3a697c\nADD             R6, SP, #0x1C+var_C                                    ; +0xac, 0x3a6980\nMOVW            R3, #0x2E4C                                            ; +0xae, 0x3a6982\nMOVS            R1, #1                                                 ; +0xb2, 0x3a6986\nMOV             R0, R6                                                 ; +0xb4, 0x3a6988\nSTRB            R1, [R2,R3]                                            ; +0xb6, 0x3a698a\nMOV             R1, R5                                                 ; +0xb8, 0x3a698c\nBL              sub_775C20                                             ; +0xba, 0x3a698e\nMOVS            R2, #0                                                 ; +0xbe, 0x3a6992\nMOV             R0, R4; int                                            ; +0xc0, 0x3a6994\nMOV             R1, R6; int                                            ; +0xc2, 0x3a6996\nMOV             R3, R2                                                 ; +0xc4, 0x3a6998\nBL              _ZN8EditorUI12pasteObjectsESsbb; EditorUI::pasteObjects(std::string,bool,bool) ; +0xc6, 0x3a699a\nMOV             R0, R6                                                 ; +0xca, 0x3a699e\nBL              sub_774008                                             ; +0xcc, 0x3a69a0\nLDR.W           R2, [R4,#0x340]                                        ; +0xd0, 0x3a69a4\nMOVW            R3, #0x2E4C                                            ; +0xd4, 0x3a69a8\nMOVS            R1, #0                                                 ; +0xd8, 0x3a69ac\nMOV             R0, R4; this                                           ; +0xda, 0x3a69ae\nSTRB            R1, [R2,R3]                                            ; +0xdc, 0x3a69b0\nBL              _ZN8EditorUI20tryUpdateTimeMarkersEv; EditorUI::tryUpdateTimeMarkers(void) ; +0xde, 0x3a69b2\nMOV             R0, R4; this                                           ; +0xe2, 0x3a69b6\nBL              _ZN8EditorUI13updateButtonsEv; EditorUI::updateButtons(void) ; +0xe4, 0x3a69b8\nMOV             R0, R4; this                                           ; +0xe8, 0x3a69bc\nBL              _ZN8EditorUI21updateObjectInfoLabelEv; EditorUI::updateObjectInfoLabel(void) ; +0xea, 0x3a69be\nMOV             R0, R5                                                 ; +0xee, 0x3a69c2\nBL              sub_774008                                             ; +0xf0, 0x3a69c4\nB               loc_3A69DC                                             ; +0xf4, 0x3a69c8\nMOV             R0, R6                                                 ; +0xf6, 0x3a69ca\nBL              sub_774008                                             ; +0xf8, 0x3a69cc\nB               loc_3A69D2                                             ; +0xfc, 0x3a69d0\nMOV             R0, R5                                                 ; +0xfe, 0x3a69d2\nBL              sub_774008                                             ; +0x100, 0x3a69d4\nBL              __cxa_end_cleanup                                      ; +0x104, 0x3a69d8\nLDR             R2, [SP,#0x1C+var_8]                                   ; +0x108, 0x3a69dc\nLDR             R3, [R7]                                               ; +0x10a, 0x3a69de\nCMP             R2, R3                                                 ; +0x10c, 0x3a69e0\nBEQ             loc_3A69E8                                             ; +0x10e, 0x3a69e2\nBLX             __stack_chk_fail                                       ; +0x110, 0x3a69e4\nADD             SP, SP, #0x1C                                          ; +0x114, 0x3a69e8\nPOP             {R4-R7,PC}                                             ; +0x116, 0x3a69ea", "xrefs": ["EditorUI::ccTouchBegan @ 0x3a6d7e", "EditorUI::keyDown @ 0x3a6fec"], "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"}