2021-07-18 09:44:23 -07:00
|
|
|
|
using System.Collections.Concurrent;
|
|
|
|
|
|
using System.Collections.Generic;
|
2021-07-17 21:17:45 -07:00
|
|
|
|
using System.IO;
|
2023-03-09 11:52:28 -05:00
|
|
|
|
using BinaryObjectScanner.Interfaces;
|
2023-03-07 16:59:14 -05:00
|
|
|
|
using BinaryObjectScanner.Matching;
|
2021-07-17 21:17:45 -07:00
|
|
|
|
|
2023-03-09 23:19:27 -05:00
|
|
|
|
namespace BinaryObjectScanner.Protection
|
2021-07-17 21:17:45 -07:00
|
|
|
|
{
|
|
|
|
|
|
/// <remarks>
|
|
|
|
|
|
/// This protection needs far more research
|
|
|
|
|
|
/// </remarks>
|
|
|
|
|
|
public class TivolaRingProtection : IPathCheck
|
|
|
|
|
|
{
|
|
|
|
|
|
/// <inheritdoc/>
|
2021-07-18 09:44:23 -07:00
|
|
|
|
public ConcurrentQueue<string> CheckDirectoryPath(string path, IEnumerable<string> files)
|
2021-07-17 21:17:45 -07:00
|
|
|
|
{
|
|
|
|
|
|
var matchers = new List<PathMatchSet>
|
|
|
|
|
|
{
|
2021-07-17 22:31:29 -07:00
|
|
|
|
new PathMatchSet(Path.Combine("ZDAT", "webmast.dxx").Replace("\\", "/"), "Tivola Ring Protection [Check disc for physical ring]"),
|
2021-07-17 21:17:45 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return MatchUtil.GetAllMatches(files, matchers, any: true);
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
|
|
public string CheckFilePath(string path)
|
|
|
|
|
|
{
|
|
|
|
|
|
var matchers = new List<PathMatchSet>
|
|
|
|
|
|
{
|
2021-07-17 22:31:29 -07:00
|
|
|
|
new PathMatchSet(Path.Combine("ZDAT", "webmast.dxx").Replace("\\", "/"), "Tivola Ring Protection [Check disc for physical ring]"),
|
2021-07-17 21:17:45 -07:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
return MatchUtil.GetFirstMatch(path, matchers, any: true);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|