From f9ff195350d6dc0bf19627cf1f19e36b20890a31 Mon Sep 17 00:00:00 2001 From: Mason Reed Date: Thu, 24 Oct 2024 19:17:11 -0400 Subject: Make WARP function guid generation infallible --- plugins/warp/src/matcher.rs | 39 +++++++++++++++++++-------------------- 1 file changed, 19 insertions(+), 20 deletions(-) (limited to 'plugins/warp/src/matcher.rs') diff --git a/plugins/warp/src/matcher.rs b/plugins/warp/src/matcher.rs index ae49f00a..01222a8b 100644 --- a/plugins/warp/src/matcher.rs +++ b/plugins/warp/src/matcher.rs @@ -286,26 +286,25 @@ impl Matcher { let entry_block = entry_basic_block_guid(function, llil).map(BasicBlock::new); if self.basic_block_filter.contains(&entry_block) { // Build the full function guid now - if let Some(warp_func_guid) = cached_function_guid(function, llil) { - if let Some(matched) = self.functions.get(&warp_func_guid) { - if matched.len() == 1 && !is_function_trivial { - on_new_match(&matched[0]); - } else if let Some(matched_function) = - self.match_function_from_constraints(function, &matched) - { - log::info!( - "Found best matching function `{}`... 0x{:x}", - matched_function.symbol.name, - function.start() - ); - on_new_match(matched_function); - } else { - log::error!( - "Failed to find matching function `{}`... 0x{:x}", - matched.len(), - function.start() - ); - } + let warp_func_guid = cached_function_guid(function, llil); + if let Some(matched) = self.functions.get(&warp_func_guid) { + if matched.len() == 1 && !is_function_trivial { + on_new_match(&matched[0]); + } else if let Some(matched_function) = + self.match_function_from_constraints(function, &matched) + { + log::info!( + "Found best matching function `{}`... 0x{:x}", + matched_function.symbol.name, + function.start() + ); + on_new_match(matched_function); + } else { + log::error!( + "Failed to find matching function `{}`... 0x{:x}", + matched.len(), + function.start() + ); } } } -- cgit v1.3.1