Permalink
Browse files

GUI: resolved issue #137

  • Loading branch information...
mrexodia committed Jul 24, 2014
1 parent 859b01f commit 57dd5d600410b4d94528a638de9b3117287c82d8
Showing with 22 additions and 0 deletions.
  1. +20 −0 x64_dbg_gui/Project/Src/Gui/CPUStack.cpp
  2. +2 −0 x64_dbg_gui/Project/Src/Gui/CPUStack.h
@@ -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 @@ public slots:
QAction* mBinaryCopyAction;
QAction* mBinaryPasteAction;
QAction* mBinaryPasteIgnoreSizeAction;
QAction* mModifyAction;
QAction* mUndoSelection;
QAction* mGotoSp;
QAction* mGotoBp;

0 comments on commit 57dd5d6

Please sign in to comment.