diff --git a/BurnOutSharp/BurnOutSharp.nuspec b/BurnOutSharp/BurnOutSharp.nuspec index ad76f496..7dbfe2cc 100644 --- a/BurnOutSharp/BurnOutSharp.nuspec +++ b/BurnOutSharp/BurnOutSharp.nuspec @@ -2,7 +2,7 @@ BurnOutSharp - 1.03.8.1 + 1.03.8.2 BurnOutSharp Matt Nadareski, Gernot Knippen Matt Nadareski, Gernot Knippen diff --git a/BurnOutSharp/EVORE.cs b/BurnOutSharp/EVORE.cs index 44515653..48e63462 100644 --- a/BurnOutSharp/EVORE.cs +++ b/BurnOutSharp/EVORE.cs @@ -37,7 +37,7 @@ private struct Section private static Process StartSafe(string file) { - if (file == null) + if (file == null || !File.Exists(file)) return null; Process startingprocess = new Process(); @@ -59,7 +59,7 @@ private static Process StartSafe(string file) private static string MakeTempFile(string file, string sExtension = ".exe") { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; FileInfo filei = new FileInfo(file); @@ -75,7 +75,7 @@ private static string MakeTempFile(string file, string sExtension = ".exe") private static bool IsEXE(string file) { - if (file == null) + if (file == null || !File.Exists(file)) return false; BinaryReader breader = new BinaryReader(File.OpenRead(file)); @@ -199,7 +199,7 @@ private static uint RVA2Offset(uint RVA, Section[] sections) public static string SearchProtectDiscVersion(string file) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; Process exe = new Process(); @@ -357,7 +357,7 @@ public static string SearchProtectDiscVersion(string file) public static string SearchSafeDiscVersion(string file) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; Process exe = new Process(); diff --git a/BurnOutSharp/ProtectionType/CDCops.cs b/BurnOutSharp/ProtectionType/CDCops.cs index 4d169ebd..464935ea 100644 --- a/BurnOutSharp/ProtectionType/CDCops.cs +++ b/BurnOutSharp/ProtectionType/CDCops.cs @@ -49,7 +49,7 @@ public static string CheckPath(string path, IEnumerable files, bool isDi private static string GetVersion(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/ProtectionType/DVDCops.cs b/BurnOutSharp/ProtectionType/DVDCops.cs index 8c598d9a..ed80c3fc 100644 --- a/BurnOutSharp/ProtectionType/DVDCops.cs +++ b/BurnOutSharp/ProtectionType/DVDCops.cs @@ -15,7 +15,7 @@ public static string CheckContents(string file, string fileContent) private static string GetVersion(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/ProtectionType/InnoSetup.cs b/BurnOutSharp/ProtectionType/InnoSetup.cs index fcff8855..bda474e5 100644 --- a/BurnOutSharp/ProtectionType/InnoSetup.cs +++ b/BurnOutSharp/ProtectionType/InnoSetup.cs @@ -17,7 +17,7 @@ public static string CheckContents(string file, string fileContent) private static string GetVersion(string file) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/ProtectionType/JoWooDXProt.cs b/BurnOutSharp/ProtectionType/JoWooDXProt.cs index 68ece9ce..ac1c4a26 100644 --- a/BurnOutSharp/ProtectionType/JoWooDXProt.cs +++ b/BurnOutSharp/ProtectionType/JoWooDXProt.cs @@ -27,7 +27,7 @@ public static string CheckContents(string file, string fileContent) private static string GetVersion(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/ProtectionType/ProtectDisc.cs b/BurnOutSharp/ProtectionType/ProtectDisc.cs index e27528c1..552363fd 100644 --- a/BurnOutSharp/ProtectionType/ProtectDisc.cs +++ b/BurnOutSharp/ProtectionType/ProtectDisc.cs @@ -41,7 +41,7 @@ public static string CheckContents(string file, string fileContent) private static string GetVersionBuild6till8(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) @@ -93,7 +93,7 @@ private static string GetVersionBuild6till8(string file, int position) private static string GetVersionBuild76till10(string file, int position, out int irefBuild) { irefBuild = 0; - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/ProtectionType/SafeDisc.cs b/BurnOutSharp/ProtectionType/SafeDisc.cs index 674d385a..ad1c63a5 100644 --- a/BurnOutSharp/ProtectionType/SafeDisc.cs +++ b/BurnOutSharp/ProtectionType/SafeDisc.cs @@ -39,15 +39,22 @@ public static string CheckPath(string path, IEnumerable files, bool isDi // TODO: These are all cop-outs that don't check the existence of the other files if (files.Count(f => Path.GetFileName(f).Equals("DPLAYERX.DLL", StringComparison.OrdinalIgnoreCase)) > 0) { - return GetDPlayerXVersion(path); + string file = files.First(f => Path.GetFileName(f).Equals("DPLAYERX.DLL", StringComparison.OrdinalIgnoreCase)); + return GetDPlayerXVersion(file); } else if (files.Count(f => Path.GetFileName(f).Equals("drvmgt.dll", StringComparison.OrdinalIgnoreCase)) > 0) { - return GetDrvmgtVersion(path); + string file = files.First(f => Path.GetFileName(f).Equals("drvmgt.dll", StringComparison.OrdinalIgnoreCase)); + return GetDrvmgtVersion(file); } else if (files.Count(f => Path.GetFileName(f).Equals("secdrv.sys", StringComparison.OrdinalIgnoreCase)) > 0) { - return GetSecdrvVersion(path); + string file = files.First(f => Path.GetFileName(f).Equals("secdrv.sys", StringComparison.OrdinalIgnoreCase)); + return GetSecdrvVersion(file); + } + else if (path.EndsWith(".SafeDiscDVD.bundle", StringComparison.OrdinalIgnoreCase)) + { + return "SafeDisc for Macintosh"; } } else @@ -97,7 +104,7 @@ public static string CheckPath(string path, IEnumerable files, bool isDi private static string GetDPlayerXVersion(string file) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; FileInfo fi = new FileInfo(file); @@ -125,7 +132,7 @@ private static string GetDPlayerXVersion(string file) private static string GetDrvmgtVersion(string file) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; FileInfo fi = new FileInfo(file); @@ -153,7 +160,7 @@ private static string GetDrvmgtVersion(string file) private static string GetSecdrvVersion(string file) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; FileInfo fi = new FileInfo(file); @@ -187,7 +194,7 @@ private static string GetSecdrvVersion(string file) private static string GetVersion(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/ProtectionType/SecuROM.cs b/BurnOutSharp/ProtectionType/SecuROM.cs index f2cc994b..ec7dc6b1 100644 --- a/BurnOutSharp/ProtectionType/SecuROM.cs +++ b/BurnOutSharp/ProtectionType/SecuROM.cs @@ -80,7 +80,7 @@ public static string CheckPath(string path, IEnumerable files, bool isDi private static string GetV4Version(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) @@ -106,7 +106,7 @@ private static string GetV4Version(string file, int position) private static string GetV5Version(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) @@ -135,7 +135,7 @@ private static string GetV5Version(string file, int position) private static string GetV7Version(string file) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/ProtectionType/SolidShield.cs b/BurnOutSharp/ProtectionType/SolidShield.cs index 3548b90c..b7a43f9a 100644 --- a/BurnOutSharp/ProtectionType/SolidShield.cs +++ b/BurnOutSharp/ProtectionType/SolidShield.cs @@ -131,7 +131,7 @@ public static string CheckPath(string path, IEnumerable files, bool isDi private static string GetVersion(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/ProtectionType/Sysiphus.cs b/BurnOutSharp/ProtectionType/Sysiphus.cs index 370c91d9..f7ba6b0a 100644 --- a/BurnOutSharp/ProtectionType/Sysiphus.cs +++ b/BurnOutSharp/ProtectionType/Sysiphus.cs @@ -18,7 +18,7 @@ public static string CheckContents(string file, string fileContent) private static string GetVersion(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/ProtectionType/Tages.cs b/BurnOutSharp/ProtectionType/Tages.cs index e708630d..2cbeea09 100644 --- a/BurnOutSharp/ProtectionType/Tages.cs +++ b/BurnOutSharp/ProtectionType/Tages.cs @@ -80,7 +80,7 @@ public static string CheckPath(string path, IEnumerable files, bool isDi private static string GetVersion(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/ProtectionType/VOBProtectCDDVD.cs b/BurnOutSharp/ProtectionType/VOBProtectCDDVD.cs index f4fd2e4c..0f632fa1 100644 --- a/BurnOutSharp/ProtectionType/VOBProtectCDDVD.cs +++ b/BurnOutSharp/ProtectionType/VOBProtectCDDVD.cs @@ -58,7 +58,7 @@ public static string CheckPath(string path, IEnumerable files, bool isDi private static string GetBuild(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) @@ -76,7 +76,7 @@ private static string GetBuild(string file, int position) private static string GetOldVersion(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) @@ -98,7 +98,7 @@ private static string GetOldVersion(string file, int position) private static string GetVersion(string file, int position) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; using (var fs = File.Open(file, FileMode.Open, FileAccess.Read, FileShare.ReadWrite)) diff --git a/BurnOutSharp/Utilities.cs b/BurnOutSharp/Utilities.cs index 341ed0ba..e4e55fcb 100644 --- a/BurnOutSharp/Utilities.cs +++ b/BurnOutSharp/Utilities.cs @@ -14,7 +14,7 @@ public static class Utilities /// public static string GetFileVersion(string file) { - if (file == null) + if (file == null || !File.Exists(file)) return string.Empty; FileVersionInfo fvinfo = FileVersionInfo.GetVersionInfo(file);