From 6ebadb16f3c5664a8d69376383232b79690e50d0 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Sun, 20 Jul 2025 20:42:01 -0400 Subject: [WARP] Add warning if trying to run matcher on database with no function guids generated Just a sanity check so we can alert the user, they can just reanalyze their functions and the guid will be constructed --- plugins/warp/src/plugin/workflow.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'plugins/warp/src/plugin') diff --git a/plugins/warp/src/plugin/workflow.rs b/plugins/warp/src/plugin/workflow.rs index 04e14a16..878f8e94 100644 --- a/plugins/warp/src/plugin/workflow.rs +++ b/plugins/warp/src/plugin/workflow.rs @@ -105,6 +105,15 @@ pub fn run_matcher(view: &BinaryView) { }) .into_group_map(); + if functions_by_target_and_guid.is_empty() && !view.functions().is_empty() { + // The user is likely trying to run the matcher on a database before guids were automatically + // generated, we should alert them and ask if they would like to reanalyze. + // TODO: Call reanalyze for them? + log::error!("Trying to match with an older database, please reanalyze the database."); + background_task.finish(); + return; + } + // TODO: Par iter this? Using dashmap let guids_by_target: HashMap> = functions_by_target_and_guid .keys() -- cgit v1.3.1