mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
parent
af3684bab8
commit
90ec395b2a
@ -123,7 +123,7 @@ namespace AssetStudio
|
|||||||
throw new NotSupportedException("Unsupported bundle file. UnityCN encryption was detected.");
|
throw new NotSupportedException("Unsupported bundle file. UnityCN encryption was detected.");
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadBlocksInfoAndDirectory(reader);
|
ReadBlocksInfoAndDirectory(reader, ver);
|
||||||
using (var blocksStream = CreateBlocksStream(reader.FullPath))
|
using (var blocksStream = CreateBlocksStream(reader.FullPath))
|
||||||
{
|
{
|
||||||
ReadBlocks(reader, blocksStream);
|
ReadBlocks(reader, blocksStream);
|
||||||
@ -258,13 +258,27 @@ namespace AssetStudio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReadBlocksInfoAndDirectory(EndianBinaryReader reader)
|
private void ReadBlocksInfoAndDirectory(EndianBinaryReader reader, int[] unityVer)
|
||||||
{
|
{
|
||||||
byte[] blocksInfoBytes;
|
byte[] blocksInfoBytes;
|
||||||
|
|
||||||
if (m_Header.version >= 7)
|
if (m_Header.version >= 7)
|
||||||
{
|
{
|
||||||
reader.AlignStream(16);
|
reader.AlignStream(16);
|
||||||
}
|
}
|
||||||
|
else if (unityVer[0] >= 2019 && unityVer[1] >= 4)
|
||||||
|
{
|
||||||
|
//check if we need to align the reader
|
||||||
|
//- align to 16 bytes and check if all are 0
|
||||||
|
//- if not, reset the reader to the previous position
|
||||||
|
var preAlign = reader.Position;
|
||||||
|
var alignData = reader.ReadBytes((16 - (int)(preAlign % 16)) % 16);
|
||||||
|
if (alignData.Any(x => x != 0))
|
||||||
|
{
|
||||||
|
reader.Position = preAlign;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ((m_Header.flags & ArchiveFlags.BlocksInfoAtTheEnd) != 0)
|
if ((m_Header.flags & ArchiveFlags.BlocksInfoAtTheEnd) != 0)
|
||||||
{
|
{
|
||||||
var position = reader.Position;
|
var position = reader.Position;
|
||||||
|
Loading…
Reference in New Issue
Block a user