GUI: resolved issue #137
This commit is contained in:
parent
859b01fa1c
commit
57dd5d6004
|
@ -1,6 +1,7 @@
|
|||
#include "CPUStack.h"
|
||||
#include "Configuration.h"
|
||||
#include "HexEditDialog.h"
|
||||
#include "WordEditDialog.h"
|
||||
|
||||
CPUStack::CPUStack(QWidget *parent) : HexDump(parent)
|
||||
{
|
||||
|
@ -109,6 +110,10 @@ void CPUStack::setupContextMenu()
|
|||
this->addAction(mUndoSelection);
|
||||
connect(mUndoSelection, SIGNAL(triggered()), this, SLOT(undoSelectionSlot()));
|
||||
|
||||
// Modify
|
||||
mModifyAction = new QAction("Modify", this);
|
||||
connect(mModifyAction, SIGNAL(triggered()), this, SLOT(modifySlot()));
|
||||
|
||||
#ifdef _WIN64
|
||||
mGotoSp = new QAction("Follow R&SP", this);
|
||||
mGotoBp = new QAction("Follow R&BP", this);
|
||||
|
@ -258,6 +263,7 @@ void CPUStack::contextMenuEvent(QContextMenuEvent* event)
|
|||
return;
|
||||
|
||||
QMenu* wMenu = new QMenu(this); //create context menu
|
||||
wMenu->addAction(mModifyAction);
|
||||
wMenu->addMenu(mBinaryMenu);
|
||||
int_t start = rvaToVa(getSelectionStart());
|
||||
int_t end = rvaToVa(getSelectionEnd());
|
||||
|
@ -492,3 +498,17 @@ void CPUStack::undoSelectionSlot()
|
|||
DbgFunctions()->PatchRestoreRange(start, end);
|
||||
reloadData();
|
||||
}
|
||||
|
||||
void CPUStack::modifySlot()
|
||||
{
|
||||
int_t addr = getInitialSelection();
|
||||
WordEditDialog wEditDialog(this);
|
||||
int_t value=0;
|
||||
mMemPage->read(&value, addr, sizeof(int_t));
|
||||
wEditDialog.setup("Modify", value, sizeof(int_t));
|
||||
if(wEditDialog.exec()!=QDialog::Accepted)
|
||||
return;
|
||||
value=wEditDialog.getVal();
|
||||
mMemPage->write(&value, addr, sizeof(int_t));
|
||||
reloadData();
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ public slots:
|
|||
void findPattern();
|
||||
void binaryPasteIgnoreSizeSlot();
|
||||
void undoSelectionSlot();
|
||||
void modifySlot();
|
||||
|
||||
private:
|
||||
uint_t mCsp;
|
||||
|
@ -52,6 +53,7 @@ private:
|
|||
QAction* mBinaryCopyAction;
|
||||
QAction* mBinaryPasteAction;
|
||||
QAction* mBinaryPasteIgnoreSizeAction;
|
||||
QAction* mModifyAction;
|
||||
QAction* mUndoSelection;
|
||||
QAction* mGotoSp;
|
||||
QAction* mGotoBp;
|
||||
|
|
Loading…
Reference in New Issue