diff --git a/BurnOutSharp/PackerType/CExe.cs b/BurnOutSharp/PackerType/CExe.cs index 60c8d07d..20e156d2 100644 --- a/BurnOutSharp/PackerType/CExe.cs +++ b/BurnOutSharp/PackerType/CExe.cs @@ -20,8 +20,8 @@ namespace BurnOutSharp.PackerType public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible - var stubMagic = pex?.Stub_Magic; - if (stubMagic == null) + var sections = pex?.SectionTable; + if (sections == null) return null; var matchers = new List diff --git a/BurnOutSharp/PackerType/InnoSetup.cs b/BurnOutSharp/PackerType/InnoSetup.cs index 284791f3..b2bb50f3 100644 --- a/BurnOutSharp/PackerType/InnoSetup.cs +++ b/BurnOutSharp/PackerType/InnoSetup.cs @@ -44,7 +44,7 @@ namespace BurnOutSharp.PackerType var sections = pex?.SectionTable; if (sections == null) return null; - + // Get the .data/DATA section, if it exists var dataSectionRaw = pex.GetFirstSectionData(".data") ?? pex.GetFirstSectionData("DATA"); if (dataSectionRaw != null) diff --git a/BurnOutSharp/PackerType/IntelInstallationFramework.cs b/BurnOutSharp/PackerType/IntelInstallationFramework.cs index 3ba8c02b..a36674a4 100644 --- a/BurnOutSharp/PackerType/IntelInstallationFramework.cs +++ b/BurnOutSharp/PackerType/IntelInstallationFramework.cs @@ -22,17 +22,15 @@ namespace BurnOutSharp.PackerType return null; string name = pex.FileDescription; - if (!string.IsNullOrWhiteSpace(name) - && (name.Equals("Intel(R) Installation Framework", StringComparison.OrdinalIgnoreCase) - || name.Equals("Intel Installation Framework", StringComparison.OrdinalIgnoreCase))) + if (name?.Equals("Intel(R) Installation Framework", StringComparison.OrdinalIgnoreCase) == true + || name?.Equals("Intel Installation Framework", StringComparison.OrdinalIgnoreCase) == true) { return $"Intel Installation Framework {Utilities.GetInternalVersion(pex)}"; } name = pex.ProductName; - if (!string.IsNullOrWhiteSpace(name) - && (name.Equals("Intel(R) Installation Framework", StringComparison.OrdinalIgnoreCase) - || name.Equals("Intel Installation Framework", StringComparison.OrdinalIgnoreCase))) + if (name.Equals("Intel(R) Installation Framework", StringComparison.OrdinalIgnoreCase) == true + || name.Equals("Intel Installation Framework", StringComparison.OrdinalIgnoreCase) == true) { return $"Intel Installation Framework {Utilities.GetInternalVersion(pex)}"; } diff --git a/BurnOutSharp/PackerType/Petite.cs b/BurnOutSharp/PackerType/Petite.cs index 6fe5128f..9f56d994 100644 --- a/BurnOutSharp/PackerType/Petite.cs +++ b/BurnOutSharp/PackerType/Petite.cs @@ -21,8 +21,8 @@ namespace BurnOutSharp.PackerType return null; // Get the .petite section, if it exists -- TODO: Is there a version number that can be found? - bool nicodeSection = pex.ContainsSection(".petite", exact: true); - if (nicodeSection) + bool petiteSection = pex.ContainsSection(".petite", exact: true); + if (petiteSection) return "PEtite"; return null; diff --git a/BurnOutSharp/ProtectionType/HexaLock.cs b/BurnOutSharp/ProtectionType/HexaLock.cs index 74bac6d0..73ac9bd8 100644 --- a/BurnOutSharp/ProtectionType/HexaLock.cs +++ b/BurnOutSharp/ProtectionType/HexaLock.cs @@ -57,8 +57,8 @@ namespace BurnOutSharp.ProtectionType return null; } - /// - public ConcurrentQueue CheckDirectoryPath(string path, IEnumerable files) + /// + public ConcurrentQueue CheckDirectoryPath(string path, IEnumerable files) { var matchers = new List { diff --git a/BurnOutSharp/ProtectionType/LabelGate.cs b/BurnOutSharp/ProtectionType/LabelGate.cs index 8aed7eb5..f38d6367 100644 --- a/BurnOutSharp/ProtectionType/LabelGate.cs +++ b/BurnOutSharp/ProtectionType/LabelGate.cs @@ -18,6 +18,7 @@ namespace BurnOutSharp.ProtectionType /// public class LabelGate : IPathCheck, IPortableExecutableCheck { + /// public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible diff --git a/BurnOutSharp/ProtectionType/OpenMG.cs b/BurnOutSharp/ProtectionType/OpenMG.cs index 09a9bc8e..76cbed2a 100644 --- a/BurnOutSharp/ProtectionType/OpenMG.cs +++ b/BurnOutSharp/ProtectionType/OpenMG.cs @@ -16,6 +16,7 @@ namespace BurnOutSharp.ProtectionType /// public class OpenMG : IPathCheck, IPortableExecutableCheck { + /// public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible diff --git a/BurnOutSharp/ProtectionType/PlayJ.cs b/BurnOutSharp/ProtectionType/PlayJ.cs index 5d9f15fe..29bd3f7f 100644 --- a/BurnOutSharp/ProtectionType/PlayJ.cs +++ b/BurnOutSharp/ProtectionType/PlayJ.cs @@ -29,6 +29,7 @@ namespace BurnOutSharp.ProtectionType /// public class PlayJ : IPathCheck, IPortableExecutableCheck { + /// public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible @@ -38,15 +39,17 @@ namespace BurnOutSharp.ProtectionType // Found in "PlayJ.exe" (https://web.archive.org/web/20010417025347/http://dlp.playj.com:80/playj/PlayJIns266.exe) and "CACTUSPJ.exe" ("Volumia!" by Puur (Barcode 7 43218 63282 2) (Discogs Release Code [r795427])). string name = pex.FileDescription; - if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("PlayJ Music Player", StringComparison.OrdinalIgnoreCase)) + if (name?.StartsWith("PlayJ Music Player", StringComparison.OrdinalIgnoreCase) == true) return $"PlayJ Music Player"; + // Found in "PJSTREAM.DLL" ("Volumia!" by Puur (Barcode 7 43218 63282 2) (Discogs Release Code [r795427])). name = pex.FileDescription; - if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("EVAUX32 Module", StringComparison.OrdinalIgnoreCase)) + if (name.StartsWith("EVAUX32 Module", StringComparison.OrdinalIgnoreCase) == true) return $"PlayJ Music Player Component"; + // Found in "PlayJ.exe" (https://web.archive.org/web/20010417025347/http://dlp.playj.com:80/playj/PlayJIns266.exe) and "CACTUSPJ.exe" ("Volumia!" by Puur (Barcode 7 43218 63282 2) (Discogs Release Code [r795427])). name = pex.ProductName; - if (!string.IsNullOrWhiteSpace(name) && name.StartsWith("PlayJ", StringComparison.OrdinalIgnoreCase)) + if (name?.StartsWith("PlayJ", StringComparison.OrdinalIgnoreCase) == true) return $"PlayJ"; return null; diff --git a/BurnOutSharp/ProtectionType/SVKP.cs b/BurnOutSharp/ProtectionType/SVKP.cs index 8992ec8a..ef6670dc 100644 --- a/BurnOutSharp/ProtectionType/SVKP.cs +++ b/BurnOutSharp/ProtectionType/SVKP.cs @@ -13,10 +13,11 @@ namespace BurnOutSharp.ProtectionType /// public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { - // Get the image file header from the executable, if possible - if (pex == null) + // Get the sections from the executable, if possible + var sections = pex?.SectionTable; + if (sections == null) return null; - + // 0x504B5653 is "SVKP" if (pex.PointerToSymbolTable == 0x504B5653) return "SVKP (Slovak Protector)"; diff --git a/BurnOutSharp/ProtectionType/WMDS.cs b/BurnOutSharp/ProtectionType/WMDS.cs index 09c889a7..483e147d 100644 --- a/BurnOutSharp/ProtectionType/WMDS.cs +++ b/BurnOutSharp/ProtectionType/WMDS.cs @@ -15,6 +15,7 @@ namespace BurnOutSharp.ProtectionType /// public class WMDS : IPathCheck, IPortableExecutableCheck { + /// public string CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) { // Get the sections from the executable, if possible