GUI: data copy in disassembly
This commit is contained in:
parent
a97977e7a8
commit
b76cbd89be
|
@ -20,6 +20,7 @@
|
|||
#include "XrefBrowseDialog.h"
|
||||
#include "SourceViewerManager.h"
|
||||
#include "MiscUtil.h"
|
||||
#include "DataCopyDialog.h"
|
||||
|
||||
CPUDisassembly::CPUDisassembly(CPUWidget* parent) : Disassembly(parent)
|
||||
{
|
||||
|
@ -237,6 +238,7 @@ void CPUDisassembly::setupRightClickContextMenu()
|
|||
copyMenu->addAction(makeShortcutAction(DIcon("copy_address.png"), tr("&Address"), SLOT(copyAddressSlot()), "ActionCopyAddress"));
|
||||
copyMenu->addAction(makeAction(DIcon("copy_address.png"), tr("&RVA"), SLOT(copyRvaSlot())));
|
||||
copyMenu->addAction(makeAction(DIcon("copy_disassembly.png"), tr("Disassembly"), SLOT(copyDisassemblySlot())));
|
||||
copyMenu->addAction(makeAction(DIcon("data-copy.png"), tr("&Data..."), SLOT(copyDataSlot())));
|
||||
mMenuBuilder->addMenu(makeMenu(DIcon("copy.png"), tr("&Copy")), copyMenu);
|
||||
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("eraser.png"), tr("&Restore selection"), SLOT(undoSelectionSlot()), "ActionUndoSelection"), [this](QMenu*)
|
||||
|
@ -1412,6 +1414,17 @@ void CPUDisassembly::copyDisassemblySlot()
|
|||
Bridge::CopyToClipboard(clipboard);
|
||||
}
|
||||
|
||||
void CPUDisassembly::copyDataSlot()
|
||||
{
|
||||
dsint selStart = getSelectionStart();
|
||||
dsint selSize = getSelectionEnd() - selStart + 1;
|
||||
QVector<byte_t> data;
|
||||
data.resize(selSize);
|
||||
mMemPage->read(data.data(), selStart, selSize);
|
||||
DataCopyDialog dataDialog(&data, this);
|
||||
dataDialog.exec();
|
||||
}
|
||||
|
||||
void CPUDisassembly::findCommandSlot()
|
||||
{
|
||||
if(!DbgIsDebugging())
|
||||
|
|
|
@ -84,6 +84,7 @@ public slots:
|
|||
void copyAddressSlot();
|
||||
void copyRvaSlot();
|
||||
void copyDisassemblySlot();
|
||||
void copyDataSlot();
|
||||
void findCommandSlot();
|
||||
void openSourceSlot();
|
||||
void decompileSelectionSlot();
|
||||
|
|
Loading…
Reference in New Issue