Files
BinaryObjectScanner/BurnOutSharp/ProtectionType/DiscGuard.cs

40 lines
1.3 KiB
C#
Raw Normal View History

using System.Collections.Concurrent;
using System.Collections.Generic;
2022-05-01 17:41:50 -07:00
using BurnOutSharp.Interfaces;
2021-03-22 23:02:01 -07:00
using BurnOutSharp.Matching;
namespace BurnOutSharp.ProtectionType
{
2021-02-26 00:32:09 -08:00
public class DiscGuard : IPathCheck
{
2021-02-26 00:32:09 -08:00
/// <inheritdoc/>
public ConcurrentQueue<string> CheckDirectoryPath(string path, IEnumerable<string> files)
{
2021-03-22 23:02:01 -07:00
var matchers = new List<PathMatchSet>
{
2021-03-22 23:02:01 -07:00
new PathMatchSet(new List<PathMatch>
{
new PathMatch("IOSLINK.VXD", useEndsWith: true),
new PathMatch("IOSLINK.DLL", useEndsWith: true),
new PathMatch("IOSLINK.SYS", useEndsWith: true),
}, "DiscGuard"),
};
2021-03-19 15:41:49 -07:00
return MatchUtil.GetAllMatches(files, matchers, any: false);
2021-03-19 15:41:49 -07:00
}
/// <inheritdoc/>
public string CheckFilePath(string path)
{
2021-03-22 23:02:01 -07:00
var matchers = new List<PathMatchSet>
{
2021-03-22 23:02:01 -07:00
new PathMatchSet(new PathMatch("IOSLINK.VXD", useEndsWith: true), "DiscGuard"),
new PathMatchSet(new PathMatch("IOSLINK.DLL", useEndsWith: true), "DiscGuard"),
new PathMatchSet(new PathMatch("IOSLINK.SYS", useEndsWith: true), "DiscGuard"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
}
}
}