Minor cleanup

This commit is contained in:
Matt Nadareski
2026-03-17 13:10:59 -04:00
parent 008d53ad8a
commit 0181917850
2 changed files with 8 additions and 15 deletions

View File

@@ -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
/// <summary>
/// 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.
/// </summary>
/// <remarks>
/// 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.
/// </remarks>
private static readonly HashSet<string> HaveStrips=
#if NET20 || NET35
private static readonly List<string> HaveStrips =
#else
private static readonly HashSet<string> 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
}
}

View File

@@ -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
/// </summary>
/// <param name="steamSplitGuid">Steam split GUID</param>
/// <returns>A string about reporting on GitHub if not found, otherwise returns null.</returns>
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
}
}
}