diff options
Diffstat (limited to 'plugins/warp/src/matcher.rs')
| -rw-r--r-- | plugins/warp/src/matcher.rs | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/plugins/warp/src/matcher.rs b/plugins/warp/src/matcher.rs index 8df72a20..81458f8d 100644 --- a/plugins/warp/src/matcher.rs +++ b/plugins/warp/src/matcher.rs @@ -1,5 +1,5 @@ use binaryninja::architecture::Architecture as BNArchitecture; -use binaryninja::binaryview::{BinaryView, BinaryViewExt}; +use binaryninja::binary_view::{BinaryView, BinaryViewExt}; use binaryninja::function::Function as BNFunction; use binaryninja::platform::Platform; use binaryninja::rc::Guard; @@ -119,7 +119,7 @@ impl Matcher { ty: &Type, ) { let ty_id_str = TypeGUID::from(ty).to_string(); - if view.get_type_by_id(&ty_id_str).is_some() { + if view.type_by_id(&ty_id_str).is_some() { // Type already added. return; } @@ -159,7 +159,7 @@ impl Matcher { if let Some(ref_guid) = c.guid { // NOTE: We do not need to check for cyclic reference here because // NOTE: GUID references are unable to be referenced by themselves. - if view.get_type_by_id(ref_guid.to_string()).is_none() { + if view.type_by_id(ref_guid.to_string()).is_none() { // Add the referrer to the view if it is in the Matcher types if let Some(ref_ty) = matcher.types.get(&ref_guid) { inner_add_type_to_view(matcher, view, arch, visited_refs, &ref_ty); @@ -172,7 +172,7 @@ impl Matcher { // Only try and resolve by name if not already visiting. if !resolved && visited_refs.insert(ref_name.to_string()) - && view.get_type_by_name(ref_name).is_none() + && view.type_by_name(ref_name).is_none() { // Add the ref to the view if it is in the Matcher types if let Some(ref_ty) = matcher.named_types.get(ref_name) { @@ -398,7 +398,7 @@ impl MatcherSettings { /// NOTE: If you are using this as a library then just modify the MatcherSettings directly /// in the matcher instance, that way you don't need to round-trip through Binary Ninja. pub fn register() { - let bn_settings = binaryninja::settings::Settings::new(""); + let bn_settings = binaryninja::settings::Settings::new(); let trivial_function_len_props = json!({ "title" : "Trivial Function Length", @@ -463,25 +463,24 @@ impl MatcherSettings { pub fn global() -> Self { let mut settings = MatcherSettings::default(); - let bn_settings = binaryninja::settings::Settings::new(""); + let bn_settings = binaryninja::settings::Settings::new(); if bn_settings.contains(Self::TRIVIAL_FUNCTION_LEN_SETTING) { settings.trivial_function_len = - bn_settings.get_integer(Self::TRIVIAL_FUNCTION_LEN_SETTING, None, None); + bn_settings.get_integer(Self::TRIVIAL_FUNCTION_LEN_SETTING); } if bn_settings.contains(Self::MINIMUM_FUNCTION_LEN_SETTING) { settings.minimum_function_len = - bn_settings.get_integer(Self::MINIMUM_FUNCTION_LEN_SETTING, None, None); + bn_settings.get_integer(Self::MINIMUM_FUNCTION_LEN_SETTING); } if bn_settings.contains(Self::MAXIMUM_FUNCTION_LEN_SETTING) { - match bn_settings.get_integer(Self::MAXIMUM_FUNCTION_LEN_SETTING, None, None) { + match bn_settings.get_integer(Self::MAXIMUM_FUNCTION_LEN_SETTING) { 0 => settings.maximum_function_len = None, len => settings.maximum_function_len = Some(len), } } if bn_settings.contains(Self::MINIMUM_MATCHED_CONSTRAINTS_SETTING) { settings.minimum_matched_constraints = - bn_settings.get_integer(Self::MINIMUM_MATCHED_CONSTRAINTS_SETTING, None, None) - as usize; + bn_settings.get_integer(Self::MINIMUM_MATCHED_CONSTRAINTS_SETTING) as usize; } settings } |
