mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-04-23 06:34:03 +00:00
Rename tool class
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user