From abbae639d8ba182e8b3cf2d5a9844a9b1f9844a1 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Fri, 26 Jul 2024 15:57:14 +0800 Subject: Support setting user global pointer value --- examples/triage/headers.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'examples/triage/headers.cpp') diff --git a/examples/triage/headers.cpp b/examples/triage/headers.cpp index 1bdc31fe..6d6e2623 100644 --- a/examples/triage/headers.cpp +++ b/examples/triage/headers.cpp @@ -26,24 +26,24 @@ void NavigationLabel::mousePressEvent(QMouseEvent*) NavigationAddressLabel::NavigationAddressLabel(const QString& text) : NavigationLabel(text, getThemeColor(AddressColor), [this]() { clickEvent(); }) { - m_address = text.toULongLong(nullptr, 0); } void NavigationAddressLabel::clickEvent() { + auto address = text().toULongLong(nullptr, 0); ViewFrame* viewFrame = ViewFrame::viewFrameForWidget(this); if (viewFrame) { if (BinaryNinja::Settings::Instance()->Get("ui.view.graph.preferred") && viewFrame->getCurrentBinaryView() && - viewFrame->getCurrentBinaryView()->GetAnalysisFunctionsForAddress(m_address).size() > 0) + viewFrame->getCurrentBinaryView()->GetAnalysisFunctionsForAddress(address).size() > 0) { - viewFrame->navigate("Graph:" + viewFrame->getCurrentDataType(), m_address); + viewFrame->navigate("Graph:" + viewFrame->getCurrentDataType(), address); } else { - viewFrame->navigate("Linear:" + viewFrame->getCurrentDataType(), m_address); + viewFrame->navigate("Linear:" + viewFrame->getCurrentDataType(), address); } } } @@ -52,24 +52,24 @@ void NavigationAddressLabel::clickEvent() NavigationCodeLabel::NavigationCodeLabel(const QString& text) : NavigationLabel(text, getThemeColor(CodeSymbolColor), [this]() { clickEvent(); }) { - m_address = text.toULongLong(nullptr, 0); } void NavigationCodeLabel::clickEvent() { + auto address = text().toULongLong(nullptr, 0); ViewFrame* viewFrame = ViewFrame::viewFrameForWidget(this); if (viewFrame) { if (BinaryNinja::Settings::Instance()->Get("ui.view.graph.preferred") && viewFrame->getCurrentBinaryView() && - viewFrame->getCurrentBinaryView()->GetAnalysisFunctionsForAddress(m_address).size() > 0) + viewFrame->getCurrentBinaryView()->GetAnalysisFunctionsForAddress(address).size() > 0) { - viewFrame->navigate("Graph:" + viewFrame->getCurrentDataType(), m_address); + viewFrame->navigate("Graph:" + viewFrame->getCurrentDataType(), address); } else { - viewFrame->navigate("Linear:" + viewFrame->getCurrentDataType(), m_address); + viewFrame->navigate("Linear:" + viewFrame->getCurrentDataType(), address); } } } -- cgit v1.3.1