diff --git a/BinaryObjectScanner/Protection/CEG.Constants.cs b/BinaryObjectScanner/Protection/CEG.Constants.cs index 1c5b8c80..075b034a 100644 --- a/BinaryObjectScanner/Protection/CEG.Constants.cs +++ b/BinaryObjectScanner/Protection/CEG.Constants.cs @@ -2,8 +2,6 @@ using System.Collections.Generic; namespace BinaryObjectScanner.Protection { - // The large dictionaries and hash sets that CEG.cs needs for its logic. - // Contained in a separate file since dictionary size is very large. // TODO: Executables ran through LumaCEG are currently indistinguishable. A table of known OptionalHeader checksums may be worth looking into. public partial class CEG { @@ -1119,7 +1117,6 @@ namespace BinaryObjectScanner.Protection { "DF48D246-BE5E-4947-8FE2-6F3F6B9FEC69", "57971 (v11) - Engine.dll" }, { "85A14CBC-EDC1-4B8D-BCDF-434C71E825F1", "57971 (v12, 4510052899061345257) - Engine.dll" }, - #endregion // Steam2 and Steam3 are the names of two different Steam CDN formats. Valve switched from Steam2 to Steam3 @@ -9204,16 +9201,19 @@ namespace BinaryObjectScanner.Protection { 1534178082, [ "36DD7C19-D982-498C-8586-BF76BF016DE4" ] }, }; -#if NETSTANDARD2_0_OR_GREATER || NET21_OR_GREATER || NETCOREAPP /// - /// Hashset containing the steam split GUIDs for executables that proper strips have already been acquired for. + /// Set containing the steam split GUIDs for executables that proper strips have already been acquired for. /// /// /// In the future, this may be split out into two seperate tables, one for tampered/cracked executables /// and one for executables that are untampered but still containing strips. It is uncertain if that will be /// necessary at the moment, though. /// - private static readonly HashSet HaveStrips= +#if NET20 || NET35 + private static readonly List HaveStrips = +#else + private static readonly HashSet HaveStrips = +#endif [ "0602B89C-4FAB-42F8-9772-C3A61D36AB93", "060E4378-4B8C-40F5-ACFC-A42B98DBB076", @@ -9318,6 +9318,5 @@ namespace BinaryObjectScanner.Protection "F7D0A3D5-A821-4C79-ABFC-59128E0FE3B9", "FBF6EAD2-00DF-44F1-80F6-6595B2E8BF44", ]; -#endif } } diff --git a/BinaryObjectScanner/Protection/CEG.cs b/BinaryObjectScanner/Protection/CEG.cs index 814be0a3..dd588da9 100644 --- a/BinaryObjectScanner/Protection/CEG.cs +++ b/BinaryObjectScanner/Protection/CEG.cs @@ -1,5 +1,5 @@ -using SabreTools.IO.Extensions; using BinaryObjectScanner.Interfaces; +using SabreTools.IO.Extensions; using SabreTools.Serialization.Wrappers; namespace BinaryObjectScanner.Protection @@ -85,9 +85,7 @@ namespace BinaryObjectScanner.Protection if (steamSplitGuid != zeroGUID) { if (CEGDictionary.TryGetValue(steamSplitGuid, out string? tamperedName)) - { return $"CEG - Possibly tampered - {tamperedName} {ReportHelper(steamSplitGuid)}"; - } return "CEG - Unknown manifest, please report to us on GitHub!"; } @@ -138,16 +136,12 @@ namespace BinaryObjectScanner.Protection /// /// Steam split GUID /// A string about reporting on GitHub if not found, otherwise returns null. - private string? ReportHelper(string steamSplitGuid) + private static string? ReportHelper(string steamSplitGuid) { -#if NETSTANDARD2_0_OR_GREATER || NET21_OR_GREATER || NETCOREAPP if (!HaveStrips.Contains(steamSplitGuid)) return "- Please report to us on GitHub!"; return null; -#else - return null; -#endif } } }