1
0
Fork 0

GUI: resolved issue #137

This commit is contained in:
Mr. eXoDia 2014-07-24 22:27:25 +02:00
parent 859b01fa1c
commit 57dd5d6004
2 changed files with 22 additions and 0 deletions

View File

@ -1,6 +1,7 @@
#include "CPUStack.h" #include "CPUStack.h"
#include "Configuration.h" #include "Configuration.h"
#include "HexEditDialog.h" #include "HexEditDialog.h"
#include "WordEditDialog.h"
CPUStack::CPUStack(QWidget *parent) : HexDump(parent) CPUStack::CPUStack(QWidget *parent) : HexDump(parent)
{ {
@ -109,6 +110,10 @@ void CPUStack::setupContextMenu()
this->addAction(mUndoSelection); this->addAction(mUndoSelection);
connect(mUndoSelection, SIGNAL(triggered()), this, SLOT(undoSelectionSlot())); connect(mUndoSelection, SIGNAL(triggered()), this, SLOT(undoSelectionSlot()));
// Modify
mModifyAction = new QAction("Modify", this);
connect(mModifyAction, SIGNAL(triggered()), this, SLOT(modifySlot()));
#ifdef _WIN64 #ifdef _WIN64
mGotoSp = new QAction("Follow R&SP", this); mGotoSp = new QAction("Follow R&SP", this);
mGotoBp = new QAction("Follow R&BP", this); mGotoBp = new QAction("Follow R&BP", this);
@ -258,6 +263,7 @@ void CPUStack::contextMenuEvent(QContextMenuEvent* event)
return; return;
QMenu* wMenu = new QMenu(this); //create context menu QMenu* wMenu = new QMenu(this); //create context menu
wMenu->addAction(mModifyAction);
wMenu->addMenu(mBinaryMenu); wMenu->addMenu(mBinaryMenu);
int_t start = rvaToVa(getSelectionStart()); int_t start = rvaToVa(getSelectionStart());
int_t end = rvaToVa(getSelectionEnd()); int_t end = rvaToVa(getSelectionEnd());
@ -492,3 +498,17 @@ void CPUStack::undoSelectionSlot()
DbgFunctions()->PatchRestoreRange(start, end); DbgFunctions()->PatchRestoreRange(start, end);
reloadData(); 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();
}

View File

@ -42,6 +42,7 @@ public slots:
void findPattern(); void findPattern();
void binaryPasteIgnoreSizeSlot(); void binaryPasteIgnoreSizeSlot();
void undoSelectionSlot(); void undoSelectionSlot();
void modifySlot();
private: private:
uint_t mCsp; uint_t mCsp;
@ -52,6 +53,7 @@ private:
QAction* mBinaryCopyAction; QAction* mBinaryCopyAction;
QAction* mBinaryPasteAction; QAction* mBinaryPasteAction;
QAction* mBinaryPasteIgnoreSizeAction; QAction* mBinaryPasteIgnoreSizeAction;
QAction* mModifyAction;
QAction* mUndoSelection; QAction* mUndoSelection;
QAction* mGotoSp; QAction* mGotoSp;
QAction* mGotoBp; QAction* mGotoBp;