mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-08 18:06:34 +00:00
Handle archive parts
This commit is contained in:
@@ -47,13 +47,16 @@ namespace BinaryObjectScanner.FileType
|
||||
// If the file exists
|
||||
if (!string.IsNullOrEmpty(file) && File.Exists(file!))
|
||||
{
|
||||
// Find all file parts
|
||||
var parts = ArchiveFactory.GetFileParts(new FileInfo(file));
|
||||
|
||||
// Try to read the file path if no entries are found
|
||||
if (zipFile.Entries.Count == 0)
|
||||
zipFile = ZipArchive.Open(file!, readerOptions);
|
||||
zipFile = ZipArchive.Open(parts, readerOptions);
|
||||
|
||||
// If there's any multipart items, try reading the file as well
|
||||
else if (!zipFile.IsComplete)
|
||||
zipFile = ZipArchive.Open(file!, readerOptions);
|
||||
zipFile = ZipArchive.Open(parts, readerOptions);
|
||||
}
|
||||
|
||||
foreach (var entry in zipFile.Entries)
|
||||
|
||||
@@ -48,13 +48,16 @@ namespace BinaryObjectScanner.FileType
|
||||
// If the file exists
|
||||
if (!string.IsNullOrEmpty(file) && File.Exists(file!))
|
||||
{
|
||||
// Find all file parts
|
||||
var parts = ArchiveFactory.GetFileParts(new FileInfo(file));
|
||||
|
||||
// Try to read the file path if no entries are found
|
||||
if (rarFile.Entries.Count == 0)
|
||||
rarFile = RarArchive.Open(file!, readerOptions);
|
||||
rarFile = RarArchive.Open(parts, readerOptions);
|
||||
|
||||
// If there's any multipart items, try reading the file as well
|
||||
else if (!rarFile.IsComplete)
|
||||
rarFile = RarArchive.Open(file!, readerOptions);
|
||||
rarFile = RarArchive.Open(parts, readerOptions);
|
||||
}
|
||||
|
||||
if (rarFile.IsSolid)
|
||||
|
||||
@@ -48,13 +48,16 @@ namespace BinaryObjectScanner.FileType
|
||||
// If the file exists
|
||||
if (!string.IsNullOrEmpty(file) && File.Exists(file!))
|
||||
{
|
||||
// Find all file parts
|
||||
var parts = ArchiveFactory.GetFileParts(new FileInfo(file));
|
||||
|
||||
// Try to read the file path if no entries are found
|
||||
if (sevenZip.Entries.Count == 0)
|
||||
sevenZip = SevenZipArchive.Open(file!, readerOptions);
|
||||
sevenZip = SevenZipArchive.Open(parts, readerOptions);
|
||||
|
||||
// If there's any multipart items, try reading the file as well
|
||||
else if (!sevenZip.IsComplete)
|
||||
sevenZip = SevenZipArchive.Open(file!, readerOptions);
|
||||
sevenZip = SevenZipArchive.Open(parts, readerOptions);
|
||||
}
|
||||
|
||||
// Currently doesn't flag solid 7z archives with only 1 solid block as solid, but practically speaking
|
||||
|
||||
Reference in New Issue
Block a user