From 5071aa0783bb0872f1a69bf29b3f7d7377e7a303 Mon Sep 17 00:00:00 2001 From: Kazuminn Date: Sat, 3 Oct 2020 17:55:08 +0900 Subject: [PATCH] all test passed --- src/detections/utils.rs | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/detections/utils.rs b/src/detections/utils.rs index b96fc66b..0dad0544 100644 --- a/src/detections/utils.rs +++ b/src/detections/utils.rs @@ -136,7 +136,7 @@ fn check_obfu(string: &str) -> std::string::String { if binarypercent > maxbinary as usize { obfutext.push_str("Possible command obfuscation: "); - re = Regex::new(r"{0:P0}").unwrap(); + re = Regex::new(r"\{0:P0}").unwrap(); let binarypercent = &binarypercent.to_string(); if let Some(_caps) = re.captures(binarypercent) { if let Some(_data) = _caps.get(0) { @@ -201,14 +201,8 @@ mod tests { use crate::detections::utils; #[test] fn test_check_regex() { - let regextext = utils::check_regex( - "\\cvtres.exe", - 0, - ); - println!("{}", regextext); - assert!( - regextext == "Resource File To COFF Object Conversion Utility cvtres.exe\n" - ); + let regextext = utils::check_regex("\\cvtres.exe", 0); + assert!(regextext == "Resource File To COFF Object Conversion Utility cvtres.exe\n"); } #[test] @@ -222,7 +216,6 @@ mod tests { #[test] fn test_check_obfu() { let mut obfutext = utils::check_obfu("dir01"); - println!("{}", obfutext); } #[test]