diff --git a/BurnOutSharp/Tools/FileTypeTools.cs b/BinaryObjectScanner.Wrappers/WrapperFactory.cs similarity index 93% rename from BurnOutSharp/Tools/FileTypeTools.cs rename to BinaryObjectScanner.Wrappers/WrapperFactory.cs index 2fec1690..90520dff 100644 --- a/BurnOutSharp/Tools/FileTypeTools.cs +++ b/BinaryObjectScanner.Wrappers/WrapperFactory.cs @@ -2,11 +2,10 @@ using System.IO; using BinaryObjectScanner.Matching; using BinaryObjectScanner.Utilities; -using BinaryObjectScanner.Wrappers; -namespace BurnOutSharp.Tools +namespace BinaryObjectScanner.Wrappers { - public static class FileTypeTools + public static class WrapperFactory { /// /// Create an instance of a wrapper based on file type @@ -22,7 +21,7 @@ namespace BurnOutSharp.Tools //case SupportedFileType.BZip2: return BZip2.Create(data); case SupportedFileType.CFB: return CFB.Create(data); case SupportedFileType.CIA: return CIA.Create(data); - case SupportedFileType.Executable: return DetermineExecutableType(data); + case SupportedFileType.Executable: return CreateExecutableWrapper(data); case SupportedFileType.GCF: return GCF.Create(data); //case SupportedFileType.GZIP: return GZIP.Create(data); //case SupportedFileType.IniFile: return IniFile.Create(data); @@ -56,11 +55,11 @@ namespace BurnOutSharp.Tools } /// - /// Determine the executable type from the stream + /// Create an instance of a wrapper based on the executable type /// /// Stream data to parse /// WrapperBase representing the executable, null on error - public static WrapperBase DetermineExecutableType(Stream stream) + public static WrapperBase CreateExecutableWrapper(Stream stream) { // Try to get an MS-DOS wrapper first WrapperBase wrapper = MSDOS.Create(stream); diff --git a/BurnOutSharp/FileType/Executable.cs b/BurnOutSharp/FileType/Executable.cs index a6c4b51c..f7411a64 100644 --- a/BurnOutSharp/FileType/Executable.cs +++ b/BurnOutSharp/FileType/Executable.cs @@ -112,7 +112,7 @@ namespace BurnOutSharp.FileType } // Get the wrapper for the appropriate executable type - WrapperBase wrapper = Tools.FileTypeTools.DetermineExecutableType(stream); + WrapperBase wrapper = WrapperFactory.CreateExecutableWrapper(stream); if (wrapper == null) return protections; diff --git a/Test/Printer.cs b/Test/Printer.cs index be2af7d8..0caa448c 100644 --- a/Test/Printer.cs +++ b/Test/Printer.cs @@ -2,6 +2,7 @@ using System; using System.IO; using System.Text; using BinaryObjectScanner.Utilities; +using BinaryObjectScanner.Wrappers; namespace Test { @@ -60,7 +61,7 @@ namespace Test Console.WriteLine($"File format found: {ft}"); // Setup the wrapper to print - var wrapper = BurnOutSharp.Tools.FileTypeTools.CreateWrapper(ft, stream); + var wrapper = WrapperFactory.CreateWrapper(ft, stream); // If we don't have a wrapper if (wrapper == null)