diff options
| author | Peter LaFosse <peter@vector35.com> | 2020-04-13 17:09:55 -0400 |
|---|---|---|
| committer | Peter LaFosse <peter@vector35.com> | 2020-04-13 17:44:52 -0400 |
| commit | 1511b57efa929d7e4304d416ee0ab9edc3b7ff2e (patch) | |
| tree | 460a22129217b625e95e98833487c2ae6c047f44 | |
| parent | d263ddfe66b4cd1540b12edbb178e6ab4e706e75 (diff) | |
Make addresses clickable in scripting console
| -rw-r--r-- | ui/logview.h | 2 | ||||
| -rw-r--r-- | ui/scriptingconsole.h | 11 |
2 files changed, 12 insertions, 1 deletions
diff --git a/ui/logview.h b/ui/logview.h index 0b5272c0..be129a31 100644 --- a/ui/logview.h +++ b/ui/logview.h @@ -125,6 +125,8 @@ public: virtual bool canCopy(); static void SetLogLevel(BNLogLevel level); + static bool IsHexString(const QString& str, std::pair<int, int> offsetLen); + static bool StartsWith0x(const QString& str, std::pair<int, int> offsetLen); protected: void contextMenuEvent(QContextMenuEvent* event) override; diff --git a/ui/scriptingconsole.h b/ui/scriptingconsole.h index 48eefa6d..4f2cc5a5 100644 --- a/ui/scriptingconsole.h +++ b/ui/scriptingconsole.h @@ -98,13 +98,18 @@ class BINARYNINJAUIAPI ScriptingConsoleOutput: public QTextEdit UIActionHandler* m_handler; UIActionHandler m_actionHandler; ContextMenuManager* m_contextMenuManager; + BinaryViewRef m_data; Menu* m_menu; public: ScriptingConsoleOutput(ScriptingConsole* parent, Menu* menu); - + bool IsNavigable(const QString& str, const std::pair<int, int>& offsetLen, uint64_t& value, bool highlight) const; protected: void contextMenuEvent(QContextMenuEvent* event) override; + +public Q_SLOTS: + virtual void mousePressEvent(QMouseEvent* event) override; + void viewChanged(QWidget* frame); }; class ScriptingConsoleWidget; @@ -146,6 +151,9 @@ private Q_SLOTS: void cancel(); void showCancelButton(); +Q_SIGNALS: + void viewChanged(QWidget* frame); + protected: void customEvent(QEvent* event) override; void notifyFontChanged() override; @@ -167,6 +175,7 @@ public: virtual void NotifyOutput(const std::string& text) override; virtual void NotifyError(const std::string& text) override; virtual void NotifyInputReadyStateChanged(BNScriptingProviderInputReadyState state) override; + virtual void notifyViewChanged(ViewFrame* frame) override; void moveUpInHistory(); void moveDownInHistory(); |
