mirror of
https://github.com/rizinorg/cutter.git
synced 2024-12-19 03:16:10 +00:00
Added option to Nop instructions (#355)
This commit is contained in:
parent
4a8352169b
commit
fa7da352cf
@ -329,6 +329,12 @@ void CutterCore::editInstruction(RVA addr, const QString &inst)
|
||||
emit instructionChanged(addr);
|
||||
}
|
||||
|
||||
void CutterCore::nopInstruction(RVA addr)
|
||||
{
|
||||
cmd("wao nop @ " + RAddressString(addr));
|
||||
emit instructionChanged(addr);
|
||||
}
|
||||
|
||||
void CutterCore::editBytes(RVA addr, const QString &bytes)
|
||||
{
|
||||
cmd("wx " + bytes + " @ " + RAddressString(addr));
|
||||
|
@ -262,6 +262,8 @@ public:
|
||||
void delFlag(RVA addr);
|
||||
|
||||
void editInstruction(RVA addr, const QString &inst);
|
||||
void nopInstruction(RVA addr);
|
||||
|
||||
void editBytes(RVA addr, const QString &inst);
|
||||
|
||||
void setComment(RVA addr, const QString &cmt);
|
||||
|
@ -14,6 +14,7 @@ DisassemblyContextMenu::DisassemblyContextMenu(QWidget *parent)
|
||||
offset(0),
|
||||
canCopy(false),
|
||||
actionEditInstruction(this),
|
||||
actionNopInstruction(this),
|
||||
actionEditBytes(this),
|
||||
actionCopy(this),
|
||||
actionAddComment(this),
|
||||
@ -87,10 +88,13 @@ DisassemblyContextMenu::DisassemblyContextMenu(QWidget *parent)
|
||||
editMenuAction = addMenu(editMenu);
|
||||
actionEditInstruction.setText(tr("Instruction"));
|
||||
editMenu->addAction(&actionEditInstruction);
|
||||
actionNopInstruction.setText(tr("Nop Instruction"));
|
||||
editMenu->addAction(&actionNopInstruction);
|
||||
actionEditBytes.setText(tr("Bytes"));
|
||||
editMenu->addAction(&actionEditBytes);
|
||||
|
||||
connect(&actionEditInstruction, SIGNAL(triggered(bool)), this, SLOT(on_actionEditInstruction_triggered()));
|
||||
connect(&actionNopInstruction, SIGNAL(triggered(bool)), this, SLOT(on_actionNopInstruction_triggered()));
|
||||
connect(&actionEditBytes, SIGNAL(triggered(bool)), this, SLOT(on_actionEditBytes_triggered()));
|
||||
|
||||
connect(&actionSetBaseBinary, SIGNAL(triggered(bool)), this, SLOT(on_actionSetBaseBinary_triggered()));
|
||||
@ -253,6 +257,11 @@ void DisassemblyContextMenu::on_actionEditInstruction_triggered()
|
||||
}
|
||||
}
|
||||
|
||||
void DisassemblyContextMenu::on_actionNopInstruction_triggered()
|
||||
{
|
||||
Core()->nopInstruction(offset);
|
||||
}
|
||||
|
||||
void DisassemblyContextMenu::on_actionEditBytes_triggered()
|
||||
{
|
||||
EditInstructionDialog *e = new EditInstructionDialog(this);
|
||||
|
@ -24,6 +24,7 @@ private slots:
|
||||
void aboutToShowSlot();
|
||||
|
||||
void on_actionEditInstruction_triggered();
|
||||
void on_actionNopInstruction_triggered();
|
||||
void on_actionEditBytes_triggered();
|
||||
|
||||
void on_actionCopy_triggered();
|
||||
@ -70,6 +71,7 @@ private:
|
||||
QMenu *editMenu;
|
||||
QAction *editMenuAction;
|
||||
QAction actionEditInstruction;
|
||||
QAction actionNopInstruction;
|
||||
QAction actionEditBytes;
|
||||
|
||||
QAction actionCopy;
|
||||
|
Loading…
Reference in New Issue
Block a user