From ee839ca2285d9720641f5fda89d5983c80a0a945 Mon Sep 17 00:00:00 2001 From: bestest Date: Fri, 25 Oct 2024 00:55:41 -0400 Subject: [PATCH] Finalize formatting and PR. --- BinaryObjectScanner/Protection/CopyX.cs | 24 +++++++++--------------- 1 file changed, 9 insertions(+), 15 deletions(-) diff --git a/BinaryObjectScanner/Protection/CopyX.cs b/BinaryObjectScanner/Protection/CopyX.cs index 008ba3da..ed0a190a 100644 --- a/BinaryObjectScanner/Protection/CopyX.cs +++ b/BinaryObjectScanner/Protection/CopyX.cs @@ -41,15 +41,12 @@ namespace BinaryObjectScanner.Protection /// - public string? - CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug) //Checks for Professional + public string? CheckPortableExecutable(string file, PortableExecutable pex, bool includeDebug)//Checks for Professional { //I don't need this to check optgraph.dll, that's redundant. Unsure how to exclude that. if (pex.OverlayStrings != null) { - if (pex.OverlayStrings.Any(s => - s.Contains( - "optgraph.dll"))) //Checks if main executable contains reference to optgraph.dll. Emergency 4's is missing this for some reason. + if (pex.OverlayStrings.Any(s => s.Contains("optgraph.dll")))//Checks if main executable contains reference to optgraph.dll. Emergency 4's is missing this for some reason. // TODO: TKKG also has an NE 3.1x executable with a reference. This can be added later. return "copy-X"; } @@ -58,17 +55,14 @@ namespace BinaryObjectScanner.Protection } /// - public string? CheckFilePath(string path) //Checks for Professional + public string? CheckFilePath(string path)//Checks for Professional { - if (Path.GetFileName(path) - .Equals("optgraph.dll", - StringComparison.OrdinalIgnoreCase)) //Filename check for optgraph.dll disc check + if (Path.GetFileName(path).Equals("optgraph.dll", StringComparison.OrdinalIgnoreCase))//Filename check for optgraph.dll disc check { return "copy-X"; } - if (Path.GetFileName(path) - .Equals("iofile.x64", StringComparison.OrdinalIgnoreCase)) //Filename check for seemingly comorbid file. + if (Path.GetFileName(path).Equals("iofile.x64", StringComparison.OrdinalIgnoreCase))//Filename check for seemingly comorbid file. { return "copy-X"; } @@ -83,7 +77,7 @@ namespace BinaryObjectScanner.Protection #if NET20 || NET35 public Queue CheckDirectoryPath(string path, IEnumerable? files) #else - public ConcurrentQueue CheckDirectoryPath(string path, IEnumerable? files) // Checks for Light + public ConcurrentQueue CheckDirectoryPath(string path, IEnumerable? files)// Checks for Light #endif { #if NET20 || NET35 @@ -93,9 +87,9 @@ namespace BinaryObjectScanner.Protection #endif if (files == null) return protections; - var zdatFiles = files.Where(f => f.Remove(0, path.Length + 1).StartsWith("ZDAT")); //Gets files in ZDAT* + var zdatFiles = files.Where(f => f.Remove(0, path.Length + 1).StartsWith("ZDAT"));//Gets files in ZDAT* var fileList = zdatFiles.ToList(); - fileList.Sort(); // Sorts list of files in ZDAT* so I can just pull the first one, later ones have a chance of the ring intersecting the start of the file. + fileList.Sort();// Sorts list of files in ZDAT* so I can just pull the first one, later ones have a chance of the ring intersecting the start of the file. if (fileList.Count > 0) { FileStream stream = new FileStream(fileList[0], FileMode.Open, FileAccess.Read); @@ -110,4 +104,4 @@ namespace BinaryObjectScanner.Protection return protections; } } -} \ No newline at end of file +}