mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-02-17 05:45:14 +00:00
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using System.Linq;
|
|
|
|
namespace BurnOutSharp.ProtectionType
|
|
{
|
|
public class GFWL : IContentCheck, IPathCheck
|
|
{
|
|
/// <inheritdoc/>
|
|
public string CheckContents(string file, byte[] fileContent, bool includePosition = false)
|
|
{
|
|
var mappings = new Dictionary<byte?[], string>
|
|
{
|
|
// xlive.dll
|
|
[new byte?[] { 0x78, 0x6C, 0x69, 0x76, 0x65, 0x2E, 0x64, 0x6C, 0x6C }] = "Games for Windows - Live",
|
|
};
|
|
|
|
return Utilities.GetContentMatches(fileContent, mappings, includePosition);
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public string CheckDirectoryPath(string path, IEnumerable<string> files)
|
|
{
|
|
if (files.Any(f => Path.GetFileName(f).Equals("XLiveRedist.msi", StringComparison.OrdinalIgnoreCase)))
|
|
return "Games for Windows - Live";
|
|
|
|
return null;
|
|
}
|
|
|
|
/// <inheritdoc/>
|
|
public string CheckFilePath(string path)
|
|
{
|
|
if (Path.GetFileName(path).Equals("XLiveRedist.msi", StringComparison.OrdinalIgnoreCase))
|
|
return "Games for Windows - Live";
|
|
|
|
return null;
|
|
}
|
|
}
|
|
}
|