Detect zlib by magic
This commit is contained in:
parent
2a7b71dafd
commit
c1f779ebb7
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -132,7 +132,7 @@ namespace FirstPlugin
|
||||
{
|
||||
string ext = Utils.GetExtension(FileEntries[i].FileName);
|
||||
|
||||
if (Extensions[ext] > 10000)
|
||||
if (Extensions[ext] > 10000 && ext != ".mmb")
|
||||
FileEntries[i].CanLoadFile = false;
|
||||
|
||||
files.Add(FileEntries[i]);
|
||||
@ -141,7 +141,7 @@ namespace FirstPlugin
|
||||
List<string> FilteredExtensions = new List<string>();
|
||||
foreach (var ext in Extensions)
|
||||
{
|
||||
if (ext.Value > 10000)
|
||||
if (ext.Value > 10000 && ext.Key != ".mmb")
|
||||
FilteredExtensions.Add(ext.Key);
|
||||
}
|
||||
|
||||
|
Binary file not shown.
Binary file not shown.
@ -179,7 +179,7 @@ namespace Switch_Toolbox.Library.IO
|
||||
return OpenFileFormat(FileName, data, LeaveStreamOpen, InArchive, archiveNode, true,
|
||||
CompressionType.Zstb, DecompressedFileSize, CompressedFileSize);
|
||||
}
|
||||
if (Path.GetExtension(FileName) == ".z" && CompType == CompressionType.None)
|
||||
if (MagicHex2 == 0x789C || MagicHex2 == 0x78DA || Path.GetExtension(FileName) == ".z" && CompType == CompressionType.None)
|
||||
{
|
||||
if (data == null)
|
||||
data = File.ReadAllBytes(FileName);
|
||||
|
Loading…
x
Reference in New Issue
Block a user