From 655b8385f9be033b59612a0c5b6bf4843780d1ff Mon Sep 17 00:00:00 2001 From: Matt Nadareski Date: Fri, 10 Mar 2023 11:20:35 -0500 Subject: [PATCH] Rename tool class --- BurnOutSharp/FileType/Executable.cs | 2 +- BurnOutSharp/FileType/LDSCRYPT.cs | 2 +- BurnOutSharp/FileType/PLJ.cs | 2 +- BurnOutSharp/FileType/SFFS.cs | 2 +- BurnOutSharp/Scanner.cs | 8 ++++---- BurnOutSharp/Tools/{Utilities.cs => FileTypeTools.cs} | 6 +----- Test/Extractor.cs | 2 +- Test/Printer.cs | 6 +++--- 8 files changed, 13 insertions(+), 17 deletions(-) rename BurnOutSharp/Tools/{Utilities.cs => FileTypeTools.cs} (99%) diff --git a/BurnOutSharp/FileType/Executable.cs b/BurnOutSharp/FileType/Executable.cs index 02e9d1b0..a572c775 100644 --- a/BurnOutSharp/FileType/Executable.cs +++ b/BurnOutSharp/FileType/Executable.cs @@ -62,7 +62,7 @@ namespace BurnOutSharp.FileType } // Get the wrapper for the appropriate executable type - WrapperBase wrapper = Tools.Utilities.DetermineExecutableType(stream); + WrapperBase wrapper = Tools.FileTypeTools.DetermineExecutableType(stream); if (wrapper == null) return protections; diff --git a/BurnOutSharp/FileType/LDSCRYPT.cs b/BurnOutSharp/FileType/LDSCRYPT.cs index f827142b..7215f846 100644 --- a/BurnOutSharp/FileType/LDSCRYPT.cs +++ b/BurnOutSharp/FileType/LDSCRYPT.cs @@ -32,7 +32,7 @@ namespace BurnOutSharp.FileType byte[] magic = new byte[16]; stream.Read(magic, 0, 16); - if (Tools.Utilities.GetFileType(magic) == SupportedFileType.LDSCRYPT) + if (Tools.FileTypeTools.GetFileType(magic) == SupportedFileType.LDSCRYPT) { AppendToDictionary(protections, file, "Link Data Security encrypted file"); return protections; diff --git a/BurnOutSharp/FileType/PLJ.cs b/BurnOutSharp/FileType/PLJ.cs index 60e7752d..fad30332 100644 --- a/BurnOutSharp/FileType/PLJ.cs +++ b/BurnOutSharp/FileType/PLJ.cs @@ -32,7 +32,7 @@ namespace BurnOutSharp.FileType byte[] magic = new byte[16]; stream.Read(magic, 0, 16); - if (Tools.Utilities.GetFileType(magic) == SupportedFileType.PLJ) + if (Tools.FileTypeTools.GetFileType(magic) == SupportedFileType.PLJ) { AppendToDictionary(protections, file, "PlayJ Audio File"); return protections; diff --git a/BurnOutSharp/FileType/SFFS.cs b/BurnOutSharp/FileType/SFFS.cs index 1b0f384d..66e60148 100644 --- a/BurnOutSharp/FileType/SFFS.cs +++ b/BurnOutSharp/FileType/SFFS.cs @@ -52,7 +52,7 @@ namespace BurnOutSharp.FileType byte[] magic = new byte[16]; stream.Read(magic, 0, 16); - if (Tools.Utilities.GetFileType(magic) == SupportedFileType.SFFS) + if (Tools.FileTypeTools.GetFileType(magic) == SupportedFileType.SFFS) { AppendToDictionary(protections, file, "StarForce Filesystem Container"); return protections; diff --git a/BurnOutSharp/Scanner.cs b/BurnOutSharp/Scanner.cs index 77669e7f..33258157 100644 --- a/BurnOutSharp/Scanner.cs +++ b/BurnOutSharp/Scanner.cs @@ -332,9 +332,9 @@ namespace BurnOutSharp } // Get the file type either from magic number or extension - SupportedFileType fileType = Tools.Utilities.GetFileType(magic); + SupportedFileType fileType = Tools.FileTypeTools.GetFileType(magic); if (fileType == SupportedFileType.UNKNOWN) - fileType = Tools.Utilities.GetFileType(extension); + fileType = Tools.FileTypeTools.GetFileType(extension); // If we still got unknown, just return null if (fileType == SupportedFileType.UNKNOWN) @@ -343,7 +343,7 @@ namespace BurnOutSharp #region Non-Archive File Types // Create a scannable for the given file type - var scannable = Tools.Utilities.CreateScannable(fileType); + var scannable = Tools.FileTypeTools.CreateScannable(fileType); // If we're scanning file contents if (scannable != null && ScanContents) @@ -357,7 +357,7 @@ namespace BurnOutSharp #region Archive File Types // Create an extractable for the given file type - var extractable = Tools.Utilities.CreateExtractable(fileType); + var extractable = Tools.FileTypeTools.CreateExtractable(fileType); // If we're scanning archives if (extractable != null && ScanArchives) diff --git a/BurnOutSharp/Tools/Utilities.cs b/BurnOutSharp/Tools/FileTypeTools.cs similarity index 99% rename from BurnOutSharp/Tools/Utilities.cs rename to BurnOutSharp/Tools/FileTypeTools.cs index 3517c70a..7fc0177c 100644 --- a/BurnOutSharp/Tools/Utilities.cs +++ b/BurnOutSharp/Tools/FileTypeTools.cs @@ -8,10 +8,8 @@ using BinaryObjectScanner.Interfaces; namespace BurnOutSharp.Tools { - public static class Utilities + public static class FileTypeTools { - #region File Types - /// /// Get the supported file type for a magic string /// @@ -944,7 +942,5 @@ namespace BurnOutSharp.Tools // Everything else fails return null; } - - #endregion } } diff --git a/Test/Extractor.cs b/Test/Extractor.cs index 6d58a42e..3cf35538 100644 --- a/Test/Extractor.cs +++ b/Test/Extractor.cs @@ -64,7 +64,7 @@ namespace Test stream.Seek(0, SeekOrigin.Begin); // Get the file type - SupportedFileType ft = BurnOutSharp.Tools.Utilities.GetFileType(magic); + SupportedFileType ft = BurnOutSharp.Tools.FileTypeTools.GetFileType(magic); // Executables technically can be "extracted", but let's ignore that // TODO: Support executables that include other stuff diff --git a/Test/Printer.cs b/Test/Printer.cs index 003ae8fc..fbe3f71a 100644 --- a/Test/Printer.cs +++ b/Test/Printer.cs @@ -50,18 +50,18 @@ namespace Test stream.Seek(0, SeekOrigin.Begin); // Get the file type - SupportedFileType ft = BurnOutSharp.Tools.Utilities.GetFileType(magic); + SupportedFileType ft = BurnOutSharp.Tools.FileTypeTools.GetFileType(magic); if (ft == SupportedFileType.UNKNOWN) { string extension = Path.GetExtension(file).TrimStart('.'); - ft = BurnOutSharp.Tools.Utilities.GetFileType(extension); + ft = BurnOutSharp.Tools.FileTypeTools.GetFileType(extension); } // Print out the file format Console.WriteLine($"File format found: {ft}"); // Setup the wrapper to print - var wrapper = BurnOutSharp.Tools.Utilities.CreateWrapper(ft, stream); + var wrapper = BurnOutSharp.Tools.FileTypeTools.CreateWrapper(ft, stream); // If we don't have a wrapper if (wrapper == null)