- [Core] fix bug with parsing bundles [SR]
This commit is contained in:
@@ -441,6 +441,7 @@ namespace AssetStudio
|
|||||||
var subReader = new FileReader(dummyPath, stream, true);
|
var subReader = new FileReader(dummyPath, stream, true);
|
||||||
switch (subReader.FileType)
|
switch (subReader.FileType)
|
||||||
{
|
{
|
||||||
|
case FileType.ENCRFile:
|
||||||
case FileType.BundleFile:
|
case FileType.BundleFile:
|
||||||
LoadBundleFile(subReader, reader.FullPath, offset, false);
|
LoadBundleFile(subReader, reader.FullPath, offset, false);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ namespace AssetStudio
|
|||||||
Logger.Verbose($"Parsed signature is {signature}");
|
Logger.Verbose($"Parsed signature is {signature}");
|
||||||
switch (signature)
|
switch (signature)
|
||||||
{
|
{
|
||||||
case "ENCR":
|
|
||||||
case "UnityWeb":
|
case "UnityWeb":
|
||||||
case "UnityRaw":
|
case "UnityRaw":
|
||||||
case "UnityArchive":
|
case "UnityArchive":
|
||||||
@@ -48,6 +47,8 @@ namespace AssetStudio
|
|||||||
return FileType.WebFile;
|
return FileType.WebFile;
|
||||||
case "blk":
|
case "blk":
|
||||||
return FileType.BlkFile;
|
return FileType.BlkFile;
|
||||||
|
case "ENCR":
|
||||||
|
return FileType.ENCRFile;
|
||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
Logger.Verbose("signature does not match any of the supported string signatures, attempting to check bytes signatures");
|
Logger.Verbose("signature does not match any of the supported string signatures, attempting to check bytes signatures");
|
||||||
@@ -201,7 +202,7 @@ namespace AssetStudio
|
|||||||
break;
|
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 !!");
|
Logger.Verbose("File might have multiple bundles !!");
|
||||||
try
|
try
|
||||||
@@ -211,9 +212,9 @@ namespace AssetStudio
|
|||||||
reader.ReadStringToNull();
|
reader.ReadStringToNull();
|
||||||
reader.ReadStringToNull();
|
reader.ReadStringToNull();
|
||||||
var size = reader.ReadInt64();
|
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 !!");
|
Logger.Verbose("Loading as block file !!");
|
||||||
reader.FileType = FileType.BlockFile;
|
reader.FileType = FileType.BlockFile;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ namespace AssetStudio
|
|||||||
BlkFile,
|
BlkFile,
|
||||||
Mhy0File,
|
Mhy0File,
|
||||||
BlbFile,
|
BlbFile,
|
||||||
|
ENCRFile,
|
||||||
BlockFile
|
BlockFile
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -86,6 +86,7 @@ namespace AssetStudio
|
|||||||
FileType.BundleFile => "UnityFS\x00",
|
FileType.BundleFile => "UnityFS\x00",
|
||||||
FileType.BlbFile => "Blb\x02",
|
FileType.BlbFile => "Blb\x02",
|
||||||
FileType.Mhy0File => "mhy0",
|
FileType.Mhy0File => "mhy0",
|
||||||
|
FileType.ENCRFile => "ENCR\x00",
|
||||||
_ => throw new InvalidOperationException()
|
_ => throw new InvalidOperationException()
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user