mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-31 21:19:22 +00:00
Reflection
This change eliminates the need to explicitly list out every single protection in the same way now that we have interfaces that we can rely on.
This commit is contained in:
@@ -21,18 +21,21 @@ namespace BurnOutSharp.ProtectionType
|
||||
/// <inheritdoc/>
|
||||
public string CheckPath(string path, bool isDirectory, IEnumerable<string> files)
|
||||
{
|
||||
if (isDirectory)
|
||||
{
|
||||
if (files.Any(f => Path.GetFileName(f).Equals("Autorun.dat", StringComparison.OrdinalIgnoreCase)))
|
||||
return "CopyKiller";
|
||||
}
|
||||
else
|
||||
{
|
||||
if (Path.GetFileName(path).Equals("Autorun.dat", StringComparison.OrdinalIgnoreCase))
|
||||
return "CopyKiller";
|
||||
}
|
||||
|
||||
return null;
|
||||
|
||||
// TODO: The following checks are overly broad and should be refined
|
||||
//if (isDirectory)
|
||||
//{
|
||||
// if (files.Any(f => Path.GetFileName(f).Equals("Autorun.dat", StringComparison.OrdinalIgnoreCase)))
|
||||
// return "CopyKiller";
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// if (Path.GetFileName(path).Equals("Autorun.dat", StringComparison.OrdinalIgnoreCase))
|
||||
// return "CopyKiller";
|
||||
//}
|
||||
|
||||
//return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user