Rename tool class

This commit is contained in:
Matt Nadareski
2023-03-10 11:20:35 -05:00
parent 439c141c2c
commit 655b8385f9
8 changed files with 13 additions and 17 deletions

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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;

View File

@@ -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)

View File

@@ -8,10 +8,8 @@ using BinaryObjectScanner.Interfaces;
namespace BurnOutSharp.Tools
{
public static class Utilities
public static class FileTypeTools
{
#region File Types
/// <summary>
/// Get the supported file type for a magic string
/// </summary>
@@ -944,7 +942,5 @@ namespace BurnOutSharp.Tools
// Everything else fails
return null;
}
#endregion
}
}

View File

@@ -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

View File

@@ -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)