diff --git a/AssetStudio/AssetsManager.cs b/AssetStudio/AssetsManager.cs index bdd0cf2..9a59702 100644 --- a/AssetStudio/AssetsManager.cs +++ b/AssetStudio/AssetsManager.cs @@ -441,6 +441,7 @@ namespace AssetStudio var subReader = new FileReader(dummyPath, stream, true); switch (subReader.FileType) { + case FileType.ENCRFile: case FileType.BundleFile: LoadBundleFile(subReader, reader.FullPath, offset, false); break; diff --git a/AssetStudio/FileReader.cs b/AssetStudio/FileReader.cs index c7865e4..23bba92 100644 --- a/AssetStudio/FileReader.cs +++ b/AssetStudio/FileReader.cs @@ -38,7 +38,6 @@ namespace AssetStudio Logger.Verbose($"Parsed signature is {signature}"); switch (signature) { - case "ENCR": case "UnityWeb": case "UnityRaw": case "UnityArchive": @@ -48,6 +47,8 @@ namespace AssetStudio return FileType.WebFile; case "blk": return FileType.BlkFile; + case "ENCR": + return FileType.ENCRFile; default: { Logger.Verbose("signature does not match any of the supported string signatures, attempting to check bytes signatures"); @@ -201,7 +202,7 @@ namespace AssetStudio break; } } - if (reader.FileType == FileType.BundleFile && game.Type.IsBlockFile() || reader.FileType == FileType.BlbFile) + if (reader.FileType == FileType.BundleFile && game.Type.IsBlockFile() || reader.FileType == FileType.ENCRFile || reader.FileType == FileType.BlbFile) { Logger.Verbose("File might have multiple bundles !!"); try @@ -211,9 +212,9 @@ namespace AssetStudio reader.ReadStringToNull(); reader.ReadStringToNull(); var size = reader.ReadInt64(); - if (!(signature == "UnityFS" && size == reader.BaseStream.Length)) + if (size != reader.BaseStream.Length) { - Logger.Verbose($"Found signature UnityFS, expected bundle size is 0x{size:X8}, found 0x{reader.BaseStream.Length} instead !!"); + Logger.Verbose($"Found signature {signature}, expected bundle size is 0x{size:X8}, found 0x{reader.BaseStream.Length} instead !!"); Logger.Verbose("Loading as block file !!"); reader.FileType = FileType.BlockFile; } diff --git a/AssetStudio/FileType.cs b/AssetStudio/FileType.cs index 7fd8620..5ba4321 100644 --- a/AssetStudio/FileType.cs +++ b/AssetStudio/FileType.cs @@ -18,6 +18,7 @@ namespace AssetStudio BlkFile, Mhy0File, BlbFile, + ENCRFile, BlockFile } } diff --git a/AssetStudio/OffsetStream.cs b/AssetStudio/OffsetStream.cs index 971d379..5073244 100644 --- a/AssetStudio/OffsetStream.cs +++ b/AssetStudio/OffsetStream.cs @@ -86,6 +86,7 @@ namespace AssetStudio FileType.BundleFile => "UnityFS\x00", FileType.BlbFile => "Blb\x02", FileType.Mhy0File => "mhy0", + FileType.ENCRFile => "ENCR\x00", _ => throw new InvalidOperationException() };