fix: adjust deobf helper object name regex
This commit is contained in:
parent
d8e3841fb6
commit
57628d1392
2 changed files with 2 additions and 6 deletions
|
|
@ -1564,12 +1564,8 @@ mod tests {
|
|||
let rp = RustyPipe::new();
|
||||
let visitor_data = tokio_test::block_on(rp.get_visitor_data()).unwrap();
|
||||
|
||||
// First part of visitor data must be 22 characters
|
||||
// Example: CgthVjBVUDJrd2Q3dyi3te-mBg%3D%3D
|
||||
assert!(
|
||||
visitor_data.starts_with("Cg")
|
||||
&& visitor_data.len() > 23
|
||||
&& &visitor_data[22..23] == "-",
|
||||
visitor_data.starts_with("Cg") && visitor_data.len() > 23,
|
||||
"invalid visitor data: {visitor_data}"
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -152,7 +152,7 @@ fn get_sig_fn(player_js: &str) -> Result<String, DeobfError> {
|
|||
+ ";";
|
||||
|
||||
static HELPER_OBJECT_NAME_REGEX: Lazy<Regex> =
|
||||
Lazy::new(|| Regex::new(r#";([A-Za-z0-9_\$]{2})\...\("#).unwrap());
|
||||
Lazy::new(|| Regex::new(r#";([A-Za-z0-9_\$]{2,3})\...\("#).unwrap());
|
||||
let helper_object_name = HELPER_OBJECT_NAME_REGEX
|
||||
.captures(&deobfuscate_function)
|
||||
.ok_or(DeobfError::Extraction("helper object name"))?
|
||||
|
|
|
|||
Reference in a new issue