{"type": "func", "start": 5370573024, "end": 5370573459, "name": "EditorUI::onPasteState", "pseudocode": "// \n// EditorUI::onPasteState from 0x1401c70e0 to 0x1401c7293 (435 bytes)\n// \n// 3 xrefs:\n// > EditorUI::handleEditorAction @ 0x1401c446a\n// > EditorUI::init @ 0x1401aba1f\n// > <???> @ 0x14091a798\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:28:05 +0000\n// \n\n// Hidden C++ exception states: #wind=2\nvoid __fastcall EditorUI::onPasteState(__int64 a1)\n{\n  _QWORD *v2; // rsi\n  _QWORD *v3; // rbp\n  _QWORD *v4; // rbx\n  bool hasSoundsForAction; // al\n  __int64 v6; // r10\n  __int64 v7; // rbp\n  __int64 v8; // rbx\n  __int64 v9; // rdi\n  __int64 v10; // rdx\n  unsigned int *v11; // r8\n  __int64 v12; // rax\n  _QWORD *v13; // r8\n  __int64 v14; // rcx\n  __int64 v15; // r8\n  unsigned __int64 v16; // r9\n  __int64 v17; // r8\n  unsigned int *v18; // rbx\n  __int64 v19; // rax\n  _QWORD *v20; // rbx\n  _QWORD *i; // rsi\n  void *v22; // [rsp+40h] [rbp+8h]\n\n  v2 = (_QWORD *)(a1 + 1568);\n  if ( *(_QWORD *)(a1 + 1568) )\n  {\n    v3 = (_QWORD *)(a1 + 1568);\n  }\n  else\n  {\n    if ( !cocos2d::CCArray::count(*(cocos2d::CCArray **)(a1 + 944)) )\n      return;\n    v3 = (_QWORD *)(a1 + 1568);\n  }\n  v4 = (_QWORD *)EditorSFXManager::sharedState();\n  hasSoundsForAction = EditorSFXManager::hasSoundsForAction(v4, 113);\n  EditorSFXManager::playAction((__int64)v4, 2 * hasSoundsForAction + 111);\n  v6 = qword_14090BFD0;\n  if ( !qword_14090BFD0 )\n  {\n    v22 = operator new(0x6E8u);\n    qword_14090BFD0 = GameManager::GameManager(v22);\n    (*(void (__fastcall **)(__int64))(*(_QWORD *)qword_14090BFD0 + 72LL))(qword_14090BFD0);\n    v2 = v3;\n    v6 = qword_14090BFD0;\n  }\n  v7 = *(_QWORD *)(a1 + 944);\n  v8 = *v2;\n  v9 = *(_QWORD *)(v6 + 568);\n  v10 = *(_QWORD *)(v9 + 14776);\n  if ( v10 )\n  {\n    if ( v8 )\n    {\n      GameObject::duplicateAttributes(*v2, v10);\n      *(_BYTE *)(v8 + 1156) = 1;\n    }\n    else if ( v7 )\n    {\n      v11 = *(unsigned int **)(v7 + 56);\n      v12 = *v11;\n      if ( (_DWORD)v12 )\n      {\n        v13 = *((_QWORD **)v11 + 2);\n        if ( v13 <= &v13[v12 - 1] )\n        {\n          do\n          {\n            if ( !*v13 )\n              break;\n            GameObject::duplicateAttributes(*v13, *(_QWORD *)(v9 + 14776));\n            *(_BYTE *)(v14 + 1156) = 1;\n            v13 = (_QWORD *)(v15 + 8);\n          }\n          while ( (unsigned __int64)v13 <= v16 );\n        }\n      }\n    }\n    if ( !(unsigned __int8)GameManager::getGameVariable(v6, \"0156\") )\n    {\n      v17 = *(_QWORD *)(v9 + 14776);\n      if ( v17 )\n      {\n        if ( v8 )\n        {\n          LevelEditorLayer::applyGroupState(v9, v8, v17);\n        }\n        else if ( v7 )\n        {\n          v18 = *(unsigned int **)(v7 + 56);\n          v19 = *v18;\n          if ( (_DWORD)v19 )\n          {\n            v20 = *((_QWORD **)v18 + 2);\n            for ( i = &v20[v19 - 1]; v20 <= i; ++v20 )\n            {\n              if ( !*v20 )\n                break;\n              LevelEditorLayer::applyGroupState(v9, *v20, *(_QWORD *)(v9 + 14776));\n            }\n          }\n        }\n      }\n    }\n  }\n  EditorUI::updateObjectInfoLabel(a1);\n}", "assembly": "; \n; EditorUI::onPasteState from 0x1401c70e0 to 0x1401c7293 (435 bytes)\n; \n; 3 xrefs:\n; > EditorUI::handleEditorAction @ 0x1401c446a\n; > EditorUI::init @ 0x1401aba1f\n; > <???> @ 0x14091a798\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:28:05 +0000\n; \nmov     [rsp+arg_8], rbx                                               ; +0x0, 0x1401c70e0\nmov     [rsp+arg_10], rbp                                              ; +0x5, 0x1401c70e5\npush    rsi                                                            ; +0xa, 0x1401c70ea\npush    rdi                                                            ; +0xb, 0x1401c70eb\npush    r14                                                            ; +0xc, 0x1401c70ec\nsub     rsp, 20h                                                       ; +0xe, 0x1401c70ee\nmov     r14, rcx                                                       ; +0x12, 0x1401c70f2\nlea     rsi, [rcx+620h]                                                ; +0x15, 0x1401c70f5\ncmp     qword ptr [rsi], 0                                             ; +0x1c, 0x1401c70fc\njnz     short loc_1401C7120                                            ; +0x20, 0x1401c7100\nmov     rcx, [rcx+3B0h]                                                ; +0x22, 0x1401c7102\ncall    cs:?count@CCArray@cocos2d@@QEBAIXZ; cocos2d::CCArray::count(void) ; +0x29, 0x1401c7109\ntest    eax, eax                                                       ; +0x2f, 0x1401c710f\njz      loc_1401C7280                                                  ; +0x31, 0x1401c7111\nlea     rbp, [r14+620h]                                                ; +0x37, 0x1401c7117\njmp     short loc_1401C7123                                            ; +0x3e, 0x1401c711e\nmov     rbp, rsi                                                       ; +0x40, 0x1401c7120\ncall    EditorSFXManager__sharedState                                  ; +0x43, 0x1401c7123\nmov     rbx, rax                                                       ; +0x48, 0x1401c7128\nmov     edx, 71h ; 'q'                                                 ; +0x4b, 0x1401c712b\nmov     rcx, rax                                                       ; +0x50, 0x1401c7130\ncall    EditorSFXManager__hasSoundsForAction                           ; +0x53, 0x1401c7133\nmovzx   edx, al                                                        ; +0x58, 0x1401c7138\nlea     edx, ds:6Fh[rdx*2]                                             ; +0x5b, 0x1401c713b\nmov     rcx, rbx                                                       ; +0x62, 0x1401c7142\ncall    EditorSFXManager__playAction                                   ; +0x65, 0x1401c7145\nmov     r10, cs:qword_14090BFD0                                        ; +0x6a, 0x1401c714a\ntest    r10, r10                                                       ; +0x71, 0x1401c7151\njnz     short loc_1401C718B                                            ; +0x74, 0x1401c7154\nmov     ecx, 6E8h; Size                                                ; +0x76, 0x1401c7156\ncall    ??2@YAPEAX_K@Z; operator new(unsigned __int64)                 ; +0x7b, 0x1401c715b\nmov     [rsp+38h+arg_0], rax                                           ; +0x80, 0x1401c7160\nmov     rcx, rax                                                       ; +0x85, 0x1401c7165\ncall    GameManager__GameManager                                       ; +0x88, 0x1401c7168\nnop                                                                    ; +0x8d, 0x1401c716d\nmov     cs:qword_14090BFD0, rax                                        ; +0x8e, 0x1401c716e\nmov     rcx, [rax]                                                     ; +0x95, 0x1401c7175\nmov     rdx, [rcx+48h]                                                 ; +0x98, 0x1401c7178\nmov     rcx, rax                                                       ; +0x9c, 0x1401c717c\ncall    rdx                                                            ; +0x9f, 0x1401c717f\nmov     rsi, rbp                                                       ; +0xa1, 0x1401c7181\nmov     r10, cs:qword_14090BFD0                                        ; +0xa4, 0x1401c7184\nmov     rbp, [r14+3B0h]                                                ; +0xab, 0x1401c718b\nmov     rbx, [rsi]                                                     ; +0xb2, 0x1401c7192\nmov     rdi, [r10+238h]                                                ; +0xb5, 0x1401c7195\nmov     rdx, [rdi+39B8h]                                               ; +0xbc, 0x1401c719c\ntest    rdx, rdx                                                       ; +0xc3, 0x1401c71a3\njz      loc_1401C7278                                                  ; +0xc6, 0x1401c71a6\ntest    rbx, rbx                                                       ; +0xcc, 0x1401c71ac\njz      short loc_1401C71C2                                            ; +0xcf, 0x1401c71af\nmov     rcx, rbx                                                       ; +0xd1, 0x1401c71b1\ncall    GameObject__duplicateAttributes                                ; +0xd4, 0x1401c71b4\nmov     byte ptr [rbx+484h], 1                                         ; +0xd9, 0x1401c71b9\njmp     short loc_1401C7207                                            ; +0xe0, 0x1401c71c0\ntest    rbp, rbp                                                       ; +0xe2, 0x1401c71c2\njz      short loc_1401C7207                                            ; +0xe5, 0x1401c71c5\nmov     r8, [rbp+38h]                                                  ; +0xe7, 0x1401c71c7\nmov     eax, [r8]                                                      ; +0xeb, 0x1401c71cb\ntest    eax, eax                                                       ; +0xee, 0x1401c71ce\njz      short loc_1401C7207                                            ; +0xf0, 0x1401c71d0\nmov     r8, [r8+10h]                                                   ; +0xf2, 0x1401c71d2\nlea     r9, [rax-1]                                                    ; +0xf6, 0x1401c71d6\nlea     r9, [r8+r9*8]                                                  ; +0xfa, 0x1401c71da\ncmp     r8, r9                                                         ; +0xfe, 0x1401c71de\nja      short loc_1401C7207                                            ; +0x101, 0x1401c71e1\nmov     rcx, [r8]                                                      ; +0x103, 0x1401c71e3\ntest    rcx, rcx                                                       ; +0x106, 0x1401c71e6\njz      short loc_1401C7207                                            ; +0x109, 0x1401c71e9\nmov     rdx, [rdi+39B8h]                                               ; +0x10b, 0x1401c71eb\ncall    GameObject__duplicateAttributes                                ; +0x112, 0x1401c71f2\nmov     byte ptr [rcx+484h], 1                                         ; +0x117, 0x1401c71f7\nadd     r8, 8                                                          ; +0x11e, 0x1401c71fe\ncmp     r8, r9                                                         ; +0x122, 0x1401c7202\njbe     short loc_1401C71E3                                            ; +0x125, 0x1401c7205\nlea     rdx, a0156; \"0156\"                                             ; +0x127, 0x1401c7207\nmov     rcx, r10                                                       ; +0x12e, 0x1401c720e\ncall    GameManager__getGameVariable                                   ; +0x131, 0x1401c7211\ntest    al, al                                                         ; +0x136, 0x1401c7216\njnz     short loc_1401C7278                                            ; +0x138, 0x1401c7218\nmov     r8, [rdi+39B8h]                                                ; +0x13a, 0x1401c721a\ntest    r8, r8                                                         ; +0x141, 0x1401c7221\njz      short loc_1401C7278                                            ; +0x144, 0x1401c7224\ntest    rbx, rbx                                                       ; +0x146, 0x1401c7226\njz      short loc_1401C7238                                            ; +0x149, 0x1401c7229\nmov     rdx, rbx                                                       ; +0x14b, 0x1401c722b\nmov     rcx, rdi                                                       ; +0x14e, 0x1401c722e\ncall    LevelEditorLayer__applyGroupState                              ; +0x151, 0x1401c7231\njmp     short loc_1401C7278                                            ; +0x156, 0x1401c7236\ntest    rbp, rbp                                                       ; +0x158, 0x1401c7238\njz      short loc_1401C7278                                            ; +0x15b, 0x1401c723b\nmov     rbx, [rbp+38h]                                                 ; +0x15d, 0x1401c723d\nmov     eax, [rbx]                                                     ; +0x161, 0x1401c7241\ntest    eax, eax                                                       ; +0x163, 0x1401c7243\njz      short loc_1401C7278                                            ; +0x165, 0x1401c7245\nmov     rbx, [rbx+10h]                                                 ; +0x167, 0x1401c7247\nlea     rsi, [rax-1]                                                   ; +0x16b, 0x1401c724b\nlea     rsi, [rbx+rsi*8]                                               ; +0x16f, 0x1401c724f\ncmp     rbx, rsi                                                       ; +0x173, 0x1401c7253\nja      short loc_1401C7278                                            ; +0x176, 0x1401c7256\nmov     rdx, [rbx]                                                     ; +0x178, 0x1401c7258\ntest    rdx, rdx                                                       ; +0x17b, 0x1401c725b\njz      short loc_1401C7278                                            ; +0x17e, 0x1401c725e\nmov     r8, [rdi+39B8h]                                                ; +0x180, 0x1401c7260\nmov     rcx, rdi                                                       ; +0x187, 0x1401c7267\ncall    LevelEditorLayer__applyGroupState                              ; +0x18a, 0x1401c726a\nadd     rbx, 8                                                         ; +0x18f, 0x1401c726f\ncmp     rbx, rsi                                                       ; +0x193, 0x1401c7273\njbe     short loc_1401C7258                                            ; +0x196, 0x1401c7276\nmov     rcx, r14                                                       ; +0x198, 0x1401c7278\ncall    EditorUI__updateObjectInfoLabel                                ; +0x19b, 0x1401c727b\nmov     rbx, [rsp+38h+arg_8]                                           ; +0x1a0, 0x1401c7280\nmov     rbp, [rsp+38h+arg_10]                                          ; +0x1a5, 0x1401c7285\nadd     rsp, 20h                                                       ; +0x1aa, 0x1401c728a\npop     r14                                                            ; +0x1ae, 0x1401c728e\npop     rdi                                                            ; +0x1b0, 0x1401c7290\npop     rsi                                                            ; +0x1b1, 0x1401c7291\nretn                                                                   ; +0x1b2, 0x1401c7292", "xrefs": ["EditorUI::handleEditorAction @ 0x1401c446a", "EditorUI::init @ 0x1401aba1f", "<???> @ 0x14091a798"], "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"}