1
0
Fork 0

Add auto-scrolling to tables etc (#1035)

* Add auto-scrolling to tables. Add clear shortcut button. Fix bug with shortcut edit in favourites dialog.

* Add more shortcuts

* GUI for creating thread

* Use thread name in the title bar
This commit is contained in:
Torusrxxx 2016-09-02 14:47:32 +00:00 committed by Duncan Ogilvie
parent c671c457a6
commit 81bc301a79
17 changed files with 273 additions and 125 deletions

View File

@ -391,19 +391,25 @@ void DebugUpdateGui(duint disasm_addr, bool stack)
else
sprintf_s(modtext, GuiTranslateText(QT_TRANSLATE_NOOP("DBG", "Module: %s - ")), modname);
char threadswitch[256] = "";
DWORD currentThreadId = ThreadGetId(hActiveThread);
{
static DWORD PrevThreadId = 0;
if(PrevThreadId == 0)
PrevThreadId = fdProcessInfo->dwThreadId; // Initialize to Main Thread
DWORD currentThreadId = ThreadGetId(hActiveThread);
if(currentThreadId != PrevThreadId)
{
sprintf_s(threadswitch, GuiTranslateText(QT_TRANSLATE_NOOP("DBG", " (switched from %X)")), PrevThreadId);
char threadName2[MAX_THREAD_NAME_SIZE] = "";
if(!ThreadGetName(PrevThreadId, threadName2) || threadName2[0] == 0)
sprintf_s(threadName2, "%X", PrevThreadId);
sprintf_s(threadswitch, GuiTranslateText(QT_TRANSLATE_NOOP("DBG", " (switched from %s)")), threadName2);
PrevThreadId = currentThreadId;
}
}
char title[1024] = "";
sprintf_s(title, GuiTranslateText(QT_TRANSLATE_NOOP("DBG", "File: %s - PID: %X - %sThread: %X%s")), szBaseFileName, fdProcessInfo->dwProcessId, modtext, ThreadGetId(hActiveThread), threadswitch);
char threadName1[MAX_THREAD_NAME_SIZE] = "";
if(!ThreadGetName(currentThreadId, threadName1) || threadName1[0] == 0)
sprintf_s(threadName1, "%X", currentThreadId);
sprintf_s(title, GuiTranslateText(QT_TRANSLATE_NOOP("DBG", "File: %s - PID: %X - %sThread: %s%s")), szBaseFileName, fdProcessInfo->dwProcessId, modtext, threadName1, threadswitch);
GuiUpdateWindowTitle(title);
GuiUpdateAllViews();
GuiFocusView(GUI_DISASSEMBLY);

View File

@ -36,6 +36,8 @@ void ThreadCreate(CREATE_THREAD_DEBUG_INFO* CreateThread)
// The first thread (#0) is always the main program thread
if(curInfo.ThreadNumber <= 0)
strcpy_s(curInfo.threadName, GuiTranslateText(QT_TRANSLATE_NOOP("DBG", "Main Thread")));
else
curInfo.threadName[0] = 0;
// Modify global thread list
EXCLUSIVE_ACQUIRE(LockThreads);
@ -240,6 +242,23 @@ bool ThreadSetName(DWORD ThreadId, const char* Name)
return false;
}
/**
@brief ThreadGetName Get the name of the thread.
@param ThreadId The id of the thread.
@param Name The returned name of the thread. Must be at least MAX_THREAD_NAME_SIZE size
@return True if the function succeeds. False otherwise.
*/
bool ThreadGetName(DWORD ThreadId, char* Name)
{
SHARED_ACQUIRE(LockThreads);
if(threadList.find(ThreadId) != threadList.end())
{
strcpy_s(Name, MAX_THREAD_NAME_SIZE, threadList[ThreadId].threadName);
return true;
}
return false;
}
HANDLE ThreadGetHandle(DWORD ThreadId)
{
SHARED_ACQUIRE(LockThreads);

View File

@ -21,6 +21,7 @@ THREADWAITREASON ThreadGetWaitReason(HANDLE Thread);
DWORD ThreadGetLastErrorTEB(ULONG_PTR ThreadLocalBase);
DWORD ThreadGetLastError(DWORD ThreadId);
bool ThreadSetName(DWORD dwThreadId, const char* name);
bool ThreadGetName(DWORD ThreadId, char* Name);
HANDLE ThreadGetHandle(DWORD ThreadId);
DWORD ThreadGetId(HANDLE Thread);
int ThreadSuspendAll();

View File

@ -34,14 +34,15 @@ QString StdTable::paintContent(QPainter* painter, dsint rowBase, int rowOffset,
void StdTable::mouseMoveEvent(QMouseEvent* event)
{
bool wAccept = true;
int y = transY(event->y());
if(mGuiState == StdTable::MultiRowsSelectionState)
{
//qDebug() << "State = MultiRowsSelectionState";
if((transY(event->y()) >= 0) && (transY(event->y()) <= this->getTableHeigth()))
if(y >= 0 && y <= this->getTableHeigth())
{
int wRowIndex = getTableOffset() + getIndexOffsetFromY(transY(event->y()));
int wRowIndex = getTableOffset() + getIndexOffsetFromY(y);
if(wRowIndex < getRowCount())
{
@ -55,6 +56,14 @@ void StdTable::mouseMoveEvent(QMouseEvent* event)
wAccept = false;
}
}
else if(y < 0)
{
verticalScrollBar()->triggerAction(QAbstractSlider::SliderSingleStepSub);
}
else if(y > getTableHeigth())
{
verticalScrollBar()->triggerAction(QAbstractSlider::SliderSingleStepAdd);
}
}
if(wAccept == true)

View File

@ -507,6 +507,7 @@ void CPUDisassembly::setupRightClickContextMenu()
mMenuBuilder->addSeparator();
mMenuBuilder->addAction(makeShortcutAction(DIcon("neworigin.png"), tr("Set New Origin Here"), SLOT(setNewOriginHereActionSlot()), "ActionSetNewOriginHere"));
mMenuBuilder->addAction(makeShortcutAction(tr("Create New Thread Here"), SLOT(createThreadSlot()), "ActionCreateNewThreadHere"));
MenuBuilder* gotoMenu = new MenuBuilder(this);
gotoMenu->addAction(makeShortcutAction(DIcon("cbp.png"), tr("Origin"), SLOT(gotoOriginSlot()), "ActionGotoOrigin"));
@ -1455,11 +1456,7 @@ void CPUDisassembly::decompileFunctionSlot()
void CPUDisassembly::displayWarningSlot(QString title, QString text)
{
QMessageBox msg(QMessageBox::Warning, title, text, QMessageBox::Ok);
msg.setParent(this, Qt::Dialog);
msg.setWindowIcon(DIcon("compile-warning.png"));
msg.setWindowFlags(msg.windowFlags() & (~Qt::WindowContextHelpButtonHint));
msg.exec();
SimpleWarningBox(this, title, text);
}
void CPUDisassembly::paintEvent(QPaintEvent* event)
@ -1676,3 +1673,13 @@ void CPUDisassembly::analyzeModuleSlot()
{
DbgCmdExec("cfanal");
}
void CPUDisassembly::createThreadSlot()
{
WordEditDialog argWindow(this);
argWindow.setup(tr("Argument for the new thread"), 0, sizeof(duint));
if(argWindow.exec() != QDialog::Accepted)
return;
duint addr = rvaToVa(getSelectionStart());
DbgCmdExec(QString("createthread %1, %2").arg(ToPtrString(addr)).arg(ToPtrString(argWindow.getVal())).toUtf8().constData());
}

View File

@ -105,6 +105,7 @@ public slots:
void graphSlot();
void analyzeModuleSlot();
void togglePreviewSlot();
void createThreadSlot();
protected:
void paintEvent(QPaintEvent* event);

View File

@ -76,10 +76,14 @@ void CPUStack::setupContextMenu()
{
//Push
mPushAction = new QAction(ArchValue(tr("P&ush DWORD..."), tr("P&ush QWORD...")), this);
mPushAction->setShortcutContext(Qt::WidgetShortcut);
this->addAction(mPushAction);
connect(mPushAction, SIGNAL(triggered()), this, SLOT(pushSlot()));
//Pop
mPopAction = new QAction(ArchValue(tr("P&op DWORD"), tr("P&op QWORD")), this);
mPopAction->setShortcutContext(Qt::WidgetShortcut);
this->addAction(mPopAction);
connect(mPopAction, SIGNAL(triggered()), this, SLOT(popSlot()));
//Realign
@ -341,6 +345,8 @@ void CPUStack::refreshShortcutsSlot()
mGotoExpression->setShortcut(ConfigShortcut("ActionGotoExpression"));
mGotoPrevious->setShortcut(ConfigShortcut("ActionGotoPrevious"));
mGotoNext->setShortcut(ConfigShortcut("ActionGotoNext"));
mPushAction->setShortcut(ConfigShortcut("ActionPush"));
mPopAction->setShortcut(ConfigShortcut("ActionPop"));
}
void CPUStack::getColumnRichText(int col, dsint rva, RichTextPainter::List & richText)

View File

@ -64,6 +64,8 @@ FavouriteTools::FavouriteTools(QWidget* parent) :
connect(ui->listTools, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
connect(ui->listScript, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
connect(ui->listCommand, SIGNAL(itemSelectionChanged()), this, SLOT(onListSelectionChanged()));
connect(ui->tabWidget, SIGNAL(currentChanged(int)), this, SLOT(tabChanged(int)));
emit ui->listTools->itemSelectionChanged();
}
void FavouriteTools::setupTools(QString name, QTableWidget* list)
@ -325,8 +327,7 @@ void FavouriteTools::onListSelectionChanged()
if(indexes.count() < 1)
return;
ui->shortcutEdit->setErrorState(false);
currentShortcut = QKeySequence(table->item(table->currentRow(), 1)->text());
ui->shortcutEdit->setText(currentShortcut.toString(QKeySequence::NativeText));
ui->shortcutEdit->setText(table->item(table->currentRow(), 1)->text());
}
void FavouriteTools::on_shortcutEdit_askForSave()
@ -378,6 +379,30 @@ void FavouriteTools::on_shortcutEdit_askForSave()
}
}
void FavouriteTools::on_btnClearShortcut_clicked()
{
QTableWidget* table;
switch(ui->tabWidget->currentIndex())
{
case 0:
table = ui->listTools;
break;
case 1:
table = ui->listScript;
break;
case 2:
table = ui->listCommand;
break;
default:
return;
}
if(!table->rowCount())
return;
QString emptyString;
ui->shortcutEdit->setText(emptyString);
table->item(table->currentRow(), 1)->setText(emptyString);
}
void FavouriteTools::on_btnOK_clicked()
{
for(int i = 1; i <= ui->listTools->rowCount(); i++)
@ -437,6 +462,22 @@ void FavouriteTools::on_btnOK_clicked()
this->done(QDialog::Accepted);
}
void FavouriteTools::tabChanged(int i)
{
switch(i)
{
case 0:
emit ui->listTools->itemSelectionChanged();
break;
case 1:
emit ui->listScript->itemSelectionChanged();
break;
case 2:
emit ui->listCommand->itemSelectionChanged();
break;
}
}
FavouriteTools::~FavouriteTools()
{
delete ui;

View File

@ -35,7 +35,9 @@ public slots:
void on_btnRemoveFavouriteCommand_clicked();
void on_btnUpFavouriteCommand_clicked();
void on_btnDownFavouriteCommand_clicked();
void on_btnClearShortcut_clicked();
void onListSelectionChanged();
void tabChanged(int i);
void on_shortcutEdit_askForSave();
void on_btnOK_clicked();

View File

@ -195,6 +195,13 @@
<item>
<widget class="ShortcutEdit" name="shortcutEdit"/>
</item>
<item>
<widget class="QPushButton" name="btnClearShortcut">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View File

@ -32,31 +32,23 @@ void LogView::updateStyle()
setStyleSheet(QString("QTextEdit { color: %1; background-color: %2 }").arg(ConfigColor("AbstractTableViewTextColor").name(), ConfigColor("AbstractTableViewBackgroundColor").name()));
}
template<class T> static QAction* setupAction(const QString & text, LogView* this_object, T slot)
{
QAction* action = new QAction(text, this_object);
action->setShortcutContext(Qt::WidgetShortcut);
this_object->addAction(action);
this_object->connect(action, SIGNAL(triggered()), this_object, slot);
return action;
}
void LogView::setupContextMenu()
{
actionClear = new QAction(tr("Clea&r"), this);
connect(actionClear, SIGNAL(triggered()), this, SLOT(clearLogSlot()));
actionClear->setShortcutContext(Qt::WidgetShortcut);
this->addAction(actionClear);
actionCopy = new QAction(tr("&Copy"), this);
connect(actionCopy, SIGNAL(triggered()), this, SLOT(copy()));
actionCopy->setShortcutContext(Qt::WidgetShortcut);
this->addAction(actionCopy);
actionSelectAll = new QAction(tr("Select &All"), this);
connect(actionSelectAll, SIGNAL(triggered()), this, SLOT(selectAll()));
actionSelectAll->setShortcutContext(Qt::WidgetShortcut);
this->addAction(actionSelectAll);
actionSave = new QAction(tr("&Save"), this);
actionSave->setShortcutContext(Qt::WidgetShortcut);
connect(actionSave, SIGNAL(triggered()), this, SLOT(saveSlot()));
this->addAction(actionSave);
actionToggleLogging = new QAction(tr("Disable &Logging"), this);
actionToggleLogging->setShortcutContext(Qt::WidgetShortcut);
connect(actionToggleLogging, SIGNAL(triggered()), this, SLOT(toggleLoggingSlot()));
this->addAction(actionToggleLogging);
actionRedirectLog = new QAction(tr("&Redirect Log..."), this);
connect(actionRedirectLog, SIGNAL(triggered()), this, SLOT(redirectLogSlot()));
this->addAction(actionRedirectLog);
actionClear = setupAction(tr("Clea&r"), this, SLOT(clearLogSlot()));
actionCopy = setupAction(tr("&Copy"), this, SLOT(copy()));
actionSelectAll = setupAction(tr("Select &All"), this, SLOT(selectAll()));
actionSave = setupAction(tr("&Save"), this, SLOT(saveSlot()));
actionToggleLogging = setupAction(tr("Disable &Logging"), this, SLOT(toggleLoggingSlot()));
actionRedirectLog = setupAction(tr("&Redirect Log..."), this, SLOT(redirectLogSlot()));
refreshShortcutsSlot();
connect(Config(), SIGNAL(shortcutsUpdated()), this, SLOT(refreshShortcutsSlot()));
@ -66,6 +58,7 @@ void LogView::refreshShortcutsSlot()
{
actionCopy->setShortcut(ConfigShortcut("ActionCopy"));
actionToggleLogging->setShortcut(ConfigShortcut("ActionToggleLogging"));
actionRedirectLog->setShortcut(ConfigShortcut("ActionRedirectLog"));
}
void LogView::contextMenuEvent(QContextMenuEvent* event)

View File

@ -415,48 +415,48 @@ void RegistersView::InitMappings()
mRowsNeeded = offset + 1;
}
static QAction* setupAction(const QIcon & icon, const QString & text, RegistersView* this_object)
{
QAction* action = new QAction(icon, text, this_object);
action->setShortcutContext(Qt::WidgetShortcut);
this_object->addAction(action);
return action;
}
static QAction* setupAction(const QString & text, RegistersView* this_object)
{
QAction* action = new QAction(text, this_object);
action->setShortcutContext(Qt::WidgetShortcut);
this_object->addAction(action);
return action;
}
RegistersView::RegistersView(CPUWidget* parent) : QScrollArea(parent), mVScrollOffset(0), mParent(parent)
{
mChangeViewButton = NULL;
// precreate ContextMenu Actions
wCM_Increment = new QAction(DIcon("register_inc.png"), tr("Increment"), this);
wCM_Increment->setShortcutContext(Qt::WidgetShortcut);
this->addAction(wCM_Increment);
wCM_Decrement = new QAction(DIcon("register_dec.png"), tr("Decrement"), this);
wCM_Decrement->setShortcutContext(Qt::WidgetShortcut);
this->addAction(wCM_Decrement);
wCM_Zero = new QAction(DIcon("register_zero.png"), tr("Zero"), this);
wCM_Zero->setShortcutContext(Qt::WidgetShortcut);
this->addAction(wCM_Zero);
wCM_SetToOne = new QAction(DIcon("register_one.png"), tr("Set to 1"), this);
wCM_SetToOne->setShortcutContext(Qt::WidgetShortcut);
this->addAction(wCM_SetToOne);
wCM_Increment = setupAction(DIcon("register_inc.png"), tr("Increment"), this);
wCM_Decrement = setupAction(DIcon("register_dec.png"), tr("Decrement"), this);
wCM_Zero = setupAction(DIcon("register_zero.png"), tr("Zero"), this);
wCM_SetToOne = setupAction(DIcon("register_one.png"), tr("Set to 1"), this);
wCM_Modify = new QAction(DIcon("register_edit.png"), tr("Modify value"), this);
wCM_Modify->setShortcut(QKeySequence(Qt::Key_Enter));
wCM_ToggleValue = new QAction(DIcon("register_toggle.png"), tr("Toggle"), this);
wCM_ToggleValue->setShortcutContext(Qt::WidgetShortcut);
this->addAction(wCM_ToggleValue);
wCM_CopyToClipboard = new QAction(DIcon("copy.png"), tr("Copy value to clipboard"), this);
wCM_CopyToClipboard->setShortcutContext(Qt::WidgetShortcut);
this->addAction(wCM_CopyToClipboard);
wCM_CopySymbolToClipboard = new QAction(DIcon("pdb.png"), tr("Copy Symbol Value to Clipboard"), this);
wCM_CopySymbolToClipboard->setShortcutContext(Qt::WidgetShortcut);
this->addAction(wCM_CopySymbolToClipboard);
wCM_CopyAll = new QAction(DIcon("copy-alt.png"), tr("Copy all registers"), this);
wCM_CopyAll->setShortcutContext(Qt::WidgetShortcut);
this->addAction(wCM_CopyAll);
wCM_ToggleValue = setupAction(DIcon("register_toggle.png"), tr("Toggle"), this);
wCM_CopyToClipboard = setupAction(DIcon("copy.png"), tr("Copy value to clipboard"), this);
wCM_CopySymbolToClipboard = setupAction(DIcon("pdb.png"), tr("Copy Symbol Value to Clipboard"), this);
wCM_CopyAll = setupAction(DIcon("copy-alt.png"), tr("Copy all registers"), this);
wCM_FollowInDisassembly = new QAction(DIcon(QString("processor%1.png").arg(ArchValue("32", "64"))), tr("Follow in Disassembler"), this);
wCM_FollowInDump = new QAction(DIcon("dump.png"), tr("Follow in Dump"), this);
wCM_FollowInStack = new QAction(DIcon("stack.png"), tr("Follow in Stack"), this);
wCM_Incrementx87Stack = new QAction(DIcon("arrow-small-down.png"), tr("Increment x87 Stack"), this);
wCM_Decrementx87Stack = new QAction(DIcon("arrow-small-up.png"), tr("Decrement x87 Stack"), this);
wCM_Incrementx87Stack = setupAction(DIcon("arrow-small-down.png"), tr("Increment x87 Stack"), this);
wCM_Decrementx87Stack = setupAction(DIcon("arrow-small-up.png"), tr("Decrement x87 Stack"), this);
wCM_ChangeFPUView = new QAction(DIcon("change-view.png"), tr("Change view"), this);
wCM_IncrementPtrSize = new QAction(ArchValue(tr("Increase 4"), tr("Increase 8")), this);
wCM_DecrementPtrSize = new QAction(ArchValue(tr("Decrease 4"), tr("Decrease 8")), this);
wCM_Push = new QAction(tr("Push"), this);
wCM_Pop = new QAction(tr("Pop"), this);
wCM_Highlight = new QAction(tr("Highlight"), this);
wCM_IncrementPtrSize = setupAction(ArchValue(tr("Increase 4"), tr("Increase 8")), this);
wCM_DecrementPtrSize = setupAction(ArchValue(tr("Decrease 4"), tr("Decrease 8")), this);
wCM_Push = setupAction(tr("Push"), this);
wCM_Pop = setupAction(tr("Pop"), this);
wCM_Highlight = setupAction(tr("Highlight"), this);
// general purposes register (we allow the user to modify the value)
mGPR.insert(CAX);
@ -1174,6 +1174,13 @@ void RegistersView::refreshShortcutsSlot()
wCM_CopyToClipboard->setShortcut(ConfigShortcut("ActionCopy"));
wCM_CopySymbolToClipboard->setShortcut(ConfigShortcut("ActionCopySymbol"));
wCM_CopyAll->setShortcut(ConfigShortcut("ActionCopyAllRegisters"));
wCM_Highlight->setShortcut(ConfigShortcut("ActionHighlightingMode"));
wCM_IncrementPtrSize->setShortcut(ConfigShortcut("ActionIncreaseRegisterPtrSize"));
wCM_DecrementPtrSize->setShortcut(ConfigShortcut("ActionDecreaseRegisterPtrSize"));
wCM_Incrementx87Stack->setShortcut(ConfigShortcut("ActionIncrementx87Stack"));
wCM_Decrementx87Stack->setShortcut(ConfigShortcut("ActionDecrementx87Stack"));
wCM_Push->setShortcut(ConfigShortcut("ActionPush"));
wCM_Pop->setShortcut(ConfigShortcut("ActionPop"));
}
RegistersView::~RegistersView()

View File

@ -40,6 +40,7 @@ ShortcutsDialog::ShortcutsDialog(QWidget* parent) : QDialog(parent), ui(new Ui::
ui->tblShortcuts->setItem(j, 0, shortcutName);
ui->tblShortcuts->setItem(j, 1, shortcutKey);
}
ui->tblShortcuts->setSortingEnabled(true);
connect(ui->tblShortcuts, SIGNAL(itemSelectionChanged()), this, SLOT(syncTextfield()));
connect(ui->shortcutEdit, SIGNAL(askForSave()), this, SLOT(updateShortcut()));
@ -93,6 +94,21 @@ void ShortcutsDialog::updateShortcut()
}
}
}
void ShortcutsDialog::on_btnClearShortcut_clicked()
{
for(QMap<QString, Configuration::Shortcut>::iterator i = Config()->Shortcuts.begin(); i != Config()->Shortcuts.end(); ++i)
{
if(i.value().Name == currentShortcut.Name)
{
Config()->setShortcut(i.key(), QKeySequence());
break;
}
}
QString emptyString;
ui->tblShortcuts->item(currentRow, 1)->setText(emptyString);
ui->shortcutEdit->setText(emptyString);
ui->shortcutEdit->setErrorState(false);
}
void ShortcutsDialog::syncTextfield()
{

View File

@ -26,6 +26,7 @@ protected slots:
private slots:
void on_btnSave_clicked();
void on_btnClearShortcut_clicked();
void rejectedSlot();
private:

View File

@ -17,65 +17,61 @@
<iconset resource="../../resource.qrc">
<normaloff>:/icons/images/shortcut.png</normaloff>:/icons/images/shortcut.png</iconset>
</property>
<widget class="QTableWidget" name="tblShortcuts">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>601</width>
<height>281</height>
</rect>
</property>
</widget>
<widget class="QGroupBox" name="groupBox">
<property name="geometry">
<rect>
<x>10</x>
<y>310</y>
<width>601</width>
<height>51</height>
</rect>
</property>
<property name="title">
<string>Shortcut</string>
</property>
<widget class="ShortcutEdit" name="shortcutEdit">
<property name="geometry">
<rect>
<x>10</x>
<y>20</y>
<width>581</width>
<height>20</height>
</rect>
</property>
</widget>
</widget>
<widget class="QPushButton" name="btnSave">
<property name="geometry">
<rect>
<x>460</x>
<y>370</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>&amp;Save</string>
</property>
</widget>
<widget class="QPushButton" name="btnCancel">
<property name="geometry">
<rect>
<x>540</x>
<y>370</y>
<width>75</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>&amp;Cancel</string>
</property>
</widget>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QTableWidget" name="tblShortcuts"/>
</item>
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>Shortcut</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="ShortcutEdit" name="shortcutEdit"/>
</item>
<item>
<widget class="QPushButton" name="btnClearShortcut">
<property name="text">
<string>Clear</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnSave">
<property name="text">
<string>&amp;Save</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnCancel">
<property name="text">
<string>&amp;Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>

View File

@ -133,15 +133,31 @@ void SymbolView::setupContextMenu()
connect(mFollowModuleEntryAction, SIGNAL(triggered()), this, SLOT(moduleEntryFollow()));
mDownloadSymbolsAction = new QAction(tr("&Download Symbols for This Module"), this);
mDownloadSymbolsAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
this->addAction(mDownloadSymbolsAction);
mModuleList->mList->addAction(mDownloadSymbolsAction);
mModuleList->mSearchList->addAction(mDownloadSymbolsAction);
connect(mDownloadSymbolsAction, SIGNAL(triggered()), this, SLOT(moduleDownloadSymbols()));
mDownloadAllSymbolsAction = new QAction(tr("Download Symbols for &All Modules"), this);
mDownloadAllSymbolsAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
this->addAction(mDownloadAllSymbolsAction);
mModuleList->mList->addAction(mDownloadAllSymbolsAction);
mModuleList->mSearchList->addAction(mDownloadAllSymbolsAction);
connect(mDownloadAllSymbolsAction, SIGNAL(triggered()), this, SLOT(moduleDownloadAllSymbols()));
mCopyPathAction = new QAction(tr("Copy File &Path"), this);
mCopyPathAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
this->addAction(mCopyPathAction);
mModuleList->mList->addAction(mCopyPathAction);
mModuleList->mSearchList->addAction(mCopyPathAction);
connect(mCopyPathAction, SIGNAL(triggered()), this, SLOT(moduleCopyPath()));
mBrowseInExplorer = new QAction(tr("Browse in Explorer"), this);
mBrowseInExplorer->setShortcutContext(Qt::WidgetWithChildrenShortcut);
this->addAction(mBrowseInExplorer);
mModuleList->mList->addAction(mBrowseInExplorer);
mModuleList->mSearchList->addAction(mBrowseInExplorer);
connect(mBrowseInExplorer, SIGNAL(triggered()), this, SLOT(moduleBrowse()));
mYaraAction = new QAction(DIcon("yara.png"), tr("&Yara Memory..."), this);
@ -151,6 +167,10 @@ void SymbolView::setupContextMenu()
connect(mYaraFileAction, SIGNAL(triggered()), this, SLOT(moduleYaraFile()));
mEntropyAction = new QAction(DIcon("entropy.png"), tr("Entropy..."), this);
mEntropyAction->setShortcutContext(Qt::WidgetWithChildrenShortcut);
this->addAction(mEntropyAction);
mModuleList->mList->addAction(mEntropyAction);
mModuleList->mSearchList->addAction(mEntropyAction);
connect(mEntropyAction, SIGNAL(triggered()), this, SLOT(moduleEntropy()));
mModSetUserAction = new QAction(tr("Mark as &user module"), this);
@ -186,6 +206,11 @@ void SymbolView::refreshShortcutsSlot()
mModSetUserAction->setShortcut(ConfigShortcut("ActionMarkAsUser"));
mModSetSystemAction->setShortcut(ConfigShortcut("ActionMarkAsSystem"));
mModSetPartyAction->setShortcut(ConfigShortcut("ActionMarkAsParty"));
mEntropyAction->setShortcut(ConfigShortcut("ActionEntropy"));
mBrowseInExplorer->setShortcut(ConfigShortcut("ActionBrowseInExplorer"));
mDownloadSymbolsAction->setShortcut(ConfigShortcut("ActionDownloadSymbol"));
mDownloadAllSymbolsAction->setShortcut(ConfigShortcut("ActionDownloadAllSymbol"));
mCopyPathAction->setShortcut(ConfigShortcut("ActionCopy"));
}
void SymbolView::updateStyle()

