{"type": "func", "start": 7289176, "end": 7289474, "name": "EditorUI::onDuplicate", "pseudocode": "// \n// EditorUI::onDuplicate from 0x6f3958 to 0x6f3a82 (298 bytes)\n// \n// 2 xrefs:\n// > EditorUI::startFreeMoveTouch @ 0x6effc2\n// > EditorUI::handleEditorAction @ 0x6f19e4\n// \n// This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 11:57:37 +0000\n// \n\nint __fastcall EditorUI::onDuplicate(int this, cocos2d::CCObject *a2)\n{\n  int v2; // r4\n  EditorSFXManager *v3; // r0\n  int v4; // r5\n  int v5; // r0\n  cocos2d::CCArray *v6; // r6\n  _BYTE v7[12]; // [sp+Ch] [bp-20h] BYREF\n  int v8[3]; // [sp+18h] [bp-14h] BYREF\n\n  v2 = this;\n  if ( !*(_DWORD *)(this + 996) )\n  {\n    this = cocos2d::CCArray::count(*(cocos2d::CCArray **)(this + 668));\n    if ( !this )\n      return this;\n  }\n  v3 = (EditorSFXManager *)EditorSFXManager::sharedState((EditorSFXManager *)this);\n  EditorSFXManager::playAction(v3, 103);\n  v4 = *(_DWORD *)(*(_DWORD *)(v2 + 944) + 11868) - *(_DWORD *)(*(_DWORD *)(v2 + 944) + 11872);\n  v5 = cocos2d::CCArray::count(*(cocos2d::CCArray **)(v2 + 668)) + v4;\n  if ( v5 > 80000 )\n  {\n    if ( !*(_BYTE *)(*(_DWORD *)(*(_DWORD *)(v2 + 944) + 1408) + 985) )\n      return EditorUI::showMaxError(v2);\n    goto LABEL_5;\n  }\n  if ( v5 > 40000 )\n  {\nLABEL_5:\n    if ( !*(_BYTE *)(*(_DWORD *)(*(_DWORD *)(v2 + 944) + 1408) + 984) )\n      return EditorUI::showMaxBasicError(v2);\n  }\n  if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(v2 + 668)) )\n  {\n    v6 = *(cocos2d::CCArray **)(v2 + 668);\n  }\n  else\n  {\n    v6 = (cocos2d::CCArray *)cocos2d::CCArray::create(nullptr);\n    cocos2d::CCArray::addObject(v6, *(cocos2d::CCObject **)(v2 + 996));\n  }\n  EditorUI::copyObjects((EditorUI *)v7, (cocos2d::CCArray *)v2, (int)v6, 0, 0);\n  *(_BYTE *)(*(_DWORD *)(v2 + 944) + 11784) = 1;\n  std::string::basic_string(v8, (int)v7);\n  EditorUI::pasteObjects(v2, (unsigned __int8 *)v8, 0, 0);\n  std::string::~string((int)v8);\n  *(_BYTE *)(*(_DWORD *)(v2 + 944) + 11784) = 0;\n  EditorBuildStats::noteAction(*(_DWORD *)(v2 + 944) + 12104);\n  EditorUI::updateButtons((cocos2d::CCArray **)v2);\n  EditorUI::updateObjectInfoLabel((cocos2d::CCArray **)v2);\n  return std::string::~string((int)v7);\n}", "assembly": "; \n; EditorUI::onDuplicate from 0x6f3958 to 0x6f3a82 (298 bytes)\n; \n; 2 xrefs:\n; > EditorUI::startFreeMoveTouch @ 0x6effc2\n; > EditorUI::handleEditorAction @ 0x6f19e4\n; \n; This function is hookable on this platform (idp: arm, 32 bit: True, 64 bit: False!\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 11:57:37 +0000\n; \nLDR             R3, =(__stack_chk_guard_ptr - 0x6F3960)                ; +0x0, 0x6f3958\nPUSH            {R4-R7,LR}                                             ; +0x2, 0x6f395a\nADD             R3, PC; __stack_chk_guard_ptr                          ; +0x4, 0x6f395c\nLDR             R3, [R3]; __stack_chk_guard                            ; +0x6, 0x6f395e\nSUB             SP, SP, #0x2C                                          ; +0x8, 0x6f3960\nMOV             R4, R0                                                 ; +0xa, 0x6f3962\nLDR             R2, [R3]                                               ; +0xc, 0x6f3964\nMOV             R7, R3                                                 ; +0xe, 0x6f3966\nSTR             R2, [SP,#0x2C+var_8]                                   ; +0x10, 0x6f3968\nLDR.W           R2, [R0,#0x3E4]                                        ; +0x12, 0x6f396a\nCBNZ            R2, loc_6F397C                                         ; +0x16, 0x6f396e\nLDR.W           R0, [R0,#0x29C]; this                                  ; +0x18, 0x6f3970\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x1c, 0x6f3974\nCMP             R0, #0                                                 ; +0x20, 0x6f3978\nBEQ             loc_6F3A72                                             ; +0x22, 0x6f397a\nBL              _ZN16EditorSFXManager11sharedStateEv; EditorSFXManager::sharedState(void) ; +0x24, 0x6f397c\nMOVS            R1, #0x67 ; 'g'; int                                   ; +0x28, 0x6f3980\nBL              _ZN16EditorSFXManager10playActionEi; EditorSFXManager::playAction(int) ; +0x2a, 0x6f3982\nLDR.W           R3, [R4,#0x3B0]                                        ; +0x2e, 0x6f3986\nMOVW            R2, #0x2E5C                                            ; +0x32, 0x6f398a\nLDR             R0, [R3,R2]                                            ; +0x36, 0x6f398e\nMOVW            R2, #0x2E60                                            ; +0x38, 0x6f3990\nLDR             R5, [R3,R2]                                            ; +0x3c, 0x6f3994\nSUBS            R5, R0, R5                                             ; +0x3e, 0x6f3996\nLDR.W           R0, [R4,#0x29C]; this                                  ; +0x40, 0x6f3998\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x44, 0x6f399c\nLDR             R3, =0x13880                                           ; +0x48, 0x6f39a0\nADD             R0, R5                                                 ; +0x4a, 0x6f39a2\nCMP             R0, R3                                                 ; +0x4c, 0x6f39a4\nBLE             loc_6F39D4                                             ; +0x4e, 0x6f39a6\nLDR.W           R3, [R4,#0x3B0]                                        ; +0x50, 0x6f39a8\nLDR.W           R3, [R3,#0x580]                                        ; +0x54, 0x6f39ac\nLDRB.W          R3, [R3,#0x3D9]                                        ; +0x58, 0x6f39b0\nCBZ             R3, loc_6F39CC                                         ; +0x5c, 0x6f39b4\nLDR.W           R3, [R4,#0x3B0]                                        ; +0x5e, 0x6f39b6\nLDR.W           R3, [R3,#0x580]                                        ; +0x62, 0x6f39ba\nLDRB.W          R3, [R3,#0x3D8]                                        ; +0x66, 0x6f39be\nCBNZ            R3, loc_6F39DC                                         ; +0x6a, 0x6f39c2\nMOV             R0, R4; this                                           ; +0x6c, 0x6f39c4\nBL              _ZN8EditorUI17showMaxBasicErrorEv; EditorUI::showMaxBasicError(void) ; +0x6e, 0x6f39c6\nB               loc_6F3A72                                             ; +0x72, 0x6f39ca\nMOV             R0, R4; this                                           ; +0x74, 0x6f39cc\nBL              _ZN8EditorUI12showMaxErrorEv; EditorUI::showMaxError(void) ; +0x76, 0x6f39ce\nB               loc_6F3A72                                             ; +0x7a, 0x6f39d2\nMOVW            R3, #0x9C40                                            ; +0x7c, 0x6f39d4\nCMP             R0, R3                                                 ; +0x80, 0x6f39d8\nBGT             loc_6F39B6                                             ; +0x82, 0x6f39da\nLDR.W           R0, [R4,#0x29C]; this                                  ; +0x84, 0x6f39dc\nBL              _ZNK7cocos2d7CCArray5countEv; cocos2d::CCArray::count(void) ; +0x88, 0x6f39e0\nCBNZ            R0, loc_6F39F6                                         ; +0x8c, 0x6f39e4\nBL              _ZN7cocos2d7CCArray6createEv; cocos2d::CCArray::create(void) ; +0x8e, 0x6f39e6\nLDR.W           R1, [R4,#0x3E4]; cocos2d::CCObject *                   ; +0x92, 0x6f39ea\nMOV             R6, R0                                                 ; +0x96, 0x6f39ee\nBL              _ZN7cocos2d7CCArray9addObjectEPNS_8CCObjectE; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0x98, 0x6f39f0\nB               loc_6F39FA                                             ; +0x9c, 0x6f39f4\nLDR.W           R6, [R4,#0x29C]                                        ; +0x9e, 0x6f39f6\nADD             R5, SP, #0x2C+var_20                                   ; +0xa2, 0x6f39fa\nMOVS            R3, #0; bool                                           ; +0xa4, 0x6f39fc\nMOV             R2, R6; bool                                           ; +0xa6, 0x6f39fe\nSTR             R3, [SP,#0x2C+var_2C]                                  ; +0xa8, 0x6f3a00\nMOV             R0, R5; this                                           ; +0xaa, 0x6f3a02\nMOV             R1, R4; cocos2d::CCArray *                             ; +0xac, 0x6f3a04\nBL              _ZN8EditorUI11copyObjectsEPN7cocos2d7CCArrayEbb; EditorUI::copyObjects(cocos2d::CCArray *,bool,bool) ; +0xae, 0x6f3a06\nLDR.W           R2, [R4,#0x3B0]                                        ; +0xb2, 0x6f3a0a\nADD             R6, SP, #0x2C+var_14                                   ; +0xb6, 0x6f3a0e\nMOVW            R3, #0x2E08                                            ; +0xb8, 0x6f3a10\nMOVS            R1, #1                                                 ; +0xbc, 0x6f3a14\nMOV             R0, R6                                                 ; +0xbe, 0x6f3a16\nSTRB            R1, [R2,R3]                                            ; +0xc0, 0x6f3a18\nMOV             R1, R5                                                 ; +0xc2, 0x6f3a1a\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEEC2ERKS5_; std::string::basic_string(std::string const&) ; +0xc4, 0x6f3a1c\nMOVS            R2, #0                                                 ; +0xc8, 0x6f3a20\nMOV             R0, R4; int                                            ; +0xca, 0x6f3a22\nMOV             R1, R6; int                                            ; +0xcc, 0x6f3a24\nMOV             R3, R2                                                 ; +0xce, 0x6f3a26\nBL              _ZN8EditorUI12pasteObjectsENSt6__ndk112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEEbb; EditorUI::pasteObjects(std::string,bool,bool) ; +0xd0, 0x6f3a28\nMOV             R0, R6                                                 ; +0xd4, 0x6f3a2c\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0xd6, 0x6f3a2e\nLDR.W           R2, [R4,#0x3B0]                                        ; +0xda, 0x6f3a32\nMOVW            R3, #0x2E08                                            ; +0xde, 0x6f3a36\nMOVS            R1, #0                                                 ; +0xe2, 0x6f3a3a\nSTRB            R1, [R2,R3]                                            ; +0xe4, 0x6f3a3c\nLDR.W           R0, [R4,#0x3B0]                                        ; +0xe6, 0x6f3a3e\nADD.W           R0, R0, #0x2F40                                        ; +0xea, 0x6f3a42\nADDS            R0, #8; this                                           ; +0xee, 0x6f3a46\nBL              _ZN16EditorBuildStats10noteActionEv; EditorBuildStats::noteAction(void) ; +0xf0, 0x6f3a48\nMOV             R0, R4; this                                           ; +0xf4, 0x6f3a4c\nBL              _ZN8EditorUI13updateButtonsEv; EditorUI::updateButtons(void) ; +0xf6, 0x6f3a4e\nMOV             R0, R4; this                                           ; +0xfa, 0x6f3a52\nBL              _ZN8EditorUI21updateObjectInfoLabelEv; EditorUI::updateObjectInfoLabel(void) ; +0xfc, 0x6f3a54\nMOV             R0, R5                                                 ; +0x100, 0x6f3a58\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x102, 0x6f3a5a\nB               loc_6F3A72                                             ; +0x106, 0x6f3a5e\nMOV             R0, R6                                                 ; +0x108, 0x6f3a60\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x10a, 0x6f3a62\nB               loc_6F3A68                                             ; +0x10e, 0x6f3a66\nMOV             R0, R5                                                 ; +0x110, 0x6f3a68\nBL              _ZNSt6__ndk112basic_stringIcNS_11char_traitsIcEENS_9allocatorIcEEED2Ev; std::string::~string() ; +0x112, 0x6f3a6a\nBL              __cxa_end_cleanup                                      ; +0x116, 0x6f3a6e\nLDR             R2, [SP,#0x2C+var_8]                                   ; +0x11a, 0x6f3a72\nLDR             R3, [R7]                                               ; +0x11c, 0x6f3a74\nCMP             R2, R3                                                 ; +0x11e, 0x6f3a76\nBEQ             loc_6F3A7E                                             ; +0x120, 0x6f3a78\nBLX             __stack_chk_fail                                       ; +0x122, 0x6f3a7a\nADD             SP, SP, #0x2C ; ','                                    ; +0x126, 0x6f3a7e\nPOP             {R4-R7,PC}                                             ; +0x128, 0x6f3a80", "xrefs": ["EditorUI::startFreeMoveTouch @ 0x6effc2", "EditorUI::handleEditorAction @ 0x6f19e4"], "is_objc": false, "is_32_bit": true, "is_64_bit": false, "idp_name": "arm", "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"}