mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-18 10:56:11 +00:00
Add 'Copy instruction bytes' to disassembly context menu (#3242)
This commit is contained in:
parent
fc3e7c6378
commit
1e1c93d9d1
@ -31,6 +31,7 @@ DisassemblyContextMenu::DisassemblyContextMenu(QWidget *parent, MainWindow *main
|
||||
actionEditBytes(this),
|
||||
actionCopy(this),
|
||||
actionCopyAddr(this),
|
||||
actionCopyInstrBytes(this),
|
||||
actionAddComment(this),
|
||||
actionAnalyzeFunction(this),
|
||||
actionEditFunction(this),
|
||||
@ -76,6 +77,10 @@ DisassemblyContextMenu::DisassemblyContextMenu(QWidget *parent, MainWindow *main
|
||||
getCopyAddressSequence());
|
||||
addAction(&actionCopyAddr);
|
||||
|
||||
initAction(&actionCopyInstrBytes, tr("Copy instruction bytes"),
|
||||
SLOT(on_actionCopyInstrBytes_triggered()), getCopyInstrBytesSequence());
|
||||
addAction(&actionCopyInstrBytes);
|
||||
|
||||
initAction(&showInSubmenu, tr("Show in"), nullptr);
|
||||
addAction(&showInSubmenu);
|
||||
|
||||
@ -643,6 +648,11 @@ QKeySequence DisassemblyContextMenu::getCopyAddressSequence() const
|
||||
return { Qt::CTRL | Qt::SHIFT | Qt::Key_C };
|
||||
}
|
||||
|
||||
QKeySequence DisassemblyContextMenu::getCopyInstrBytesSequence() const
|
||||
{
|
||||
return { Qt::CTRL | Qt::ALT | Qt::Key_C };
|
||||
}
|
||||
|
||||
QKeySequence DisassemblyContextMenu::getSetToCodeSequence() const
|
||||
{
|
||||
return { Qt::Key_C };
|
||||
@ -793,6 +803,12 @@ void DisassemblyContextMenu::on_actionCopyAddr_triggered()
|
||||
clipboard->setText(RzAddressString(offset));
|
||||
}
|
||||
|
||||
void DisassemblyContextMenu::on_actionCopyInstrBytes_triggered()
|
||||
{
|
||||
QClipboard *clipboard = QApplication::clipboard();
|
||||
clipboard->setText(Core()->getInstructionBytes(offset));
|
||||
}
|
||||
|
||||
void DisassemblyContextMenu::on_actionAddBreakpoint_triggered()
|
||||
{
|
||||
Core()->toggleBreakpoint(offset);
|
||||
|
@ -42,6 +42,7 @@ private slots:
|
||||
|
||||
void on_actionCopy_triggered();
|
||||
void on_actionCopyAddr_triggered();
|
||||
void on_actionCopyInstrBytes_triggered();
|
||||
void on_actionAddComment_triggered();
|
||||
void on_actionAnalyzeFunction_triggered();
|
||||
void on_actionRename_triggered();
|
||||
@ -79,6 +80,7 @@ private:
|
||||
QKeySequence getCopySequence() const;
|
||||
QKeySequence getCommentSequence() const;
|
||||
QKeySequence getCopyAddressSequence() const;
|
||||
QKeySequence getCopyInstrBytesSequence() const;
|
||||
QKeySequence getGlobalVarSequence() const;
|
||||
QKeySequence getSetToCodeSequence() const;
|
||||
QKeySequence getSetAsStringSequence() const;
|
||||
@ -111,6 +113,7 @@ private:
|
||||
QAction actionCopy;
|
||||
QAction *copySeparator;
|
||||
QAction actionCopyAddr;
|
||||
QAction actionCopyInstrBytes;
|
||||
|
||||
QAction actionAddComment;
|
||||
QAction actionAnalyzeFunction;
|
||||
|
Loading…
Reference in New Issue
Block a user