View File

@ -412,6 +412,8 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
defaultShortcuts.insert("ActionTreatSelectionAsYMMWord", Shortcut(tr("Actions -> Treat Selection As YMMWord"), ""));
defaultShortcuts.insert("ActionIncreaseRegister", Shortcut(tr("Actions -> Increase Register"), "+"));
defaultShortcuts.insert("ActionDecreaseRegister", Shortcut(tr("Actions -> Decrease Register"), "-"));
defaultShortcuts.insert("ActionIncreaseRegisterPtrSize", Shortcut(tr("Actions -> Increase Register by") + ArchValue(QString(" 4"), QString(" 8"))));
defaultShortcuts.insert("ActionDecreaseRegisterPtrSize", Shortcut(tr("Actions -> Decrease Register by") + ArchValue(QString(" 4"), QString(" 8"))));
defaultShortcuts.insert("ActionZeroRegister", Shortcut(tr("Actions -> Zero Register"), "0"));
defaultShortcuts.insert("ActionSetOneRegister", Shortcut(tr("Actions -> Set Register to One"), "1"));
defaultShortcuts.insert("ActionToggleRegisterValue", Shortcut(tr("Actions -> Toggle Register Value"), "Space"));
@ -430,6 +432,15 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
defaultShortcuts.insert("ActionRefresh", Shortcut(tr("Actions -> Refresh"), "F5"));
defaultShortcuts.insert("ActionGraph", Shortcut(tr("Actions -> Graph"), "G"));
defaultShortcuts.insert("ActionGraphToggleOverview", Shortcut(tr("Actions -> Graph -> Toggle overview"), "O"));
defaultShortcuts.insert("ActionIncrementx87Stack", Shortcut(tr("Actions -> Increment x87 Stack")));
defaultShortcuts.insert("ActionDecrementx87Stack", Shortcut(tr("Actions -> Decrement x87 Stack")));
defaultShortcuts.insert("ActionPush", Shortcut(tr("Actions -> Push")));
defaultShortcuts.insert("ActionPop", Shortcut(tr("Actions -> Pop")));
defaultShortcuts.insert("ActionRedirectLog", Shortcut(tr("Actions -> Redirect Log")));
defaultShortcuts.insert("ActionBrowseInExplorer", Shortcut(tr("Actions -> Browse in Explorer")));
defaultShortcuts.insert("ActionDownloadSymbol", Shortcut(tr("Actions -> Download Symbols for This Module")));
defaultShortcuts.insert("ActionDownloadAllSymbol", Shortcut(tr("Actions -> Download Symbols for All Modules")));
defaultShortcuts.insert("ActionCreateNewThreadHere", Shortcut(tr("Actions -> Create New Thread Here")));
Shortcuts = defaultShortcuts;