From 40f7d40e394657575001a8146d8233f1fc4356fd Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 12 Oct 2025 22:46:54 -0400 Subject: [WARP] Improve UX surrounding removal of matched functions - Adds Python API to remove matched function - Adds command + UI actions to remove matched function - Adds command + UI actions to ignore function in subsequent matches --- plugins/warp/ui/matched.cpp | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'plugins/warp/ui/matched.cpp') diff --git a/plugins/warp/ui/matched.cpp b/plugins/warp/ui/matched.cpp index aff6779f..7112e74e 100644 --- a/plugins/warp/ui/matched.cpp +++ b/plugins/warp/ui/matched.cpp @@ -27,17 +27,18 @@ WarpMatchedWidget::WarpMatchedWidget(BinaryViewRef current) m_tableWidget->setContentsMargins(0, 0, 0, 0); m_splitter->addWidget(m_tableWidget); - // Toggle the applying workflow, this workflow sets all the data for the function based on the matched function - // data. + // Removes the match for the function, this is irreversible currently, and the user must run the matcher again. + // TODO: We previously were trying to instead toggle the application of the match, but because the symbols are applied + // TODO: when applying the match metadata we would persist that regardless. m_tableWidget->RegisterContextMenuAction( - "Toggle Application", [this](WarpFunctionItem*, std::optional address) { + "Remove Match", [this](WarpFunctionItem*, std::optional address) { if (!address.has_value()) return; for (const auto& func : m_current->GetAnalysisFunctionsForAddress(*address)) { - const bool previous = BinaryNinja::Settings::Instance()->Get(WARP_APPLY_ACTIVITY, func); - BinaryNinja::Settings::Instance()->Set(WARP_APPLY_ACTIVITY, !previous, func); - func->Reanalyze(); + WarpRemoveMatchDialog dlg(this, func); + if (dlg.execute()) + Update(); } }); @@ -74,10 +75,9 @@ void WarpMatchedWidget::Update() for (const auto& analysisFunction : m_current->GetAnalysisFunctionList()) { if (const auto& matchedFunction = Warp::Function::GetMatched(*analysisFunction)) - { - uint64_t startAddress = analysisFunction->GetStart(); - m_tableWidget->InsertFunction(startAddress, new WarpFunctionItem(matchedFunction, analysisFunction)); - } + m_tableWidget->InsertFunction(analysisFunction->GetStart(), new WarpFunctionItem(matchedFunction, analysisFunction)); + else + m_tableWidget->RemoveFunction(analysisFunction->GetStart()); } m_tableWidget->GetTableView()->setModel(m_tableWidget->GetProxyModel()); m_tableWidget->GetProxyModel()->setSourceModel(m_tableWidget->GetModel()); -- cgit v1.3.1