{"type": "func", "start": 4295152304, "end": 4295152606, "name": "EditorUI::toggleDuplicateButton", "pseudocode": "// \n// EditorUI::toggleDuplicateButton from 0x10002d2b0 to 0x10002d3de (302 bytes)\n// \n// 1 xrefs:\n// > EditorUI::updateButtons @ 0x10002c83c\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 __fastcall EditorUI::toggleDuplicateButton(EditorUI *a1)\n{\n  CCMenuItemSpriteExtra *m_copyPasteBtn; // rdi\n  int v3; // eax\n  void *v4; // r14\n  unsigned __int8 v5; // r15\n  char v6; // r12\n  CCMenuItemSpriteExtra *m_copyBtn; // rdi\n  GameManager *v8; // rax\n  unsigned int sizex2; // ecx\n  std::size_t size; // rcx\n  CCMenuItemSpriteExtra *m_pasteBtn; // rdi\n  void *v12; // rsi\n  unsigned int v13; // r14d\n\n  if ( a1->m_selectedObject )\n  {\n    m_copyPasteBtn = a1->m_copyPasteBtn;\n    m_copyPasteBtn->m_animationEnabled = 1;\nLABEL_4:\n    v4 = &unk_100815540;\n    v5 = -1;\n    v6 = 1;\n    goto LABEL_5;\n  }\n  v3 = sub_100720070(a1->m_selectedObjects);\n  m_copyPasteBtn = a1->m_copyPasteBtn;\n  m_copyPasteBtn->m_animationEnabled = v3 != 0;\n  if ( v3 )\n    goto LABEL_4;\n  v6 = 0;\n  v4 = &unk_100815543;\n  v5 = -81;\nLABEL_5:\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, void *))m_copyPasteBtn->setColor)(m_copyPasteBtn, v4);\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_copyPasteBtn->setOpacity)(a1->m_copyPasteBtn, v5);\n  m_copyBtn = a1->m_copyBtn;\n  m_copyBtn->m_animationEnabled = v6;\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, void *))m_copyBtn->setColor)(m_copyBtn, v4);\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_copyBtn->setOpacity)(a1->m_copyBtn, v5);\n  v8 = GameManager::sharedState();\n  sizex2 = v8->m_editorClipboard.m_data.m_short.sizex2;\n  if ( (sizex2 & 1) != 0 )\n    size = v8->m_editorClipboard.m_data.m_long.size;\n  else\n    size = sizex2 >> 1;\n  m_pasteBtn = a1->m_pasteBtn;\n  m_pasteBtn->m_animationEnabled = size != 0;\n  v12 = &unk_100815543;\n  if ( size )\n    v12 = &unk_100815540;\n  v13 = 175;\n  if ( size )\n    v13 = 255;\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, void *))m_pasteBtn->setColor)(m_pasteBtn, v12);\n  ((void (__fastcall *)(CCMenuItemSpriteExtra *, _QWORD))a1->m_pasteBtn->setOpacity)(a1->m_pasteBtn, v13);\n}", "assembly": "; \n; EditorUI::toggleDuplicateButton from 0x10002d2b0 to 0x10002d3de (302 bytes)\n; \n; 1 xrefs:\n; > EditorUI::updateButtons @ 0x10002c83c\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    rbp                                                            ; +0x0, 0x10002d2b0\nmov     rbp, rsp                                                       ; +0x1, 0x10002d2b1\npush    r15                                                            ; +0x4, 0x10002d2b4\npush    r14                                                            ; +0x6, 0x10002d2b6\npush    r12                                                            ; +0x8, 0x10002d2b8\npush    rbx                                                            ; +0xa, 0x10002d2ba\nmov     rbx, rdi                                                       ; +0xb, 0x10002d2bb\ncmp     qword ptr [rdi+520h], 0                                        ; +0xe, 0x10002d2be\njz      short loc_10002D2D8                                            ; +0x16, 0x10002d2c6\nmov     rdi, [rbx+3F0h]                                                ; +0x18, 0x10002d2c8\nmov     byte ptr [rdi+198h], 1                                         ; +0x1f, 0x10002d2cf\njmp     short loc_10002D2FA                                            ; +0x26, 0x10002d2d6\nmov     rdi, [rbx+328h]                                                ; +0x28, 0x10002d2d8\ncall    sub_100720070                                                  ; +0x2f, 0x10002d2df\nmov     rdi, [rbx+3F0h]                                                ; +0x34, 0x10002d2e4\ntest    eax, eax                                                       ; +0x3b, 0x10002d2eb\nsetnz   byte ptr [rdi+198h]                                            ; +0x3d, 0x10002d2ed\njz      loc_10002D3CC                                                  ; +0x44, 0x10002d2f4\nlea     r14, unk_100815540                                             ; +0x4a, 0x10002d2fa\nmov     r15b, 0FFh                                                     ; +0x51, 0x10002d301\nmov     r12b, 1                                                        ; +0x54, 0x10002d304\nmov     rax, [rdi]                                                     ; +0x57, 0x10002d307\nmov     rsi, r14                                                       ; +0x5a, 0x10002d30a\ncall    qword ptr [rax+3B0h]                                           ; +0x5d, 0x10002d30d\nmov     rdi, [rbx+3F0h]                                                ; +0x63, 0x10002d313\nmov     rax, [rdi]                                                     ; +0x6a, 0x10002d31a\nmovzx   r15d, r15b                                                     ; +0x6d, 0x10002d31d\nmov     esi, r15d                                                      ; +0x71, 0x10002d321\ncall    qword ptr [rax+380h]                                           ; +0x74, 0x10002d324\nmov     rdi, [rbx+3F8h]                                                ; +0x7a, 0x10002d32a\nmov     [rdi+198h], r12b                                               ; +0x81, 0x10002d331\nmov     rax, [rdi]                                                     ; +0x88, 0x10002d338\nmov     rsi, r14                                                       ; +0x8b, 0x10002d33b\ncall    qword ptr [rax+3B0h]                                           ; +0x8e, 0x10002d33e\nmov     rdi, [rbx+3F8h]                                                ; +0x94, 0x10002d344\nmov     rax, [rdi]                                                     ; +0x9b, 0x10002d34b\nmov     esi, r15d                                                      ; +0x9e, 0x10002d34e\ncall    qword ptr [rax+380h]                                           ; +0xa1, 0x10002d351\ncall    GameManager__sharedState                                       ; +0xa7, 0x10002d357\nmovzx   ecx, byte ptr [rax+1D8h]                                       ; +0xac, 0x10002d35c\ntest    cl, 1                                                          ; +0xb3, 0x10002d363\njnz     short loc_10002D36C                                            ; +0xb6, 0x10002d366\nshr     ecx, 1                                                         ; +0xb8, 0x10002d368\njmp     short loc_10002D373                                            ; +0xba, 0x10002d36a\nmov     rcx, [rax+1E0h]                                                ; +0xbc, 0x10002d36c\ntest    rcx, rcx                                                       ; +0xc3, 0x10002d373\nmov     rdi, [rbx+400h]                                                ; +0xc6, 0x10002d376\nsetnz   byte ptr [rdi+198h]                                            ; +0xcd, 0x10002d37d\nlea     rax, unk_100815540                                             ; +0xd4, 0x10002d384\nlea     rsi, unk_100815543                                             ; +0xdb, 0x10002d38b\ncmovnz  rsi, rax                                                       ; +0xe2, 0x10002d392\nmov     rax, [rdi]                                                     ; +0xe6, 0x10002d396\nmov     ecx, 0FFh                                                      ; +0xe9, 0x10002d399\nmov     r14d, 0AFh                                                     ; +0xee, 0x10002d39e\ncmovnz  r14d, ecx                                                      ; +0xf4, 0x10002d3a4\ncall    qword ptr [rax+3B0h]                                           ; +0xf8, 0x10002d3a8\nmov     rdi, [rbx+400h]                                                ; +0xfe, 0x10002d3ae\nmov     rax, [rdi]                                                     ; +0x105, 0x10002d3b5\nmov     rax, [rax+380h]                                                ; +0x108, 0x10002d3b8\nmov     esi, r14d                                                      ; +0x10f, 0x10002d3bf\npop     rbx                                                            ; +0x112, 0x10002d3c2\npop     r12                                                            ; +0x113, 0x10002d3c3\npop     r14                                                            ; +0x115, 0x10002d3c5\npop     r15                                                            ; +0x117, 0x10002d3c7\npop     rbp                                                            ; +0x119, 0x10002d3c9\njmp     rax                                                            ; +0x11a, 0x10002d3ca\nxor     r12d, r12d                                                     ; +0x11c, 0x10002d3cc\nlea     r14, unk_100815543                                             ; +0x11f, 0x10002d3cf\nmov     r15b, 0AFh                                                     ; +0x126, 0x10002d3d6\njmp     loc_10002D307                                                  ; +0x129, 0x10002d3d9", "xrefs": ["EditorUI::updateButtons @ 0x10002c83c"], "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"}