fixed games handling
This commit is contained in:
@@ -8,7 +8,6 @@ namespace AssetStudio
|
|||||||
{
|
{
|
||||||
public class OffsetStream : Stream
|
public class OffsetStream : Stream
|
||||||
{
|
{
|
||||||
|
|
||||||
private readonly Stream _baseStream;
|
private readonly Stream _baseStream;
|
||||||
private long _offset;
|
private long _offset;
|
||||||
|
|
||||||
@@ -81,13 +80,26 @@ namespace AssetStudio
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
using var reader = new FileReader(path, this, true);
|
using var reader = new FileReader(path, this, true);
|
||||||
var signature = reader.FileType switch
|
|
||||||
|
var readSignature = reader.FileType;
|
||||||
|
var signature = "";
|
||||||
|
|
||||||
|
if (readSignature == FileType.BundleFile ||
|
||||||
|
readSignature == FileType.MhyFile ||
|
||||||
|
readSignature == FileType.Blb3File)
|
||||||
{
|
{
|
||||||
FileType.BundleFile => "UnityFS\x00",
|
switch (reader.FileType)
|
||||||
FileType.MhyFile => "mhy",
|
{
|
||||||
FileType.Blb3File => "Blb\x03",
|
case FileType.BundleFile:
|
||||||
_ => throw new InvalidOperationException()
|
signature = "UnityFS\x00";
|
||||||
};
|
break;
|
||||||
|
case FileType.MhyFile:
|
||||||
|
signature = "mhy";
|
||||||
|
break;
|
||||||
|
case FileType.Blb3File:
|
||||||
|
signature = "Blb\x03";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
Logger.Verbose($"Parsed signature: {signature}");
|
Logger.Verbose($"Parsed signature: {signature}");
|
||||||
|
|
||||||
@@ -109,6 +121,18 @@ namespace AssetStudio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
ArrayPool<byte>.Shared.Return(buffer);
|
ArrayPool<byte>.Shared.Return(buffer);
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
while (Remaining > 0)
|
||||||
|
{
|
||||||
|
Offset = AbsolutePosition;
|
||||||
|
yield return AbsolutePosition;
|
||||||
|
if (Offset == AbsolutePosition)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user