diff options
| author | Jordan Wiens <github@psifertex.com> | 2025-12-18 22:38:25 -0500 |
|---|---|---|
| committer | Jordan Wiens <github@psifertex.com> | 2025-12-18 22:38:25 -0500 |
| commit | 9f9cf3a2cfb45d2e2f3b3dad704c326114df38eb (patch) | |
| tree | 8120cf8bf052a87fe3bd6fcdbaf1755d02b5fa20 /examples/triage | |
| parent | f96697f42d7535d8a7ad9d66f965d295b2c2eaf0 (diff) | |
add go-to address support in native triage view
Diffstat (limited to 'examples/triage')
| -rw-r--r-- | examples/triage/view.cpp | 19 | ||||
| -rw-r--r-- | examples/triage/view.h | 3 |
2 files changed, 22 insertions, 0 deletions
diff --git a/examples/triage/view.cpp b/examples/triage/view.cpp index c845a4fa..8981a99b 100644 --- a/examples/triage/view.cpp +++ b/examples/triage/view.cpp @@ -152,6 +152,9 @@ TriageView::TriageView(QWidget* parent, BinaryViewRef data) : QScrollArea(parent if (m_fullAnalysisButton && (BinaryNinja::Settings::Instance()->Get<std::string>("analysis.mode", data) == "full")) m_fullAnalysisButton->hide(); + + // Bind the "Go to Address..." action + actionHandler()->bindAction("Go to Address...", UIAction([this]() { goToAddress(); })); } @@ -218,6 +221,22 @@ void TriageView::startFullAnalysis() } +void TriageView::goToAddress() +{ + uint64_t addr; + if (!ViewFrame::getAddressFromInput(this, m_data, addr, getCurrentOffset())) + return; + + ViewFrame* frame = ViewFrame::viewFrameForWidget(this); + if (!frame) + return; + + QString viewType = BinaryNinja::Settings::Instance()->Get<bool>("ui.view.graph.preferred") ? "Graph" : "Linear"; + QString dataType = QString::fromStdString(m_data->GetTypeName()); + frame->navigate(viewType + ":" + dataType, addr); +} + + void TriageView::navigateToFileOffset(uint64_t offset) { if (!m_byteView) diff --git a/examples/triage/view.h b/examples/triage/view.h index 354091fb..e691b951 100644 --- a/examples/triage/view.h +++ b/examples/triage/view.h @@ -29,6 +29,9 @@ class TriageView : public QScrollArea, public View protected: virtual void focusInEvent(QFocusEvent* event) override; + private: + void goToAddress(); + private Q_SLOTS: void startFullAnalysis(); }; |
