From 53c8ec1dcfa9045056b0ee6120c31a4367c357ad Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Sun, 21 Sep 2025 15:30:18 -0400 Subject: [PATCH] Whitespace and usings cleanup --- BinaryObjectScanner/FileType/DetectableBaseT.cs | 1 - BinaryObjectScanner/Packer/DotNetReactor.cs | 6 +++--- BinaryObjectScanner/Packer/MPRESS.cs | 6 +++--- BinaryObjectScanner/Packer/MicrosoftCABSFX.cs | 2 +- BinaryObjectScanner/Packer/SevenZipSFX.cs | 2 +- BinaryObjectScanner/Protection/EasyAntiCheat.cs | 2 +- BinaryObjectScanner/Protection/ElectronicArts.cs | 2 +- BinaryObjectScanner/Protection/GFWL.cs | 2 +- BinaryObjectScanner/Protection/ImpulseReactor.cs | 2 +- BinaryObjectScanner/Protection/InterLok.cs | 6 +++--- BinaryObjectScanner/Protection/Macrovision.cs | 4 ++-- BinaryObjectScanner/Protection/MediaMax.cs | 2 +- BinaryObjectScanner/Protection/ProtectDVDVideo.cs | 2 +- BinaryObjectScanner/Protection/Roxxe.cs | 2 +- BinaryObjectScanner/Protection/Tages.cs | 2 +- BinaryObjectScanner/Protection/Uplay.cs | 2 +- BinaryObjectScanner/Protection/WTMCDProtect.cs | 2 +- 17 files changed, 23 insertions(+), 24 deletions(-) diff --git a/BinaryObjectScanner/FileType/DetectableBaseT.cs b/BinaryObjectScanner/FileType/DetectableBaseT.cs index 3050fd31..386d9a2f 100644 --- a/BinaryObjectScanner/FileType/DetectableBaseT.cs +++ b/BinaryObjectScanner/FileType/DetectableBaseT.cs @@ -1,4 +1,3 @@ -using System; using BinaryObjectScanner.Interfaces; using SabreTools.Serialization.Interfaces; diff --git a/BinaryObjectScanner/Packer/DotNetReactor.cs b/BinaryObjectScanner/Packer/DotNetReactor.cs index 4da8e62a..973eaf54 100644 --- a/BinaryObjectScanner/Packer/DotNetReactor.cs +++ b/BinaryObjectScanner/Packer/DotNetReactor.cs @@ -1,8 +1,8 @@ -using BinaryObjectScanner.Interfaces; -using SabreTools.Serialization.Wrappers; -using System.Collections.Generic; +using System.Collections.Generic; +using BinaryObjectScanner.Interfaces; using SabreTools.Matching; using SabreTools.Matching.Content; +using SabreTools.Serialization.Wrappers; namespace BinaryObjectScanner.Packer { diff --git a/BinaryObjectScanner/Packer/MPRESS.cs b/BinaryObjectScanner/Packer/MPRESS.cs index d657c7ef..958b89c5 100644 --- a/BinaryObjectScanner/Packer/MPRESS.cs +++ b/BinaryObjectScanner/Packer/MPRESS.cs @@ -12,11 +12,11 @@ namespace BinaryObjectScanner.Packer { // TODO: Confirm if both need to be present // TODO: Figure out how to get version - + if (exe.ContainsSection(".MPRESS1")) - return "MPRESS"; + return "MPRESS"; if (exe.ContainsSection(".MPRESS2")) - return "MPRESS"; + return "MPRESS"; return null; } diff --git a/BinaryObjectScanner/Packer/MicrosoftCABSFX.cs b/BinaryObjectScanner/Packer/MicrosoftCABSFX.cs index 2999e294..7dd823bc 100644 --- a/BinaryObjectScanner/Packer/MicrosoftCABSFX.cs +++ b/BinaryObjectScanner/Packer/MicrosoftCABSFX.cs @@ -17,7 +17,7 @@ namespace BinaryObjectScanner.Packer return $"Microsoft CAB SFX {GetVersion(exe)}"; name = exe.OriginalFilename; - + if (name.OptionalEquals("WEXTRACT.EXE", StringComparison.OrdinalIgnoreCase)) return $"Microsoft CAB SFX {GetVersion(exe)}"; diff --git a/BinaryObjectScanner/Packer/SevenZipSFX.cs b/BinaryObjectScanner/Packer/SevenZipSFX.cs index dd43181b..a5e050a1 100644 --- a/BinaryObjectScanner/Packer/SevenZipSFX.cs +++ b/BinaryObjectScanner/Packer/SevenZipSFX.cs @@ -29,7 +29,7 @@ namespace BinaryObjectScanner.Packer return "7-Zip SFX"; name = exe.InternalName; - + if (name.OptionalEquals("7z.sfx")) return "7-Zip SFX"; else if (name.OptionalEquals("7zS.sfx")) diff --git a/BinaryObjectScanner/Protection/EasyAntiCheat.cs b/BinaryObjectScanner/Protection/EasyAntiCheat.cs index dce34cec..2880328d 100644 --- a/BinaryObjectScanner/Protection/EasyAntiCheat.cs +++ b/BinaryObjectScanner/Protection/EasyAntiCheat.cs @@ -52,7 +52,7 @@ namespace BinaryObjectScanner.Protection // "EasyAntiCheat Service" -> "EasyAntiCheat.exe", which is found installed in "Program Files (x86)\EasyAntiCheat" and "EasyAntiCheat_Setup.exe" ("Intruder", Update 2287, Steam). name = exe.ProductName; - + // Found in multiple files, including "VideoHorrorSociety.exe" ("Video Horror Society", Patch 1.0.70309, Steam) and "start_protected_game.exe" ("VRChat", Version 2022.2.2p2, Oculus). if (!string.IsNullOrEmpty(name) && name!.Contains("Easy Anti-Cheat Bootstrapper (EOS)")) return "Easy Anti-Cheat (EOS Version)"; diff --git a/BinaryObjectScanner/Protection/ElectronicArts.cs b/BinaryObjectScanner/Protection/ElectronicArts.cs index 1af7eb6c..1a783711 100644 --- a/BinaryObjectScanner/Protection/ElectronicArts.cs +++ b/BinaryObjectScanner/Protection/ElectronicArts.cs @@ -20,7 +20,7 @@ namespace BinaryObjectScanner.Protection return $"EA DRM Protection {exe.GetInternalVersion()}"; name = exe.InternalName; - + if (name.OptionalEquals("CDCode", StringComparison.Ordinal)) return $"EA CdKey Registration Module {exe.GetInternalVersion()}"; diff --git a/BinaryObjectScanner/Protection/GFWL.cs b/BinaryObjectScanner/Protection/GFWL.cs index b7809415..9bce55b7 100644 --- a/BinaryObjectScanner/Protection/GFWL.cs +++ b/BinaryObjectScanner/Protection/GFWL.cs @@ -15,7 +15,7 @@ namespace BinaryObjectScanner.Protection public string? CheckExecutable(string file, PortableExecutable exe, bool includeDebug) { string? name = exe.FileDescription; - + if (name.OptionalStartsWith("Games for Windows - LIVE Zero Day Piracy Protection", StringComparison.OrdinalIgnoreCase)) return $"Games for Windows LIVE - Zero Day Piracy Protection Module {exe.GetInternalVersion()}"; else if (name.OptionalStartsWith("Games for Windows", StringComparison.OrdinalIgnoreCase)) diff --git a/BinaryObjectScanner/Protection/ImpulseReactor.cs b/BinaryObjectScanner/Protection/ImpulseReactor.cs index 945e7003..8c2c3e29 100644 --- a/BinaryObjectScanner/Protection/ImpulseReactor.cs +++ b/BinaryObjectScanner/Protection/ImpulseReactor.cs @@ -27,7 +27,7 @@ namespace BinaryObjectScanner.Protection return $"Impulse Reactor Core Module {exe.GetInternalVersion()}"; name = exe.OriginalFilename; - + if (name.OptionalContains("ReactorActivate.exe")) return $"Stardock Product Activation {exe.GetInternalVersion()}"; diff --git a/BinaryObjectScanner/Protection/InterLok.cs b/BinaryObjectScanner/Protection/InterLok.cs index d782d5aa..5ade43a4 100644 --- a/BinaryObjectScanner/Protection/InterLok.cs +++ b/BinaryObjectScanner/Protection/InterLok.cs @@ -20,16 +20,16 @@ namespace BinaryObjectScanner.Protection if (match != null) return $"PACE Anti-Piracy InterLok {GetVersion(match)}"; } - + return null; } - + private static string GetVersion(string match) { var versionMatch = Regex.Match(match, @"(?<=InterLok )(.*?)(?=,)"); if (versionMatch.Success) return versionMatch.Value; - + return "(Unknown Version - Please report to us on GitHub)"; } } diff --git a/BinaryObjectScanner/Protection/Macrovision.cs b/BinaryObjectScanner/Protection/Macrovision.cs index 21e97fb0..a2a4d904 100644 --- a/BinaryObjectScanner/Protection/Macrovision.cs +++ b/BinaryObjectScanner/Protection/Macrovision.cs @@ -609,7 +609,7 @@ namespace BinaryObjectScanner.Protection // Found in Redump entries 9617 and 49552. or "1.35.000" - + // Found in Redump entries 2595 and 30121. or "1.40.004" @@ -739,7 +739,7 @@ namespace BinaryObjectScanner.Protection // RealNetworks presumably acquired SafeDisc when they purchased Trymedia from Macrovision (https://realnetworks.com/press/releases/2008/realnetworks-acquire-trymedia-macrovision). // Due to this being the only known sample, it may be that they did a trial run of a new version of SafeDisc, before deciding against continuing its development. or "4.91.000" - + => "SafeDisc", // SafeDisc (Unconfirmed) diff --git a/BinaryObjectScanner/Protection/MediaMax.cs b/BinaryObjectScanner/Protection/MediaMax.cs index f44b145d..2d043248 100644 --- a/BinaryObjectScanner/Protection/MediaMax.cs +++ b/BinaryObjectScanner/Protection/MediaMax.cs @@ -26,7 +26,7 @@ namespace BinaryObjectScanner.Protection return $"MediaMax CD-3"; name = exe.ProductName; - + if (name.OptionalStartsWith("LicGen Module", StringComparison.OrdinalIgnoreCase)) return $"MediaMax CD-3"; diff --git a/BinaryObjectScanner/Protection/ProtectDVDVideo.cs b/BinaryObjectScanner/Protection/ProtectDVDVideo.cs index 38aad2e0..a4399073 100644 --- a/BinaryObjectScanner/Protection/ProtectDVDVideo.cs +++ b/BinaryObjectScanner/Protection/ProtectDVDVideo.cs @@ -26,7 +26,7 @@ namespace BinaryObjectScanner.Protection } } } - + return protections; } diff --git a/BinaryObjectScanner/Protection/Roxxe.cs b/BinaryObjectScanner/Protection/Roxxe.cs index 7cd0ed71..287013ce 100644 --- a/BinaryObjectScanner/Protection/Roxxe.cs +++ b/BinaryObjectScanner/Protection/Roxxe.cs @@ -34,7 +34,7 @@ namespace BinaryObjectScanner.Protection // These checks are less reliable, as they are still found in a version of the game that appears to have patched out Roxxe (the version present in IA item "original-war"). if (strs.Exists(s => s.Contains("PRRT01"))) return "Roxxe (Possibly remnants)"; - + if (strs.Exists(s => s.Contains("CommonPRRT"))) return "Roxxe (Possibly remnants)"; diff --git a/BinaryObjectScanner/Protection/Tages.cs b/BinaryObjectScanner/Protection/Tages.cs index c83f9073..dec1492e 100644 --- a/BinaryObjectScanner/Protection/Tages.cs +++ b/BinaryObjectScanner/Protection/Tages.cs @@ -33,7 +33,7 @@ namespace BinaryObjectScanner.Protection return $"TAGES Activation Client {GetVersion(exe)}"; name = exe.ProductName; - + if (name.OptionalStartsWith("Application TagesSetup", StringComparison.OrdinalIgnoreCase)) return $"TAGES Driver Setup {GetVersion(exe)}"; else if (name.OptionalStartsWith("T@GES", StringComparison.OrdinalIgnoreCase)) diff --git a/BinaryObjectScanner/Protection/Uplay.cs b/BinaryObjectScanner/Protection/Uplay.cs index 56eb474d..2bc62bf1 100644 --- a/BinaryObjectScanner/Protection/Uplay.cs +++ b/BinaryObjectScanner/Protection/Uplay.cs @@ -31,7 +31,7 @@ namespace BinaryObjectScanner.Protection return "Uplay / Ubisoft Connect"; else if (name.OptionalContains("Uplay launcher")) return "Uplay / Ubisoft Connect"; - + name = exe.ProductName; // There's also a variant that looks like "Uplay installer" diff --git a/BinaryObjectScanner/Protection/WTMCDProtect.cs b/BinaryObjectScanner/Protection/WTMCDProtect.cs index 51f98074..608c30a0 100644 --- a/BinaryObjectScanner/Protection/WTMCDProtect.cs +++ b/BinaryObjectScanner/Protection/WTMCDProtect.cs @@ -24,7 +24,7 @@ namespace BinaryObjectScanner.Protection return "WTM Protection Viewer"; name = exe.ProductName; - + if (name.OptionalContains("WTM Copy Protection Viewer")) return "WTM Protection Viewer";