summaryrefslogtreecommitdiff
path: root/plugins/warp/src/matcher.rs
diff options
context:
space:
mode:
authorMason Reed <mason@vector35.com>2025-10-07 14:14:45 -0400
committerMason Reed <mason@vector35.com>2025-10-07 14:14:45 -0400
commitaafb1e7a4ce244b3f0aa25ac201dfbeeff2110e8 (patch)
tree4be02337ba0193495b58ed1bb8246526dbb51521 /plugins/warp/src/matcher.rs
parent2153c833b67de7e032ff135cdb322bb4e49d2bd1 (diff)
[WARP] Move WARP settings to own setting group
This then allows us to group the settings into more understandable subgroups such as fetcher & matcher
Diffstat (limited to 'plugins/warp/src/matcher.rs')
-rw-r--r--plugins/warp/src/matcher.rs43
1 files changed, 30 insertions, 13 deletions
diff --git a/plugins/warp/src/matcher.rs b/plugins/warp/src/matcher.rs
index d97b4a18..48adee3a 100644
--- a/plugins/warp/src/matcher.rs
+++ b/plugins/warp/src/matcher.rs
@@ -316,21 +316,32 @@ pub struct MatcherSettings {
impl MatcherSettings {
pub const TRIVIAL_FUNCTION_LEN_DEFAULT: u64 = 20;
- pub const TRIVIAL_FUNCTION_LEN_SETTING: &'static str = "analysis.warp.trivialFunctionLength";
+ pub const TRIVIAL_FUNCTION_LEN_SETTING_ALIAS: [&'static str; 1] =
+ ["analysis.warp.trivialFunctionLength"];
+ pub const TRIVIAL_FUNCTION_LEN_SETTING: &'static str = "warp.matcher.trivialFunctionLength";
pub const MINIMUM_FUNCTION_LEN_DEFAULT: u64 = 0;
- pub const MINIMUM_FUNCTION_LEN_SETTING: &'static str = "analysis.warp.minimumFunctionLength";
+ pub const MINIMUM_FUNCTION_LEN_SETTING_ALIAS: [&'static str; 1] =
+ ["analysis.warp.minimumFunctionLength"];
+ pub const MINIMUM_FUNCTION_LEN_SETTING: &'static str = "warp.matcher.minimumFunctionLength";
pub const MAXIMUM_FUNCTION_LEN_DEFAULT: u64 = 0;
- pub const MAXIMUM_FUNCTION_LEN_SETTING: &'static str = "analysis.warp.maximumFunctionLength";
+ pub const MAXIMUM_FUNCTION_LEN_SETTING_ALIAS: [&'static str; 1] =
+ ["analysis.warp.maximumFunctionLength"];
+ pub const MAXIMUM_FUNCTION_LEN_SETTING: &'static str = "warp.matcher.maximumFunctionLength";
pub const MINIMUM_MATCHED_CONSTRAINTS_DEFAULT: usize = 1;
+ pub const MINIMUM_MATCHED_CONSTRAINTS_SETTING_ALIAS: [&'static str; 1] =
+ ["analysis.warp.minimumMatchedConstraints"];
pub const MINIMUM_MATCHED_CONSTRAINTS_SETTING: &'static str =
- "analysis.warp.minimumMatchedConstraints";
+ "warp.matcher.minimumMatchedConstraints";
pub const TRIVIAL_FUNCTION_ADJACENT_ALLOWED_DEFAULT: bool = false;
+ pub const TRIVIAL_FUNCTION_ADJACENT_ALLOWED_SETTING_ALIAS: [&'static str; 1] =
+ ["analysis.warp.trivialFunctionAdjacentAllowed"];
pub const TRIVIAL_FUNCTION_ADJACENT_ALLOWED_SETTING: &'static str =
- "analysis.warp.trivialFunctionAdjacentAllowed";
+ "warp.matcher.trivialFunctionAdjacentAllowed";
+ pub const MAXIMUM_POSSIBLE_FUNCTIONS_SETTING_ALIAS: [&'static str; 1] =
+ ["analysis.warp.maximumPossibleFunctions"];
pub const MAXIMUM_POSSIBLE_FUNCTIONS_SETTING: &'static str =
- "analysis.warp.maximumPossibleFunctions";
+ "warp.matcher.maximumPossibleFunctions";
pub const MAXIMUM_POSSIBLE_FUNCTIONS_DEFAULT: u64 = 1000;
-
/// Populates the [MatcherSettings] to the current Binary Ninja settings instance.
///
/// Call this once when you initialize so that the settings exist.
@@ -343,7 +354,8 @@ impl MatcherSettings {
"type" : "number",
"default" : Self::TRIVIAL_FUNCTION_LEN_DEFAULT,
"description" : "Functions below this length in bytes will be required to match on constraints.",
- "ignore" : []
+ "ignore" : [],
+ "aliases" : Self::TRIVIAL_FUNCTION_LEN_SETTING_ALIAS,
});
bn_settings.register_setting_json(
Self::TRIVIAL_FUNCTION_LEN_SETTING,
@@ -355,7 +367,8 @@ impl MatcherSettings {
"type" : "number",
"default" : Self::MINIMUM_FUNCTION_LEN_DEFAULT,
"description" : "Functions below this length will not be matched.",
- "ignore" : []
+ "ignore" : [],
+ "aliases" : Self::MINIMUM_FUNCTION_LEN_SETTING_ALIAS,
});
bn_settings.register_setting_json(
Self::MINIMUM_FUNCTION_LEN_SETTING,
@@ -367,7 +380,8 @@ impl MatcherSettings {
"type" : "number",
"default" : Self::MAXIMUM_FUNCTION_LEN_DEFAULT,
"description" : "Functions above this length will not be matched. A value of 0 will disable this check.",
- "ignore" : []
+ "ignore" : [],
+ "aliases" : Self::MAXIMUM_FUNCTION_LEN_SETTING_ALIAS,
});
bn_settings.register_setting_json(
Self::MAXIMUM_FUNCTION_LEN_SETTING,
@@ -379,7 +393,8 @@ impl MatcherSettings {
"type" : "number",
"default" : Self::MINIMUM_MATCHED_CONSTRAINTS_DEFAULT,
"description" : "When function constraints are checked the amount of constraints matched must be at-least this.",
- "ignore" : []
+ "ignore" : [],
+ "aliases" : Self::MINIMUM_MATCHED_CONSTRAINTS_SETTING_ALIAS,
});
bn_settings.register_setting_json(
Self::MINIMUM_MATCHED_CONSTRAINTS_SETTING,
@@ -391,7 +406,8 @@ impl MatcherSettings {
"type" : "boolean",
"default" : Self::TRIVIAL_FUNCTION_ADJACENT_ALLOWED_DEFAULT,
"description" : "When function constraints are checked if this is enabled functions can match based off trivial adjacent functions.",
- "ignore" : []
+ "ignore" : [],
+ "aliases" : Self::TRIVIAL_FUNCTION_ADJACENT_ALLOWED_SETTING_ALIAS,
});
bn_settings.register_setting_json(
Self::TRIVIAL_FUNCTION_ADJACENT_ALLOWED_SETTING,
@@ -403,7 +419,8 @@ impl MatcherSettings {
"type" : "number",
"default" : Self::MAXIMUM_POSSIBLE_FUNCTIONS_DEFAULT,
"description" : "When matching any function that has a list of possible functions greater than this number will be skipped. A value of 0 will disable this check.",
- "ignore" : []
+ "ignore" : [],
+ "aliases" : Self::MAXIMUM_POSSIBLE_FUNCTIONS_SETTING_ALIAS,
});
bn_settings.register_setting_json(
Self::MAXIMUM_POSSIBLE_FUNCTIONS_SETTING,