mirror of
https://github.com/iv-org/inv_sig_helper.git
synced 2025-01-16 00:22:19 +01:00
Fix REGEX_HELPER_OBJ_NAME round 2
This commit is contained in:
parent
23932bfa05
commit
3b0c081209
2 changed files with 4 additions and 5 deletions
|
@ -34,7 +34,7 @@ pub static REGEX_SIGNATURE_FUNCTION: Lazy<Regex> = Lazy::new(|| {
|
||||||
r#")"#
|
r#")"#
|
||||||
)).unwrap()
|
)).unwrap()
|
||||||
});
|
});
|
||||||
pub static REGEX_HELPER_OBJ_NAME: &Lazy<Regex> = regex!(r"([A-Za-z0-9_\$]{1,})=function\(");
|
pub static REGEX_HELPER_OBJ_NAME: &Lazy<Regex> = regex!(r"function\(([a-zA-Z_$][a-zA-Z0-9_$]*)\)|([a-zA-Z_$][a-zA-Z0-9_$]*)\.[A-Za-z_$]");
|
||||||
|
|
||||||
pub static NSIG_FUNCTION_NAME: &str = "decrypt_nsig";
|
pub static NSIG_FUNCTION_NAME: &str = "decrypt_nsig";
|
||||||
pub static SIG_FUNCTION_NAME: &str = "decrypt_sig";
|
pub static SIG_FUNCTION_NAME: &str = "decrypt_sig";
|
||||||
|
|
|
@ -182,10 +182,9 @@ pub async fn fetch_update(state: Arc<GlobalState>) -> Result<(), FetchUpdateStat
|
||||||
// Get the helper object
|
// Get the helper object
|
||||||
let helper_object_name = REGEX_HELPER_OBJ_NAME
|
let helper_object_name = REGEX_HELPER_OBJ_NAME
|
||||||
.captures(sig_function_body)
|
.captures(sig_function_body)
|
||||||
.unwrap()
|
.and_then(|cap| cap.get(1).or_else(|| cap.get(2)))
|
||||||
.get(1)
|
.map(|m| m.as_str())
|
||||||
.unwrap()
|
.unwrap_or_default();
|
||||||
.as_str();
|
|
||||||
|
|
||||||
let mut helper_object_body_regex_str = String::new();
|
let mut helper_object_body_regex_str = String::new();
|
||||||
helper_object_body_regex_str += "(var ";
|
helper_object_body_regex_str += "(var ";
|
||||||
|
|
Loading…
Reference in a new issue