{"type": "func", "start": 5372846512, "end": 5372846830, "name": "LevelEditorLayer::removeObject", "pseudocode": "// \n// LevelEditorLayer::removeObject from 0x1403f21b0 to 0x1403f22ee (318 bytes)\n// \n// 4 xrefs:\n// > EditorUI::onDelete @ 0x1401b0382\n// > LevelEditorLayer::removeSpecial @ 0x1403f5430\n// > LevelEditorLayer::breakApartTextObject @ 0x1403fdf80\n// > <???> @ 0x140925418\n// \n// This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\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:31:48 +0000\n// \n\n// Hidden C++ exception states: #wind=2\nvoid __fastcall LevelEditorLayer::removeObject(__int64 a1, __int64 a2, char a3)\n{\n  __int64 v3; // rsi\n  cocos2d::CCObject *v5; // r14\n  cocos2d::CCObject *v6; // rax\n  unsigned int v7; // ebx\n\n  if ( a2 )\n  {\n    v3 = a2;\n    if ( !a3 )\n    {\n      ++*(_DWORD *)(a1 + 15416);\n      cocos2d::CCArray::removeAllObjects(*(cocos2d::CCArray **)(a1 + 14920));\n      v5 = (cocos2d::CCObject *)operator new(0xA0u);\n      cocos2d::CCObject::CCObject(v5);\n      *(_QWORD *)v5 = &UndoObject::`vftable';\n      *((_QWORD *)v5 + 7) = 0;\n      *((_DWORD *)v5 + 16) = 0;\n      *((_QWORD *)v5 + 9) = 0;\n      *((_WORD *)v5 + 40) = 0;\n      GJTransformState::GJTransformState((__int64)v5 + 84);\n      v6 = (cocos2d::CCObject *)GameObjectCopy::create(v3);\n      *((_QWORD *)v5 + 7) = v6;\n      cocos2d::CCObject::retain(v6);\n      *((_DWORD *)v5 + 16) = 1;\n      cocos2d::CCObject::autorelease(v5);\n      cocos2d::CCArray::removeAllObjects(*(cocos2d::CCArray **)(a1 + 14920));\n      v7 = 1000;\n      if ( !*(_BYTE *)(a1 + 14663) )\n        v7 = 200;\n      if ( cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 14912)) >= v7 )\n        cocos2d::CCArray::removeObjectAtIndex(*(cocos2d::CCArray **)(a1 + 14912), 0, 1);\n      cocos2d::CCArray::addObject(*(cocos2d::CCArray **)(a1 + 14912), v5);\n    }\n    LOBYTE(a2) = 1;\n    (*(void (__fastcall **)(__int64, __int64))(*(_QWORD *)v3 + 1160LL))(v3, a2);\n    GJBaseGameLayer::removeObjectFromSection(a1, v3);\n    LevelEditorLayer::removeSpecial(a1, v3);\n    *(_BYTE *)(a1 + 15666) = 1;\n  }\n}", "assembly": "; \n; LevelEditorLayer::removeObject from 0x1403f21b0 to 0x1403f22ee (318 bytes)\n; \n; 4 xrefs:\n; > EditorUI::onDelete @ 0x1401b0382\n; > LevelEditorLayer::removeSpecial @ 0x1403f5430\n; > LevelEditorLayer::breakApartTextObject @ 0x1403fdf80\n; > <???> @ 0x140925418\n; \n; This function is hookable on this platform (idp: pc, 32 bit: False, 64 bit: True!\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:31:48 +0000\n; \ntest    rdx, rdx                                                       ; +0x0, 0x1403f21b0\njz      locret_1403F22ED                                               ; +0x3, 0x1403f21b3\nmov     [rsp+arg_0], rbx                                               ; +0x9, 0x1403f21b9\nmov     [rsp+arg_10], rsi                                              ; +0xe, 0x1403f21be\nmov     [rsp+arg_18], rdi                                              ; +0x13, 0x1403f21c3\npush    r14                                                            ; +0x18, 0x1403f21c8\nsub     rsp, 20h                                                       ; +0x1a, 0x1403f21ca\nmov     rsi, rdx                                                       ; +0x1e, 0x1403f21ce\nmov     rdi, rcx                                                       ; +0x21, 0x1403f21d1\ntest    r8b, r8b                                                       ; +0x24, 0x1403f21d4\njnz     loc_1403F22AD                                                  ; +0x27, 0x1403f21d7\ninc     dword ptr [rcx+3C38h]                                          ; +0x2d, 0x1403f21dd\nmov     rcx, [rcx+3A48h]                                               ; +0x33, 0x1403f21e3\ncall    cs:?removeAllObjects@CCArray@cocos2d@@QEAAXXZ; cocos2d::CCArray::removeAllObjects(void) ; +0x3a, 0x1403f21ea\nmov     ecx, 0A0h; Size                                                ; +0x40, 0x1403f21f0\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x45, 0x1403f21f5\nmov     r14, rax                                                       ; +0x4a, 0x1403f21fa\nmov     [rsp+28h+arg_8], rax                                           ; +0x4d, 0x1403f21fd\nmov     rcx, rax                                                       ; +0x52, 0x1403f2202\ncall    cs:??0CCObject@cocos2d@@QEAA@XZ; cocos2d::CCObject::CCObject(void) ; +0x55, 0x1403f2205\nnop                                                                    ; +0x5b, 0x1403f220b\nlea     rax, ??_7UndoObject@@6B@; const UndoObject::`vftable'          ; +0x5c, 0x1403f220c\nmov     [r14], rax                                                     ; +0x63, 0x1403f2213\nxor     eax, eax                                                       ; +0x66, 0x1403f2216\nmov     [r14+38h], rax                                                 ; +0x68, 0x1403f2218\nmov     [r14+40h], eax                                                 ; +0x6c, 0x1403f221c\nmov     [r14+48h], rax                                                 ; +0x70, 0x1403f2220\nmov     [r14+50h], ax                                                  ; +0x74, 0x1403f2224\nlea     rcx, [r14+54h]                                                 ; +0x79, 0x1403f2229\ncall    GJTransformState__GJTransformState                             ; +0x7d, 0x1403f222d\nnop                                                                    ; +0x82, 0x1403f2232\nmov     rcx, rsi                                                       ; +0x83, 0x1403f2233\ncall    GameObjectCopy__create                                         ; +0x86, 0x1403f2236\nmov     [r14+38h], rax                                                 ; +0x8b, 0x1403f223b\nmov     rcx, rax                                                       ; +0x8f, 0x1403f223f\ncall    cs:?retain@CCObject@cocos2d@@QEAAXXZ; cocos2d::CCObject::retain(void) ; +0x92, 0x1403f2242\nmov     dword ptr [r14+40h], 1                                         ; +0x98, 0x1403f2248\nmov     rcx, r14                                                       ; +0xa0, 0x1403f2250\ncall    cs:?autorelease@CCObject@cocos2d@@QEAAPEAV12@XZ; cocos2d::CCObject::autorelease(void) ; +0xa3, 0x1403f2253\nmov     rcx, [rdi+3A48h]                                               ; +0xa9, 0x1403f2259\ncall    cs:?removeAllObjects@CCArray@cocos2d@@QEAAXXZ; cocos2d::CCArray::removeAllObjects(void) ; +0xb0, 0x1403f2260\nmov     ebx, 3E8h                                                      ; +0xb6, 0x1403f2266\nmov     eax, 0C8h                                                      ; +0xbb, 0x1403f226b\ncmp     byte ptr [rdi+3947h], 0                                        ; +0xc0, 0x1403f2270\ncmovz   ebx, eax                                                       ; +0xc7, 0x1403f2277\nmov     rcx, [rdi+3A40h]                                               ; +0xca, 0x1403f227a\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0xd1, 0x1403f2281\ncmp     eax, ebx                                                       ; +0xd7, 0x1403f2287\njb      short loc_1403F229D                                            ; +0xd9, 0x1403f2289\nmov     r8b, 1                                                         ; +0xdb, 0x1403f228b\nxor     edx, edx                                                       ; +0xde, 0x1403f228e\nmov     rcx, [rdi+3A40h]                                               ; +0xe0, 0x1403f2290\ncall    cs:?removeObjectAtIndex@CCArray@cocos2d@@QEAAXI_N@Z; cocos2d::CCArray::removeObjectAtIndex(uint,bool) ; +0xe7, 0x1403f2297\nmov     rdx, r14                                                       ; +0xed, 0x1403f229d\nmov     rcx, [rdi+3A40h]                                               ; +0xf0, 0x1403f22a0\ncall    cs:?addObject@CCArray@cocos2d@@QEAAXPEAVCCObject@2@@Z; cocos2d::CCArray::addObject(cocos2d::CCObject *) ; +0xf7, 0x1403f22a7\nmov     rax, [rsi]                                                     ; +0xfd, 0x1403f22ad\nmov     dl, 1                                                          ; +0x100, 0x1403f22b0\nmov     rcx, rsi                                                       ; +0x102, 0x1403f22b2\ncall    qword ptr [rax+488h]                                           ; +0x105, 0x1403f22b5\nmov     rdx, rsi                                                       ; +0x10b, 0x1403f22bb\nmov     rcx, rdi                                                       ; +0x10e, 0x1403f22be\ncall    GJBaseGameLayer__removeObjectFromSection                       ; +0x111, 0x1403f22c1\nmov     rdx, rsi                                                       ; +0x116, 0x1403f22c6\nmov     rcx, rdi                                                       ; +0x119, 0x1403f22c9\ncall    LevelEditorLayer__removeSpecial                                ; +0x11c, 0x1403f22cc\nmov     byte ptr [rdi+3D32h], 1                                        ; +0x121, 0x1403f22d1\nmov     rbx, [rsp+28h+arg_0]                                           ; +0x128, 0x1403f22d8\nmov     rsi, [rsp+28h+arg_10]                                          ; +0x12d, 0x1403f22dd\nmov     rdi, [rsp+28h+arg_18]                                          ; +0x132, 0x1403f22e2\nadd     rsp, 20h                                                       ; +0x137, 0x1403f22e7\npop     r14                                                            ; +0x13b, 0x1403f22eb\nretn                                                                   ; +0x13d, 0x1403f22ed", "xrefs": ["EditorUI::onDelete @ 0x1401b0382", "LevelEditorLayer::removeSpecial @ 0x1403f5430", "LevelEditorLayer::breakApartTextObject @ 0x1403fdf80", "<???> @ 0x140925418"], "is_objc": false, "is_32_bit": false, "is_64_bit": true, "idp_name": "pc", "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"}