summaryrefslogtreecommitdiff
path: root/plugins/warp/ui/matched.cpp
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-10-12 22:46:54 -0400
committerMason Reed <mason@vector35.com>2025-10-12 22:50:20 -0400
commit40f7d40e394657575001a8146d8233f1fc4356fd (patch)
treea1dfac7f90bbd284119d0a3e10e205fe2e0303c1 /plugins/warp/ui/matched.cpp
parent49558b88ed5dacaac0bdf1946291bc37a4a88cb9 (diff)
[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
Diffstat (limited to 'plugins/warp/ui/matched.cpp')
-rw-r--r--plugins/warp/ui/matched.cpp20
1 files changed, 10 insertions, 10 deletions
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<uint64_t> address) {
+ "Remove Match", [this](WarpFunctionItem*, std::optional<uint64_t> address) {
if (!address.has_value())
return;
for (const auto& func : m_current->GetAnalysisFunctionsForAddress(*address))
{
- const bool previous = BinaryNinja::Settings::Instance()->Get<bool>(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());