Skip to content

Commit 0181917

Browse files
committed
Minor cleanup
1 parent 008d53a commit 0181917

2 files changed

Lines changed: 8 additions & 15 deletions

File tree

BinaryObjectScanner/Protection/CEG.Constants.cs

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22

33
namespace BinaryObjectScanner.Protection
44
{
5-
// The large dictionaries and hash sets that CEG.cs needs for its logic.
6-
// Contained in a separate file since dictionary size is very large.
75
// TODO: Executables ran through LumaCEG are currently indistinguishable. A table of known OptionalHeader checksums may be worth looking into.
86
public partial class CEG
97
{
@@ -1119,7 +1117,6 @@ public partial class CEG
11191117
{ "DF48D246-BE5E-4947-8FE2-6F3F6B9FEC69", "57971 (v11) - Engine.dll" },
11201118
{ "85A14CBC-EDC1-4B8D-BCDF-434C71E825F1", "57971 (v12, 4510052899061345257) - Engine.dll" },
11211119

1122-
11231120
#endregion
11241121

11251122
// Steam2 and Steam3 are the names of two different Steam CDN formats. Valve switched from Steam2 to Steam3
@@ -9204,16 +9201,19 @@ public partial class CEG
92049201
{ 1534178082, [ "36DD7C19-D982-498C-8586-BF76BF016DE4" ] },
92059202
};
92069203

9207-
#if NETSTANDARD2_0_OR_GREATER || NET21_OR_GREATER || NETCOREAPP
92089204
/// <summary>
9209-
/// Hashset containing the steam split GUIDs for executables that proper strips have already been acquired for.
9205+
/// Set containing the steam split GUIDs for executables that proper strips have already been acquired for.
92109206
/// </summary>
92119207
/// <remarks>
92129208
/// In the future, this may be split out into two seperate tables, one for tampered/cracked executables
92139209
/// and one for executables that are untampered but still containing strips. It is uncertain if that will be
92149210
/// necessary at the moment, though.
92159211
/// </remarks>
9216-
private static readonly HashSet<string> HaveStrips=
9212+
#if NET20 || NET35
9213+
private static readonly List<string> HaveStrips =
9214+
#else
9215+
private static readonly HashSet<string> HaveStrips =
9216+
#endif
92179217
[
92189218
"0602B89C-4FAB-42F8-9772-C3A61D36AB93",
92199219
"060E4378-4B8C-40F5-ACFC-A42B98DBB076",
@@ -9318,6 +9318,5 @@ public partial class CEG
93189318
"F7D0A3D5-A821-4C79-ABFC-59128E0FE3B9",
93199319
"FBF6EAD2-00DF-44F1-80F6-6595B2E8BF44",
93209320
];
9321-
#endif
93229321
}
93239322
}

BinaryObjectScanner/Protection/CEG.cs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
using SabreTools.IO.Extensions;
21
using BinaryObjectScanner.Interfaces;
2+
using SabreTools.IO.Extensions;
33
using SabreTools.Serialization.Wrappers;
44

55
namespace BinaryObjectScanner.Protection
@@ -85,9 +85,7 @@ public partial class CEG : IExecutableCheck<PortableExecutable>
8585
if (steamSplitGuid != zeroGUID)
8686
{
8787
if (CEGDictionary.TryGetValue(steamSplitGuid, out string? tamperedName))
88-
{
8988
return $"CEG - Possibly tampered - {tamperedName} {ReportHelper(steamSplitGuid)}";
90-
}
9189

9290
return "CEG - Unknown manifest, please report to us on GitHub!";
9391
}
@@ -138,16 +136,12 @@ public partial class CEG : IExecutableCheck<PortableExecutable>
138136
/// </summary>
139137
/// <param name="steamSplitGuid">Steam split GUID</param>
140138
/// <returns>A string about reporting on GitHub if not found, otherwise returns null.</returns>
141-
private string? ReportHelper(string steamSplitGuid)
139+
private static string? ReportHelper(string steamSplitGuid)
142140
{
143-
#if NETSTANDARD2_0_OR_GREATER || NET21_OR_GREATER || NETCOREAPP
144141
if (!HaveStrips.Contains(steamSplitGuid))
145142
return "- Please report to us on GitHub!";
146143

147144
return null;
148-
#else
149-
return null;
150-
#endif
151145
}
152146
}
153147
}

0 commit comments

Comments
 (0)