summaryrefslogtreecommitdiff
path: root/plugins/warp/src/matcher.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2024-10-24 19:17:11 -0400
committerMason Reed <mason@vector35.com>2024-10-24 19:17:11 -0400
commitf9ff195350d6dc0bf19627cf1f19e36b20890a31 (patch)
treeca6f7f604146ea2efe96d93f439d8f9630c8df45 /plugins/warp/src/matcher.rs
parente151425087b6c0ee8c4d099bfc2d6d1268201db0 (diff)
Make WARP function guid generation infallible
Diffstat (limited to 'plugins/warp/src/matcher.rs')
-rw-r--r--plugins/warp/src/matcher.rs39
1 files changed, 19 insertions, 20 deletions
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()
+ );
}
}
}