Files
BinaryObjectScanner/BurnOutSharp/ProtectionType/Steam.cs

75 lines
5.1 KiB
C#
Raw Normal View History

using System.Collections.Concurrent;
using System.Collections.Generic;
using BurnOutSharp.Matching;
namespace BurnOutSharp.ProtectionType
{
2021-09-05 23:29:48 -07:00
// TODO: Investigate what content checks can be done here
2021-02-26 00:32:09 -08:00
public class Steam : IPathCheck
{
2021-02-26 00:32:09 -08:00
/// <inheritdoc/>
public ConcurrentQueue<string> CheckDirectoryPath(string path, IEnumerable<string> files)
{
var matchers = new List<PathMatchSet>
{
2022-02-04 15:19:24 -08:00
new PathMatchSet(new PathMatch("steam_api.dll", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("steam_api64.dll", useEndsWith: true), "Steam"),
2021-08-31 23:22:47 -06:00
new PathMatchSet(new PathMatch("SteamInstall.bom", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall.exe", useEndsWith: true), "Steam"),
2021-08-31 23:22:47 -06:00
new PathMatchSet(new PathMatch("SteamInstall.info", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall.ini", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall.msi", useEndsWith: true), "Steam"),
2021-08-31 23:22:47 -06:00
new PathMatchSet(new PathMatch("SteamInstall.pax.gz", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall.pkg", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall.sizes", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_Czech.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_English.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_French.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_German.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_Italian.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_Polish.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_Russian.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_Spanish.msi", useEndsWith: true), "Steam"),
2021-08-31 23:22:47 -06:00
new PathMatchSet(new PathMatch("SteamRetailInstaller", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamRetailInstaller.dmg", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamService.exe", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamSetup.exe", useEndsWith: true), "Steam"),
};
return MatchUtil.GetAllMatches(files, matchers, any: true);
2021-03-19 15:41:49 -07:00
}
/// <inheritdoc/>
public string CheckFilePath(string path)
{
var matchers = new List<PathMatchSet>
{
2022-02-04 15:19:24 -08:00
new PathMatchSet(new PathMatch("steam_api.dll", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("steam_api64.dll", useEndsWith: true), "Steam"),
2021-08-31 23:22:47 -06:00
new PathMatchSet(new PathMatch("SteamInstall.bom", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall.exe", useEndsWith: true), "Steam"),
2021-08-31 23:22:47 -06:00
new PathMatchSet(new PathMatch("SteamInstall.info", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall.ini", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall.msi", useEndsWith: true), "Steam"),
2021-08-31 23:22:47 -06:00
new PathMatchSet(new PathMatch("SteamInstall.pax.gz", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall.pkg", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall.sizes", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_Czech.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_English.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_French.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_German.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_Italian.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_Polish.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_Russian.msi", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamInstall_Spanish.msi", useEndsWith: true), "Steam"),
2021-08-31 23:22:47 -06:00
new PathMatchSet(new PathMatch("SteamRetailInstaller", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamRetailInstaller.dmg", useEndsWith: true), "Steam"),
new PathMatchSet(new PathMatch("SteamService.exe", useEndsWith: true), "Steam"),
2021-08-31 23:22:47 -06:00
new PathMatchSet(new PathMatch("SteamSetup.exe", useEndsWith: true), "Steam"),
};
return MatchUtil.GetFirstMatch(path, matchers, any: true);
}
}
}