diff options
Diffstat (limited to 'examples/triage/view.cpp')
| -rw-r--r-- | examples/triage/view.cpp | 19 |
1 files changed, 19 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) |
