mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-09 02:16:46 +00:00
Order of operations
This commit is contained in:
@@ -50,12 +50,12 @@ namespace BinaryObjectScanner.FileType
|
||||
// Find all file parts
|
||||
FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(file))];
|
||||
|
||||
// Try to read the file path if no entries are found
|
||||
if (zipFile.Entries.Count == 0)
|
||||
// If there are multiple parts
|
||||
if (parts.Length > 1)
|
||||
zipFile = ZipArchive.Open(parts, readerOptions);
|
||||
|
||||
// If there are multiple parts
|
||||
else if (parts.Length > 1)
|
||||
// Try to read the file path if no entries are found
|
||||
else if (zipFile.Entries.Count == 0)
|
||||
zipFile = ZipArchive.Open(parts, readerOptions);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,12 +51,12 @@ namespace BinaryObjectScanner.FileType
|
||||
// Find all file parts
|
||||
FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(file))];
|
||||
|
||||
// Try to read the file path if no entries are found
|
||||
if (rarFile.Entries.Count == 0)
|
||||
// If there are multiple parts
|
||||
if (parts.Length > 1)
|
||||
rarFile = RarArchive.Open(parts, readerOptions);
|
||||
|
||||
// If there's any multipart items, try reading the file as well
|
||||
else if (parts.Length > 1)
|
||||
// Try to read the file path if no entries are found
|
||||
else if (rarFile.Entries.Count == 0)
|
||||
rarFile = RarArchive.Open(parts, readerOptions);
|
||||
}
|
||||
|
||||
|
||||
@@ -50,13 +50,13 @@ namespace BinaryObjectScanner.FileType
|
||||
{
|
||||
// Find all file parts
|
||||
FileInfo[] parts = [.. ArchiveFactory.GetFileParts(new FileInfo(file))];
|
||||
|
||||
// If there are multiple parts
|
||||
if (parts.Length > 1)
|
||||
sevenZip = SevenZipArchive.Open(parts, readerOptions);
|
||||
|
||||
// Try to read the file path if no entries are found
|
||||
if (sevenZip.Entries.Count == 0)
|
||||
sevenZip = SevenZipArchive.Open(parts, readerOptions);
|
||||
|
||||
// If there's any multipart items, try reading the file as well
|
||||
else if (parts.Length > 1)
|
||||
else if (sevenZip.Entries.Count == 0)
|
||||
sevenZip = SevenZipArchive.Open(parts, readerOptions);
|
||||
}
|
||||
|
||||
|
||||
@@ -93,12 +93,12 @@ namespace ExtractionTool
|
||||
// Get the file type
|
||||
WrapperType ft = WrapperFactory.GetFileType(magic, extension);
|
||||
var wrapper = WrapperFactory.CreateWrapper(ft, stream);
|
||||
if (wrapper == null)
|
||||
{
|
||||
Console.WriteLine("Could not determine the file format, skipping...");
|
||||
Console.WriteLine();
|
||||
return;
|
||||
}
|
||||
// if (wrapper == null)
|
||||
// {
|
||||
// Console.WriteLine("Could not determine the file format, skipping...");
|
||||
// Console.WriteLine();
|
||||
// return;
|
||||
// }
|
||||
|
||||
// Create the output directory
|
||||
Directory.CreateDirectory(outputDirectory);
|
||||
|
||||
Reference in New Issue
Block a user