Add more actions
This commit is contained in:
parent
cc63a2b59f
commit
63f3a9801c
|
|
@ -761,65 +761,6 @@ restart:
|
|||
GuiUpdateAllViews();
|
||||
}
|
||||
|
||||
/*void CPUDisassembly::setCommentSlot()
|
||||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
duint wVA = rvaToVa(getInitialSelection());
|
||||
LineEditDialog mLineEdit(this);
|
||||
mLineEdit.setTextMaxLength(MAX_COMMENT_SIZE - 2);
|
||||
QString addr_text = ToPtrString(wVA);
|
||||
char comment_text[MAX_COMMENT_SIZE] = "";
|
||||
if(DbgGetCommentAt((duint)wVA, comment_text))
|
||||
{
|
||||
if(comment_text[0] == '\1') //automatic comment
|
||||
mLineEdit.setText(QString(comment_text + 1));
|
||||
else
|
||||
mLineEdit.setText(QString(comment_text));
|
||||
}
|
||||
mLineEdit.setWindowTitle(tr("Add comment at ") + addr_text);
|
||||
if(mLineEdit.exec() != QDialog::Accepted)
|
||||
return;
|
||||
QString comment = mLineEdit.editText.replace('\r', "").replace('\n', "");
|
||||
if(!DbgSetCommentAt(wVA, comment.toUtf8().constData()))
|
||||
SimpleErrorBox(this, tr("Error!"), tr("DbgSetCommentAt failed!"));
|
||||
|
||||
static bool easter = isEaster();
|
||||
if(easter && comment.toLower() == "oep")
|
||||
{
|
||||
QFile file(":/icons/images/egg.wav");
|
||||
if(file.open(QIODevice::ReadOnly))
|
||||
{
|
||||
QByteArray egg = file.readAll();
|
||||
PlaySoundA(egg.data(), 0, SND_MEMORY | SND_ASYNC | SND_NODEFAULT);
|
||||
}
|
||||
}
|
||||
|
||||
GuiUpdateAllViews();
|
||||
}
|
||||
|
||||
void CPUDisassembly::setBookmarkSlot()
|
||||
{
|
||||
if(!DbgIsDebugging())
|
||||
return;
|
||||
duint wVA = rvaToVa(getInitialSelection());
|
||||
bool result;
|
||||
if(DbgGetBookmarkAt(wVA))
|
||||
result = DbgSetBookmarkAt(wVA, false);
|
||||
else
|
||||
result = DbgSetBookmarkAt(wVA, true);
|
||||
if(!result)
|
||||
{
|
||||
QMessageBox msg(QMessageBox::Critical, tr("Error!"), tr("DbgSetBookmarkAt failed!"));
|
||||
msg.setWindowIcon(DIcon("compile-error.png"));
|
||||
msg.setParent(this, Qt::Dialog);
|
||||
msg.setWindowFlags(msg.windowFlags() & (~Qt::WindowContextHelpButtonHint));
|
||||
msg.exec();
|
||||
}
|
||||
|
||||
GuiUpdateAllViews();
|
||||
}
|
||||
*/
|
||||
void CPUDisassembly::toggleFunctionSlot()
|
||||
{
|
||||
if(!DbgIsDebugging())
|
||||
|
|
|
|||
|
|
@ -82,7 +82,7 @@ void CPUDump::setupContextMenu()
|
|||
});
|
||||
|
||||
mCommonActions->build(mMenuBuilder, CommonActions::ActionDisasm | CommonActions::ActionMemoryMap | CommonActions::ActionDumpData | CommonActions::ActionDisasmData
|
||||
| CommonActions::ActionStackDump | CommonActions::ActionLabel);
|
||||
| CommonActions::ActionStackDump | CommonActions::ActionLabel | CommonActions::ActionWatch);
|
||||
auto wIsValidReadPtrCallback = [this](QMenu*)
|
||||
{
|
||||
duint ptr = 0;
|
||||
|
|
@ -183,7 +183,6 @@ void CPUDump::setupContextMenu()
|
|||
mMenuBuilder->addAction(makeShortcutAction(DIcon("find.png"), tr("Find &References"), SLOT(findReferencesSlot()), "ActionFindReferences"));
|
||||
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("sync.png"), tr("&Sync with expression"), SLOT(syncWithExpressionSlot()), "ActionSyncWithExpression"));
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("animal-dog.png"), ArchValue(tr("Watch DWORD"), tr("Watch QWORD")), SLOT(watchSlot()), "ActionWatchDwordQword"));
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("memmap_alloc_memory.png"), tr("Allocate Memory"), SLOT(allocMemorySlot()), "ActionAllocateMemory"));
|
||||
|
||||
MenuBuilder* wGotoMenu = new MenuBuilder(this);
|
||||
|
|
@ -1491,11 +1490,6 @@ void CPUDump::followInDumpNSlot()
|
|||
DbgCmdExec(QString("dump \"[%1]\", \"%2\"").arg(ToPtrString(rvaToVa(getSelectionStart()))).arg(i + 1));
|
||||
}
|
||||
|
||||
void CPUDump::watchSlot()
|
||||
{
|
||||
DbgCmdExec(QString("AddWatch \"[%1]\", \"uint\"").arg(ToPtrString(rvaToVa(getSelectionStart()))));
|
||||
}
|
||||
|
||||
void CPUDump::allocMemorySlot()
|
||||
{
|
||||
WordEditDialog mLineEdit(this);
|
||||
|
|
|
|||
|
|
@ -77,20 +77,13 @@ public slots:
|
|||
void findPattern();
|
||||
void copyFileOffsetSlot();
|
||||
void undoSelectionSlot();
|
||||
//void followStackSlot();
|
||||
void findReferencesSlot();
|
||||
//void followInDisasmSlot();
|
||||
//void followDataSlot();
|
||||
//void followDataDumpSlot();
|
||||
|
||||
void watchSlot();
|
||||
|
||||
void selectionUpdatedSlot();
|
||||
void syncWithExpressionSlot();
|
||||
void followInDumpNSlot();
|
||||
void allocMemorySlot();
|
||||
|
||||
//void followInMemoryMapSlot();
|
||||
void headerButtonReleasedSlot(int colIndex);
|
||||
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
#include <QClipboard>
|
||||
#include "Configuration.h"
|
||||
#include "Bridge.h"
|
||||
#include "CommonActions.h"
|
||||
#include "HexEditDialog.h"
|
||||
#include "WordEditDialog.h"
|
||||
#include "CPUMultiDump.h"
|
||||
|
|
@ -82,6 +83,10 @@ void CPUStack::setupContextMenu()
|
|||
{
|
||||
return DbgIsDebugging();
|
||||
});
|
||||
mCommonActions = new CommonActions(this, getActionHelperFuncs(), [this]()
|
||||
{
|
||||
return rvaToVa(getSelectionStart());
|
||||
});
|
||||
|
||||
//Push
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("arrow-small-down.png"), ArchValue(tr("P&ush DWORD..."), tr("P&ush QWORD...")), SLOT(pushSlot()), "ActionPush"));
|
||||
|
|
@ -131,37 +136,37 @@ void CPUStack::setupContextMenu()
|
|||
|
||||
//Breakpoint (hardware access) menu
|
||||
auto hardwareAccessMenu = makeMenu(DIcon("breakpoint_access.png"), tr("Hardware, Access"));
|
||||
hardwareAccessMenu->addAction(makeAction(DIcon("breakpoint_byte.png"), tr("&Byte"), SLOT(hardwareAccess1Slot())));
|
||||
hardwareAccessMenu->addAction(makeAction(DIcon("breakpoint_word.png"), tr("&Word"), SLOT(hardwareAccess2Slot())));
|
||||
hardwareAccessMenu->addAction(makeAction(DIcon("breakpoint_dword.png"), tr("&Dword"), SLOT(hardwareAccess4Slot())));
|
||||
hardwareAccessMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_byte.png"), tr("&Byte"), "bphws $, r, 1"));
|
||||
hardwareAccessMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_word.png"), tr("&Word"), "bphws $, r, 2"));
|
||||
hardwareAccessMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_dword.png"), tr("&Dword"), "bphws $, r, 4"));
|
||||
#ifdef _WIN64
|
||||
hardwareAccessMenu->addAction(makeAction(DIcon("breakpoint_qword.png"), tr("&Qword"), SLOT(hardwareAccess8Slot())));
|
||||
hardwareAccessMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_qword.png"), tr("&Qword"), "bphws $, r, 8"));
|
||||
#endif //_WIN64
|
||||
|
||||
//Breakpoint (hardware write) menu
|
||||
auto hardwareWriteMenu = makeMenu(DIcon("breakpoint_write.png"), tr("Hardware, Write"));
|
||||
hardwareWriteMenu->addAction(makeAction(DIcon("breakpoint_byte.png"), tr("&Byte"), SLOT(hardwareWrite1Slot())));
|
||||
hardwareWriteMenu->addAction(makeAction(DIcon("breakpoint_word.png"), tr("&Word"), SLOT(hardwareWrite2Slot())));
|
||||
hardwareWriteMenu->addAction(makeAction(DIcon("breakpoint_dword.png"), tr("&Dword"), SLOT(hardwareWrite4Slot())));
|
||||
hardwareWriteMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_byte.png"), tr("&Byte"), "bphws $, w, 1"));
|
||||
hardwareWriteMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_word.png"), tr("&Word"), "bphws $, w, 2"));
|
||||
hardwareWriteMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_dword.png"), tr("&Dword"), "bphws $, w, 4"));
|
||||
#ifdef _WIN64
|
||||
hardwareWriteMenu->addAction(makeAction(DIcon("breakpoint_qword.png"), tr("&Qword"), SLOT(hardwareAccess8Slot())));
|
||||
hardwareWriteMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_qword.png"), tr("&Qword"), "bphws $, r, 8"));
|
||||
#endif //_WIN64
|
||||
|
||||
//Breakpoint (remove hardware)
|
||||
auto hardwareRemove = makeAction(DIcon("breakpoint_remove.png"), tr("Remove &Hardware"), SLOT(hardwareRemoveSlot()));
|
||||
auto hardwareRemove = mCommonActions->makeCommandAction(DIcon("breakpoint_remove.png"), tr("Remove &Hardware"), "bphwc $");
|
||||
|
||||
//Breakpoint (memory access) menu
|
||||
auto memoryAccessMenu = makeMenu(DIcon("breakpoint_memory_access.png"), tr("Memory, Access"));
|
||||
memoryAccessMenu->addAction(makeAction(DIcon("breakpoint_memory_singleshoot.png"), tr("&Singleshoot"), SLOT(memoryAccessSingleshootSlot())));
|
||||
memoryAccessMenu->addAction(makeAction(DIcon("breakpoint_memory_restore_on_hit.png"), tr("&Restore on hit"), SLOT(memoryAccessRestoreSlot())));
|
||||
memoryAccessMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_memory_singleshoot.png"), tr("&Singleshoot"), "bpm $, 0, a"));
|
||||
memoryAccessMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_memory_restore_on_hit.png"), tr("&Restore on hit"), "bpm $, 1, a"));
|
||||
|
||||
//Breakpoint (memory write) menu
|
||||
auto memoryWriteMenu = makeMenu(DIcon("breakpoint_memory_write.png"), tr("Memory, Write"));
|
||||
memoryWriteMenu->addAction(makeAction(DIcon("breakpoint_memory_singleshoot.png"), tr("&Singleshoot"), SLOT(memoryWriteSingleshootSlot())));
|
||||
memoryWriteMenu->addAction(makeAction(DIcon("breakpoint_memory_restore_on_hit.png"), tr("&Restore on hit"), SLOT(memoryWriteRestoreSlot())));
|
||||
memoryWriteMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_memory_singleshoot.png"), tr("&Singleshoot"), "bpm $, 0, w"));
|
||||
memoryWriteMenu->addAction(mCommonActions->makeCommandAction(DIcon("breakpoint_memory_restore_on_hit.png"), tr("&Restore on hit"), "bpm $, 1, w"));
|
||||
|
||||
//Breakpoint (remove memory) menu
|
||||
auto memoryRemove = makeAction(DIcon("breakpoint_remove.png"), tr("Remove &Memory"), SLOT(memoryRemoveSlot()));
|
||||
auto memoryRemove = mCommonActions->makeCommandAction(DIcon("breakpoint_remove.png"), tr("Remove &Memory"), "bpmc $");
|
||||
|
||||
//Breakpoint menu
|
||||
auto breakpointMenu = new MenuBuilder(this);
|
||||
|
|
@ -208,7 +213,7 @@ void CPUStack::setupContextMenu()
|
|||
|
||||
//Follow CSP
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("neworigin.png"), ArchValue(tr("Follow E&SP"), tr("Follow R&SP")), SLOT(gotoCspSlot()), "ActionGotoOrigin"));
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("cbp.png"), ArchValue(tr("Follow E&BP"), tr("Follow R&BP")), SLOT(gotoCbpSlot()), "ActionGotoCBP"), [this](QMenu*)
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("cbp.png"), ArchValue(tr("Follow E&BP"), tr("Follow R&BP")), SLOT(gotoCbpSlot()), "ActionGotoCBP"), [](QMenu*)
|
||||
{
|
||||
return DbgMemIsValidReadPtr(DbgValFromString("cbp"));
|
||||
});
|
||||
|
|
@ -246,12 +251,9 @@ void CPUStack::setupContextMenu()
|
|||
mFreezeStack->setCheckable(true);
|
||||
|
||||
//Follow in Memory Map
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("memmap_find_address_page.png"), ArchValue(tr("Follow DWORD in Memory Map"), tr("Follow QWORD in Memory Map")), SLOT(followInMemoryMapSlot()), "ActionFollowMemMap"), [this](QMenu*)
|
||||
{
|
||||
duint ptr;
|
||||
return DbgMemRead(rvaToVa(getInitialSelection()), (unsigned char*)&ptr, sizeof(ptr)) && DbgMemIsValidReadPtr(ptr);
|
||||
});
|
||||
mCommonActions->build(mMenuBuilder, CommonActions::ActionMemoryMap | CommonActions::ActionDump | CommonActions::ActionDumpData);
|
||||
|
||||
//Follow in Stack
|
||||
auto followStackName = ArchValue(tr("Follow DWORD in &Stack"), tr("Follow QWORD in &Stack"));
|
||||
mFollowStack = makeAction(DIcon("stack.png"), followStackName, SLOT(followStackSlot()));
|
||||
mFollowStack->setShortcutContext(Qt::WidgetShortcut);
|
||||
|
|
@ -277,16 +279,8 @@ void CPUStack::setupContextMenu()
|
|||
return DbgMemRead(rvaToVa(getInitialSelection()), (unsigned char*)&ptr, sizeof(ptr)) && DbgMemIsValidReadPtr(ptr);
|
||||
});
|
||||
|
||||
//Follow in Dump
|
||||
mMenuBuilder->addAction(makeAction(DIcon("dump.png"), tr("Follow in Dump"), SLOT(followInDumpSlot())));
|
||||
|
||||
//Follow PTR in Dump
|
||||
auto followDumpName = ArchValue(tr("Follow DWORD in &Dump"), tr("Follow QWORD in &Dump"));
|
||||
mMenuBuilder->addAction(makeAction(DIcon("dump.png"), followDumpName, SLOT(followDumpPtrSlot())), [this](QMenu*)
|
||||
{
|
||||
duint ptr;
|
||||
return DbgMemRead(rvaToVa(getInitialSelection()), (unsigned char*)&ptr, sizeof(ptr)) && DbgMemIsValidReadPtr(ptr);
|
||||
});
|
||||
|
||||
//Follow in Dump N menu
|
||||
auto followDumpNMenu = new MenuBuilder(this, [this](QMenu*)
|
||||
|
|
@ -303,9 +297,7 @@ void CPUStack::setupContextMenu()
|
|||
}
|
||||
mMenuBuilder->addMenu(makeMenu(DIcon("dump.png"), followDumpName.replace("&", "")), followDumpNMenu);
|
||||
|
||||
//Watch data
|
||||
auto watchDataName = ArchValue(tr("&Watch DWORD"), tr("&Watch QWORD"));
|
||||
mMenuBuilder->addAction(makeAction(DIcon("animal-dog.png"), watchDataName, SLOT(watchDataSlot())));
|
||||
mCommonActions->build(mMenuBuilder, CommonActions::ActionWatch);
|
||||
|
||||
mPluginMenu = new QMenu(this);
|
||||
Bridge::getBridge()->emitMenuAddToList(this, mPluginMenu, GUI_STACK_MENU);
|
||||
|
|
@ -729,17 +721,6 @@ void CPUStack::followDisasmSlot()
|
|||
}
|
||||
}
|
||||
|
||||
void CPUStack::followDumpPtrSlot()
|
||||
{
|
||||
duint selectedData;
|
||||
if(mMemPage->read((byte_t*)&selectedData, getInitialSelection(), sizeof(duint)))
|
||||
if(DbgMemIsValidReadPtr(selectedData)) //data is a pointer
|
||||
{
|
||||
QString addrText = ToPtrString(selectedData);
|
||||
DbgCmdExec(QString("dump " + addrText));
|
||||
}
|
||||
}
|
||||
|
||||
void CPUStack::followinDumpNSlot()
|
||||
{
|
||||
duint selectedData = rvaToVa(getInitialSelection());
|
||||
|
|
@ -768,11 +749,6 @@ void CPUStack::followStackSlot()
|
|||
}
|
||||
}
|
||||
|
||||
void CPUStack::watchDataSlot()
|
||||
{
|
||||
DbgCmdExec(QString("AddWatch \"[%1]\", \"uint\"").arg(ToPtrString(rvaToVa(getSelectionStart()))));
|
||||
}
|
||||
|
||||
void CPUStack::binaryEditSlot()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
|
|
@ -860,91 +836,6 @@ void CPUStack::binaryPasteIgnoreSizeSlot()
|
|||
GuiUpdateAllViews();
|
||||
}
|
||||
|
||||
// Copied from "CPUDump.cpp".
|
||||
void CPUStack::hardwareAccess1Slot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", r, 1"));
|
||||
}
|
||||
|
||||
void CPUStack::hardwareAccess2Slot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", r, 2"));
|
||||
}
|
||||
|
||||
void CPUStack::hardwareAccess4Slot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", r, 4"));
|
||||
}
|
||||
|
||||
void CPUStack::hardwareAccess8Slot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", r, 8"));
|
||||
}
|
||||
|
||||
void CPUStack::hardwareWrite1Slot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", w, 1"));
|
||||
}
|
||||
|
||||
void CPUStack::hardwareWrite2Slot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", w, 2"));
|
||||
}
|
||||
|
||||
void CPUStack::hardwareWrite4Slot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", w, 4"));
|
||||
}
|
||||
|
||||
void CPUStack::hardwareWrite8Slot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bphws " + addr_text + ", w, 8"));
|
||||
}
|
||||
|
||||
void CPUStack::hardwareRemoveSlot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bphwc " + addr_text));
|
||||
}
|
||||
|
||||
void CPUStack::memoryAccessSingleshootSlot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bpm " + addr_text + ", 0, a"));
|
||||
}
|
||||
|
||||
void CPUStack::memoryAccessRestoreSlot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bpm " + addr_text + ", 1, a"));
|
||||
}
|
||||
|
||||
void CPUStack::memoryWriteSingleshootSlot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bpm " + addr_text + ", 0, w"));
|
||||
}
|
||||
|
||||
void CPUStack::memoryWriteRestoreSlot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bpm " + addr_text + ", 1, w"));
|
||||
}
|
||||
|
||||
void CPUStack::memoryRemoveSlot()
|
||||
{
|
||||
QString addr_text = ToPtrString(rvaToVa(getInitialSelection()));
|
||||
DbgCmdExec(QString("bpmc " + addr_text));
|
||||
}
|
||||
|
||||
void CPUStack::findPattern()
|
||||
{
|
||||
HexEditDialog hexEdit(this);
|
||||
|
|
@ -1040,13 +931,3 @@ void CPUStack::dbgStateChangedSlot(DBGSTATE state)
|
|||
updateFreezeStackAction();
|
||||
}
|
||||
}
|
||||
|
||||
void CPUStack::followInMemoryMapSlot()
|
||||
{
|
||||
DbgCmdExec(QString("memmapdump [%1]").arg(ToHexString(rvaToVa(getInitialSelection()))));
|
||||
}
|
||||
|
||||
void CPUStack::followInDumpSlot()
|
||||
{
|
||||
DbgCmdExec(QString("dump %1").arg(ToHexString(rvaToVa(getInitialSelection()))));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
//forward declaration
|
||||
class CPUMultiDump;
|
||||
class GotoDialog;
|
||||
class CommonActions;
|
||||
|
||||
class CPUStack : public HexDump
|
||||
{
|
||||
|
|
@ -41,28 +42,12 @@ public slots:
|
|||
void selectionSet(const SELECTIONDATA* selection);
|
||||
void selectionUpdatedSlot();
|
||||
void followDisasmSlot();
|
||||
void followDumpPtrSlot();
|
||||
void followinDumpNSlot();
|
||||
void followStackSlot();
|
||||
void watchDataSlot();
|
||||
void binaryEditSlot();
|
||||
void binaryFillSlot();
|
||||
void binaryCopySlot();
|
||||
void binaryPasteSlot();
|
||||
void memoryAccessSingleshootSlot();
|
||||
void memoryAccessRestoreSlot();
|
||||
void memoryWriteSingleshootSlot();
|
||||
void memoryWriteRestoreSlot();
|
||||
void memoryRemoveSlot();
|
||||
void hardwareAccess1Slot();
|
||||
void hardwareAccess2Slot();
|
||||
void hardwareAccess4Slot();
|
||||
void hardwareAccess8Slot();
|
||||
void hardwareWrite1Slot();
|
||||
void hardwareWrite2Slot();
|
||||
void hardwareWrite4Slot();
|
||||
void hardwareWrite8Slot();
|
||||
void hardwareRemoveSlot();
|
||||
void findPattern();
|
||||
void binaryPasteIgnoreSizeSlot();
|
||||
void undoSelectionSlot();
|
||||
|
|
@ -70,8 +55,6 @@ public slots:
|
|||
void realignSlot();
|
||||
void freezeStackSlot();
|
||||
void dbgStateChangedSlot(DBGSTATE state);
|
||||
void followInMemoryMapSlot();
|
||||
void followInDumpSlot();
|
||||
void updateSlot();
|
||||
|
||||
private:
|
||||
|
|
@ -97,6 +80,7 @@ private:
|
|||
};
|
||||
|
||||
MenuBuilder* mMenuBuilder;
|
||||
CommonActions* mCommonActions;
|
||||
|
||||
std::vector<CPUCallStack> mCallstack;
|
||||
static int CPUStack::getCurrentFrame(const std::vector<CPUStack::CPUCallStack> & mCallstack, duint wVA);
|
||||
|
|
|
|||
|
|
@ -2356,11 +2356,6 @@ void DisassemblerGraphView::keyPressEvent(QKeyEvent* event)
|
|||
}
|
||||
}
|
||||
|
||||
/*void DisassemblerGraphView::followDisassemblerSlot()
|
||||
{
|
||||
DbgCmdExec(QString("disasm %1").arg(ToPtrString(this->cur_instr)));
|
||||
}*/
|
||||
|
||||
void DisassemblerGraphView::colorsUpdatedSlot()
|
||||
{
|
||||
disassemblyBackgroundColor = ConfigColor("DisassemblyBackgroundColor");
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
#include "SourceView.h"
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include <QDesktopServices>
|
||||
#include <QProcess>
|
||||
#include <QInputDialog>
|
||||
|
|
@ -118,14 +117,6 @@ void SourceView::contextMenuSlot(const QPoint & pos)
|
|||
wMenu.exec(mapToGlobal(pos));
|
||||
}
|
||||
|
||||
void SourceView::followDumpSlot()
|
||||
{
|
||||
duint addr = addrFromIndex(getInitialSelection());
|
||||
if(!DbgMemIsValidReadPtr(addr))
|
||||
return;
|
||||
DbgCmdExec(QString("dump %1").arg(ToPtrString(addr)));
|
||||
}
|
||||
|
||||
void SourceView::gotoLineSlot()
|
||||
{
|
||||
bool ok = false;
|
||||
|
|
@ -153,16 +144,12 @@ void SourceView::showInDirectorySlot()
|
|||
void SourceView::setupContextMenu()
|
||||
{
|
||||
mMenuBuilder = new MenuBuilder(this);
|
||||
mMenuBuilder->addAction(makeAction(DIcon("dump.png"), tr("Follow in &Dump"), SLOT(followDumpSlot())), [this](QMenu*)
|
||||
{
|
||||
return DbgMemIsValidReadPtr(addrFromIndex(getInitialSelection()));
|
||||
});
|
||||
mMenuBuilder->addSeparator();
|
||||
mCommonActions = new CommonActions(this, getActionHelperFuncs(), [this]()
|
||||
{
|
||||
return addrFromIndex(getInitialSelection());
|
||||
});
|
||||
mCommonActions->build(mMenuBuilder, CommonActions::ActionDisasm | CommonActions::ActionBreakpoint | CommonActions::ActionBookmark);
|
||||
mCommonActions->build(mMenuBuilder, CommonActions::ActionDisasm | CommonActions::ActionDump | CommonActions::ActionBreakpoint | CommonActions::ActionLabel | CommonActions::ActionComment
|
||||
| CommonActions::ActionBookmark | CommonActions::ActionMemoryMap | CommonActions::ActionNewOrigin | CommonActions::ActionNewThread);
|
||||
mMenuBuilder->addSeparator();
|
||||
mMenuBuilder->addAction(makeShortcutAction(DIcon("geolocation-goto.png"), tr("Go to line"), SLOT(gotoLineSlot()), "ActionGotoExpression"));
|
||||
mMenuBuilder->addAction(makeAction(DIcon("source.png"), tr("Open source file"), SLOT(openSourceFileSlot())));
|
||||
|
|
@ -216,14 +203,14 @@ void SourceView::loadFile()
|
|||
mFileLines->open(mSourcePath.toStdWString().c_str());
|
||||
if(!mFileLines->isopen())
|
||||
{
|
||||
QMessageBox::warning(this, "Error", "Failed to open file!");
|
||||
SimpleWarningBox(this, tr("Error"), tr("Failed to open file!"));
|
||||
delete mFileLines;
|
||||
mFileLines = nullptr;
|
||||
return;
|
||||
}
|
||||
if(!mFileLines->parse())
|
||||
{
|
||||
QMessageBox::warning(this, "Error", "Failed to parse file!");
|
||||
SimpleWarningBox(this, tr("Error"), tr("Failed to parse file!"));
|
||||
delete mFileLines;
|
||||
mFileLines = nullptr;
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -25,7 +25,6 @@ public:
|
|||
|
||||
private slots:
|
||||
void contextMenuSlot(const QPoint & pos);
|
||||
void followDumpSlot();
|
||||
void gotoLineSlot();
|
||||
void openSourceFileSlot();
|
||||
void showInDirectorySlot();
|
||||
|
|
|
|||
|
|
@ -42,6 +42,10 @@ void CommonActions::build(MenuBuilder* builder, int actions, std::function<void(
|
|||
{
|
||||
builder->addAction(makeCommandAction(DIcon("processor32.png"), ArchValue(tr("&Follow DWORD in Disassembler"), tr("&Follow QWORD in Disassembler")), "disasm [$]", "ActionFollowDwordQwordDisasm"), wIsValidReadPtrCallback);
|
||||
}
|
||||
if(actions & ActionDump)
|
||||
{
|
||||
builder->addAction(makeCommandAction(DIcon("dump.png"), tr("Follow in Dump"), "dump $"));
|
||||
}
|
||||
if(actions & ActionDumpData)
|
||||
{
|
||||
builder->addAction(makeCommandAction(DIcon("dump.png"), ArchValue(tr("&Follow DWORD in Current Dump"), tr("&Follow QWORD in Current Dump")), "dump [$]", "ActionFollowDwordQwordDump"), wIsValidReadPtrCallback);
|
||||
|
|
@ -158,6 +162,10 @@ void CommonActions::build(MenuBuilder* builder, int actions, std::function<void(
|
|||
{
|
||||
builder->addAction(makeShortcutAction(DIcon("createthread.png"), tr("Create New Thread Here"), std::bind(&CommonActions::createThreadSlot, this), "ActionCreateNewThreadHere"));
|
||||
}
|
||||
if(actions & ActionWatch)
|
||||
{
|
||||
builder->addAction(makeCommandAction(DIcon("animal-dog.png"), ArchValue(tr("&Watch DWORD"), tr("&Watch QWORD")), "AddWatch \"[$]\", \"uint\"", "ActionWatchDwordQword"));
|
||||
}
|
||||
}
|
||||
|
||||
QAction* CommonActions::makeCommandAction(const QIcon & icon, const QString & text, const char* cmd, const char* shortcut)
|
||||
|
|
|
|||
Loading…
Reference in New Issue