forked from StrafesNET/map-tool
Scan::Flagged
This commit is contained in:
parent
7523c4313a
commit
593b6902fd
@ -82,6 +82,7 @@ fn download(map_list: Vec<u64>) -> Result<(), Box<dyn std::error::Error>>{
|
||||
enum Scan{
|
||||
Passed,
|
||||
Blocked,
|
||||
Flagged,
|
||||
}
|
||||
fn scan() -> Result<(), Box<dyn std::error::Error>>{
|
||||
let mut id = 0u32;
|
||||
@ -115,6 +116,12 @@ fn scan() -> Result<(), Box<dyn std::error::Error>>{
|
||||
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<dyn std::error::Error>>{
|
||||
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)?;
|
||||
|
Loading…
Reference in New Issue
Block a user