diff --git a/src/gui/Src/Gui/CPUDisassembly.cpp b/src/gui/Src/Gui/CPUDisassembly.cpp index c9a8abcf..739d0d89 100644 --- a/src/gui/Src/Gui/CPUDisassembly.cpp +++ b/src/gui/Src/Gui/CPUDisassembly.cpp @@ -1883,7 +1883,7 @@ void CPUDisassembly::labelHelpSlot() QString baseUrl(setting); QString fullUrl = baseUrl.replace("@topic", topic); - if(fullUrl.startsWith("execute://")) + if(baseUrl.startsWith("execute://")) { QString command = fullUrl.right(fullUrl.length() - 10); QProcess::execute(command); diff --git a/src/gui/Src/Gui/SymbolView.cpp b/src/gui/Src/Gui/SymbolView.cpp index af862d18..ac14f0a4 100644 --- a/src/gui/Src/Gui/SymbolView.cpp +++ b/src/gui/Src/Gui/SymbolView.cpp @@ -7,7 +7,7 @@ #include "StdIconSearchListView.h" #include "ZehSymbolTable.h" #include "DisassemblyPopup.h" - +#include #include #include #include @@ -321,6 +321,9 @@ void SymbolView::setupContextMenu() mSymbolSearchList->addAction(mToggleBookmark); connect(mToggleBookmark, SIGNAL(triggered()), this, SLOT(toggleBookmark())); + mLabelHelp = new QAction(DIcon("help"), tr("Help on Symbolic Name"), this); + connect(mLabelHelp, SIGNAL(triggered()), this, SLOT(labelHelpSlot())); + //Modules mFollowModuleAction = new QAction(disassembler, tr("&Follow in Disassembler"), this); mFollowModuleAction->setShortcutContext(Qt::WidgetWithChildrenShortcut); @@ -529,6 +532,7 @@ void SymbolView::symbolContextMenu(QMenu* menu) menu->addAction(mFollowSymbolDumpAction); if(mSymbolList->mCurList->getCellContent(mSymbolList->mCurList->getInitialSelection(), 1) == tr("Import")) menu->addAction(mFollowSymbolImportAction); + menu->addAction(mLabelHelp); menu->addSeparator(); menu->addAction(mToggleBreakpoint); menu->addAction(mToggleBookmark); @@ -580,6 +584,34 @@ void SymbolView::symbolSelectModule(duint base) } } +void SymbolView::labelHelpSlot() +{ + QString topic = mSymbolList->mCurList->getCellContent(mSymbolList->mCurList->getInitialSelection(), ZehSymbolTable::ColUndecorated); + if(topic.isEmpty()) + topic = mSymbolList->mCurList->getCellContent(mSymbolList->mCurList->getInitialSelection(), ZehSymbolTable::ColDecorated); + if(topic.isEmpty()) + return; + char setting[MAX_SETTING_SIZE] = ""; + if(!BridgeSettingGet("Misc", "HelpOnSymbolicNameUrl", setting)) + { + //"execute://winhlp32.exe -k@topic ..\\win32.hlp"; + strcpy_s(setting, "https://www.google.com/search?q=@topic"); + BridgeSettingSet("Misc", "HelpOnSymbolicNameUrl", setting); + } + QString baseUrl(setting); + QString fullUrl = baseUrl.replace("@topic", topic); + + if(baseUrl.startsWith("execute://")) + { + QString command = fullUrl.right(fullUrl.length() - 10); + QProcess::execute(command); + } + else + { + QDesktopServices::openUrl(QUrl(fullUrl)); + } +} + void SymbolView::enterPressedSlot() { auto addr = DbgValFromString(mSymbolList->mCurList->getCellContent(mSymbolList->mCurList->getInitialSelection(), 0).toUtf8().constData()); diff --git a/src/gui/Src/Gui/SymbolView.h b/src/gui/Src/Gui/SymbolView.h index d3e27dfc..bcfc384a 100644 --- a/src/gui/Src/Gui/SymbolView.h +++ b/src/gui/Src/Gui/SymbolView.h @@ -42,6 +42,7 @@ private slots: void enterPressedSlot(); void symbolContextMenu(QMenu* menu); void symbolRefreshCurrent(); + void labelHelpSlot(); void moduleContextMenu(QMenu* menu); void moduleFollow(); void moduleEntryFollow(); @@ -90,6 +91,7 @@ private: QAction* mFollowInMemMap; QAction* mLoadLib; QAction* mFreeLib; + QAction* mLabelHelp; QMenu* mPluginMenu; static void cbSymbolEnum(SYMBOLINFO* symbol, void* user);