diff --git a/BurnOutSharp/ProtectionType/AACS.cs b/BurnOutSharp/ProtectionType/AACS.cs index 37fe4eff..5a265428 100644 --- a/BurnOutSharp/ProtectionType/AACS.cs +++ b/BurnOutSharp/ProtectionType/AACS.cs @@ -12,10 +12,10 @@ namespace BurnOutSharp.ProtectionType var matchers = new List { // BD-ROM - new PathMatchSet(Path.Combine("AACS", "MKB_RO.inf"), GetVersion, "AACS"), + new PathMatchSet(Path.Combine("AACS", "MKB_RO.inf").Replace("\\", "/"), GetVersion, "AACS"), // HD-DVD - new PathMatchSet(Path.Combine("AACS", "MKBROM.AACS"), GetVersion, "AACS"), + new PathMatchSet(Path.Combine("AACS", "MKBROM.AACS").Replace("\\", "/"), GetVersion, "AACS"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); diff --git a/BurnOutSharp/ProtectionType/BDPlus.cs b/BurnOutSharp/ProtectionType/BDPlus.cs index 9562c36f..e69ce8d5 100644 --- a/BurnOutSharp/ProtectionType/BDPlus.cs +++ b/BurnOutSharp/ProtectionType/BDPlus.cs @@ -15,8 +15,8 @@ namespace BurnOutSharp.ProtectionType { new PathMatchSet(new List { - Path.Combine("BDSVM", "00000.svm"), - Path.Combine("BDSVM", "BACKUP", "00000.svm"), + Path.Combine("BDSVM", "00000.svm").Replace("\\", "/"), + Path.Combine("BDSVM", "BACKUP", "00000.svm").Replace("\\", "/"), }, GetVersion, "BD+"), }; diff --git a/BurnOutSharp/ProtectionType/DVDMoviePROTECT.cs b/BurnOutSharp/ProtectionType/DVDMoviePROTECT.cs index 0d0459ff..554fca9a 100644 --- a/BurnOutSharp/ProtectionType/DVDMoviePROTECT.cs +++ b/BurnOutSharp/ProtectionType/DVDMoviePROTECT.cs @@ -16,7 +16,7 @@ namespace BurnOutSharp.ProtectionType for (int i = 0; i < bupfiles.Length; i++) { FileInfo bupfile = new FileInfo(bupfiles[i]); - FileInfo ifofile = new FileInfo(bupfile.DirectoryName + "\\" + bupfile.Name.Substring(0, bupfile.Name.Length - bupfile.Extension.Length) + ".ifo"); + FileInfo ifofile = new FileInfo(Path.Combine(bupfile.DirectoryName, bupfile.Name.Substring(0, bupfile.Name.Length - bupfile.Extension.Length) + ".ifo")); if (bupfile.Length != ifofile.Length) return new List() { "DVD-Movie-PROTECT" }; } diff --git a/BurnOutSharp/ProtectionType/StarForce.cs b/BurnOutSharp/ProtectionType/StarForce.cs index 97f9a34e..9de633f4 100644 --- a/BurnOutSharp/ProtectionType/StarForce.cs +++ b/BurnOutSharp/ProtectionType/StarForce.cs @@ -139,8 +139,6 @@ namespace BurnOutSharp.ProtectionType // TODO: Re-consolidate these once path matching is improved new PathMatchSet(new PathMatch("/protect.dll", useEndsWith: true), "StarForce"), new PathMatchSet(new PathMatch("/protect.exe", useEndsWith: true), "StarForce"), - new PathMatchSet(new PathMatch("\\protect.dll", useEndsWith: true), "StarForce"), - new PathMatchSet(new PathMatch("\\protect.exe", useEndsWith: true), "StarForce"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); diff --git a/BurnOutSharp/ProtectionType/TivolaRingProtection.cs b/BurnOutSharp/ProtectionType/TivolaRingProtection.cs index 82af6f18..d6c352b9 100644 --- a/BurnOutSharp/ProtectionType/TivolaRingProtection.cs +++ b/BurnOutSharp/ProtectionType/TivolaRingProtection.cs @@ -14,7 +14,7 @@ namespace BurnOutSharp.ProtectionType { var matchers = new List { - new PathMatchSet(Path.Combine("ZDAT", "webmast.dxx"), "Tivola Ring Protection [Check disc for physical ring]"), + new PathMatchSet(Path.Combine("ZDAT", "webmast.dxx").Replace("\\", "/"), "Tivola Ring Protection [Check disc for physical ring]"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); @@ -25,7 +25,7 @@ namespace BurnOutSharp.ProtectionType { var matchers = new List { - new PathMatchSet(Path.Combine("ZDAT", "webmast.dxx"), "Tivola Ring Protection [Check disc for physical ring]"), + new PathMatchSet(Path.Combine("ZDAT", "webmast.dxx").Replace("\\", "/"), "Tivola Ring Protection [Check disc for physical ring]"), }; return MatchUtil.GetFirstMatch(path, matchers, any: true); diff --git a/BurnOutSharp/ProtectionType/Zzxzz.cs b/BurnOutSharp/ProtectionType/Zzxzz.cs index 40374af0..d85cb32b 100644 --- a/BurnOutSharp/ProtectionType/Zzxzz.cs +++ b/BurnOutSharp/ProtectionType/Zzxzz.cs @@ -1,4 +1,4 @@ -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using BurnOutSharp.Matching; @@ -11,8 +11,8 @@ namespace BurnOutSharp.ProtectionType { var matchers = new List { - new PathMatchSet(Path.Combine(path, "Zzxzz", "Zzz.aze"), "Zzxzz"), - new PathMatchSet($"Zzxzz{Path.DirectorySeparatorChar}", "Zzxzz"), + new PathMatchSet(Path.Combine(path, "Zzxzz", "Zzz.aze").Replace("\\", "/"), "Zzxzz"), + new PathMatchSet($"Zzxzz/", "Zzxzz"), }; return MatchUtil.GetAllMatches(files, matchers, any: true); diff --git a/BurnOutSharp/Scanner.cs b/BurnOutSharp/Scanner.cs index 7f6316dc..bf77fff8 100644 --- a/BurnOutSharp/Scanner.cs +++ b/BurnOutSharp/Scanner.cs @@ -187,6 +187,9 @@ namespace BurnOutSharp // Create an empty list for protections List protections = new List(); + // Preprocess the list of files + files = files.Select(f => f.Replace('\\', '/')).ToList(); + // Iterate through all path checks foreach (var pathCheckClass in pathCheckClasses) { @@ -215,7 +218,7 @@ namespace BurnOutSharp // Iterate through all path checks foreach (var pathCheckClass in pathCheckClasses) { - string protection = pathCheckClass.CheckFilePath(path); + string protection = pathCheckClass.CheckFilePath(path.Replace("\\", "/")); if (!string.IsNullOrWhiteSpace(protection)) protections.Add(protection); }