diff --git a/src/main.rs b/src/main.rs index d5395aa..fba58ea 100644 --- a/src/main.rs +++ b/src/main.rs @@ -82,6 +82,7 @@ fn download(map_list: Vec) -> Result<(), Box>{ enum Scan{ Passed, Blocked, + Flagged, } fn scan() -> Result<(), Box>{ let mut id = 0u32; @@ -115,6 +116,12 @@ fn scan() -> Result<(), Box>{ let mut fail_type=Scan::Passed; for script in scripts.iter() { if let Some(rbx_dom_weak::types::Variant::String(s)) = script.properties.get("Source") { + //flag keywords and instantly fail + if s.find("getfenv").is_some()||s.find("require").is_some(){ + println!("{:?} - flagged.",file_thing.file_name()); + fail_type=Scan::Flagged; + break; + } if allowed_set.contains(s) { continue; }else{ @@ -136,6 +143,7 @@ fn scan() -> Result<(), Box>{ println!("{:?} - {} {} not allowed.",file_thing.file_name(),fail_count,if fail_count==1 {"script"}else{"scripts"}); std::path::PathBuf::from("maps/purgatory") } + Scan::Flagged => std::path::PathBuf::from("maps/flagged") }; dest.push(file_thing.file_name()); std::fs::rename(file_thing.path(), dest)?;