mirror of
https://github.com/aelurum/AssetStudio.git
synced 2025-05-25 05:40:21 -04:00
Add oodle compression support (unofficial)
This commit is contained in:
parent
66229e564a
commit
876bafdda1
@ -11,7 +11,7 @@ namespace AssetStudio.PInvoke
|
|||||||
{
|
{
|
||||||
public static void PreloadDll(string dllName)
|
public static void PreloadDll(string dllName)
|
||||||
{
|
{
|
||||||
var localPath = Process.GetCurrentProcess().MainModule.FileName;
|
var localPath = Process.GetCurrentProcess().MainModule?.FileName;
|
||||||
var localDir = Path.GetDirectoryName(localPath);
|
var localDir = Path.GetDirectoryName(localPath);
|
||||||
|
|
||||||
// Not using OperatingSystem.Platform.
|
// Not using OperatingSystem.Platform.
|
||||||
@ -35,7 +35,6 @@ namespace AssetStudio.PInvoke
|
|||||||
|
|
||||||
private static class Win32
|
private static class Win32
|
||||||
{
|
{
|
||||||
|
|
||||||
internal static void LoadDll(string dllDir, string dllName)
|
internal static void LoadDll(string dllDir, string dllName)
|
||||||
{
|
{
|
||||||
var dllFileName = $"{dllName}.dll";
|
var dllFileName = $"{dllName}.dll";
|
||||||
|
@ -16,6 +16,8 @@
|
|||||||
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
|
<PackageReference Include="System.IO.Compression" Version="4.3.0" />
|
||||||
<PackageReference Include="System.Text.Json" Version="9.0.0" />
|
<PackageReference Include="System.Text.Json" Version="9.0.0" />
|
||||||
<PackageReference Include="Microsoft.Bcl.Numerics" Version="9.0.1" />
|
<PackageReference Include="Microsoft.Bcl.Numerics" Version="9.0.1" />
|
||||||
|
|
||||||
|
<ProjectReference Include="..\AssetStudio.PInvoke\AssetStudio.PInvoke.csproj" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
@ -13,8 +13,9 @@ namespace AssetStudio
|
|||||||
{
|
{
|
||||||
public class AssetsManager
|
public class AssetsManager
|
||||||
{
|
{
|
||||||
public bool ZstdEnabled = true;
|
|
||||||
public bool LoadingViaTypeTreeEnabled = true;
|
public bool LoadingViaTypeTreeEnabled = true;
|
||||||
|
public CompressionType CustomBlockCompression = CompressionType.Auto;
|
||||||
|
public CompressionType CustomBlockInfoCompression = CompressionType.Auto;
|
||||||
public List<SerializedFile> assetsFileList = new List<SerializedFile>();
|
public List<SerializedFile> assetsFileList = new List<SerializedFile>();
|
||||||
|
|
||||||
internal Dictionary<string, int> assetsFileIndexCache = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
internal Dictionary<string, int> assetsFileIndexCache = new Dictionary<string, int>(StringComparer.OrdinalIgnoreCase);
|
||||||
@ -177,7 +178,10 @@ namespace AssetStudio
|
|||||||
|
|
||||||
private bool LoadFile(FileReader reader)
|
private bool LoadFile(FileReader reader)
|
||||||
{
|
{
|
||||||
switch (reader?.FileType)
|
if (reader == null)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
switch (reader.FileType)
|
||||||
{
|
{
|
||||||
case FileType.AssetsFile:
|
case FileType.AssetsFile:
|
||||||
return LoadAssetsFile(reader);
|
return LoadAssetsFile(reader);
|
||||||
@ -306,7 +310,7 @@ namespace AssetStudio
|
|||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var bundleFile = new BundleFile(bundleReader, ZstdEnabled, specifiedUnityVersion);
|
var bundleFile = new BundleFile(bundleReader, CustomBlockInfoCompression, CustomBlockCompression, specifiedUnityVersion);
|
||||||
var isLoaded = LoadBundleFiles(bundleReader, bundleFile, originalPath);
|
var isLoaded = LoadBundleFiles(bundleReader, bundleFile, originalPath);
|
||||||
if (!isLoaded)
|
if (!isLoaded)
|
||||||
return false;
|
return false;
|
||||||
@ -322,7 +326,7 @@ namespace AssetStudio
|
|||||||
bundleReader.FileName = $"{reader.FileName}_0x{bundleStream.Offset:X}";
|
bundleReader.FileName = $"{reader.FileName}_0x{bundleStream.Offset:X}";
|
||||||
}
|
}
|
||||||
Logger.Info($"[MultiBundle] Loading \"{reader.FileName}\" from offset: 0x{bundleStream.Offset:X}");
|
Logger.Info($"[MultiBundle] Loading \"{reader.FileName}\" from offset: 0x{bundleStream.Offset:X}");
|
||||||
bundleFile = new BundleFile(bundleReader, ZstdEnabled, specifiedUnityVersion);
|
bundleFile = new BundleFile(bundleReader, CustomBlockInfoCompression, CustomBlockCompression, specifiedUnityVersion);
|
||||||
isLoaded = LoadBundleFiles(bundleReader, bundleFile, originalPath ?? reader.FullPath);
|
isLoaded = LoadBundleFiles(bundleReader, bundleFile, originalPath ?? reader.FullPath);
|
||||||
}
|
}
|
||||||
return isLoaded;
|
return isLoaded;
|
||||||
|
43
AssetStudio/BundleCompression/Oodle/Oodle.cs
Normal file
43
AssetStudio/BundleCompression/Oodle/Oodle.cs
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
using System;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
using AssetStudio.PInvoke;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
namespace BundleCompression.Oodle
|
||||||
|
{
|
||||||
|
public static class OodleLZ
|
||||||
|
{
|
||||||
|
private const string LibName = "ooz";
|
||||||
|
|
||||||
|
#if NETFRAMEWORK
|
||||||
|
static OodleLZ()
|
||||||
|
{
|
||||||
|
DllLoader.PreloadDll(LibName);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
[DllImport(LibName)]
|
||||||
|
private static extern int Ooz_Decompress(
|
||||||
|
in byte srcBuffer,
|
||||||
|
UIntPtr srcLen,
|
||||||
|
ref byte dstBuffer,
|
||||||
|
UIntPtr dstLen,
|
||||||
|
int fuzzSafetyFlag,
|
||||||
|
int crcCheckFlag,
|
||||||
|
int logVerbosityFlag,
|
||||||
|
UIntPtr rawBuffer,
|
||||||
|
UIntPtr rawBufferSize,
|
||||||
|
UIntPtr chunkDecodeCallback,
|
||||||
|
UIntPtr chunkDecodeContext,
|
||||||
|
UIntPtr scratchBuf,
|
||||||
|
UIntPtr scratchBufSize,
|
||||||
|
int threadPhase);
|
||||||
|
|
||||||
|
public static int Decompress(ReadOnlySpan<byte> srcSpanBuffer, Span<byte> dstSpanBuffer)
|
||||||
|
{
|
||||||
|
return Ooz_Decompress(in srcSpanBuffer[0], (UIntPtr)srcSpanBuffer.Length, ref dstSpanBuffer[0], (UIntPtr)dstSpanBuffer.Length,
|
||||||
|
0, 0, 0, UIntPtr.Zero, UIntPtr.Zero, UIntPtr.Zero, UIntPtr.Zero, UIntPtr.Zero, UIntPtr.Zero, 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -2,12 +2,11 @@ using System;
|
|||||||
using System.IO;
|
using System.IO;
|
||||||
using SevenZip.Compression.LZMA;
|
using SevenZip.Compression.LZMA;
|
||||||
|
|
||||||
|
namespace BundleCompression.Lzma
|
||||||
namespace AssetStudio
|
|
||||||
{
|
{
|
||||||
public static class SevenZipHelper
|
public static class SevenZipLzma
|
||||||
{
|
{
|
||||||
public static MemoryStream StreamDecompress(MemoryStream inStream)
|
public static MemoryStream DecompressStream(MemoryStream inStream)
|
||||||
{
|
{
|
||||||
var decoder = new Decoder();
|
var decoder = new Decoder();
|
||||||
|
|
||||||
@ -34,7 +33,7 @@ namespace AssetStudio
|
|||||||
return newOutStream;
|
return newOutStream;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void StreamDecompress(Stream compressedStream, Stream decompressedStream, long compressedSize, long decompressedSize)
|
public static long DecompressStream(Stream compressedStream, Stream decompressedStream, long compressedSize, long decompressedSize)
|
||||||
{
|
{
|
||||||
var basePosition = compressedStream.Position;
|
var basePosition = compressedStream.Position;
|
||||||
var decoder = new Decoder();
|
var decoder = new Decoder();
|
||||||
@ -44,6 +43,7 @@ namespace AssetStudio
|
|||||||
decoder.SetDecoderProperties(properties);
|
decoder.SetDecoderProperties(properties);
|
||||||
decoder.Code(compressedStream, decompressedStream, compressedSize - 5, decompressedSize, null);
|
decoder.Code(compressedStream, decompressedStream, compressedSize - 5, decompressedSize, null);
|
||||||
compressedStream.Position = basePosition + compressedSize;
|
compressedStream.Position = basePosition + compressedSize;
|
||||||
|
return decompressedStream.Position;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
65
AssetStudio/BundleDecompressionHelper.cs
Normal file
65
AssetStudio/BundleDecompressionHelper.cs
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
using BundleCompression.Lzma;
|
||||||
|
using BundleCompression.Oodle;
|
||||||
|
using System;
|
||||||
|
using System.IO;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using K4os.Compression.LZ4;
|
||||||
|
using ZstdSharp;
|
||||||
|
|
||||||
|
namespace AssetStudio
|
||||||
|
{
|
||||||
|
public static class BundleDecompressionHelper
|
||||||
|
{
|
||||||
|
private static readonly Decompressor ZstdDecompressor = new Decompressor();
|
||||||
|
private static readonly string MsgPattern = @"\. ";
|
||||||
|
|
||||||
|
public static MemoryStream DecompressLzmaStream(MemoryStream inStream)
|
||||||
|
{
|
||||||
|
return SevenZipLzma.DecompressStream(inStream);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static long DecompressLzmaStream(Stream compressedStream, Stream decompressedStream, long compressedSize, long decompressedSize, ref string errorMsg)
|
||||||
|
{
|
||||||
|
var numWrite = -1L;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
numWrite = SevenZipLzma.DecompressStream(compressedStream, decompressedStream, compressedSize, decompressedSize);
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Debug(e.ToString());
|
||||||
|
errorMsg = $"({Regex.Split(e.Message, MsgPattern, RegexOptions.CultureInvariant)[0]})";
|
||||||
|
}
|
||||||
|
return numWrite;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int DecompressBlock(CompressionType type, ReadOnlySpan<byte> srcBuffer, Span<byte> dstBuffer, ref string errorMsg)
|
||||||
|
{
|
||||||
|
var numWrite = -1;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
switch (type)
|
||||||
|
{
|
||||||
|
case CompressionType.Lz4:
|
||||||
|
case CompressionType.Lz4HC:
|
||||||
|
numWrite = LZ4Codec.Decode(srcBuffer, dstBuffer);
|
||||||
|
break;
|
||||||
|
case CompressionType.Zstd:
|
||||||
|
numWrite = ZstdDecompressor.Unwrap(srcBuffer, dstBuffer);
|
||||||
|
break;
|
||||||
|
case CompressionType.Oodle:
|
||||||
|
numWrite = OodleLZ.Decompress(srcBuffer, dstBuffer);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
throw new NotSupportedException();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
Logger.Debug(e.ToString());
|
||||||
|
errorMsg = $"({Regex.Split(e.Message, MsgPattern, RegexOptions.CultureInvariant)[0]})";
|
||||||
|
}
|
||||||
|
return numWrite;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,6 +1,4 @@
|
|||||||
using K4os.Compression.LZ4;
|
using System;
|
||||||
using ZstdSharp;
|
|
||||||
using System;
|
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
|
|
||||||
@ -32,12 +30,14 @@ namespace AssetStudio
|
|||||||
|
|
||||||
public enum CompressionType
|
public enum CompressionType
|
||||||
{
|
{
|
||||||
|
Auto = -1,
|
||||||
None,
|
None,
|
||||||
Lzma,
|
Lzma,
|
||||||
Lz4,
|
Lz4,
|
||||||
Lz4HC,
|
Lz4HC,
|
||||||
Lzham,
|
Lzham,
|
||||||
Custom,
|
Zstd, //custom
|
||||||
|
Oodle, //custom
|
||||||
}
|
}
|
||||||
|
|
||||||
public class BundleFile
|
public class BundleFile
|
||||||
@ -77,7 +77,7 @@ namespace AssetStudio
|
|||||||
|
|
||||||
public StreamFile[] fileList;
|
public StreamFile[] fileList;
|
||||||
|
|
||||||
public BundleFile(FileReader reader, bool useZstd, UnityVersion specUnityVer = null)
|
public BundleFile(FileReader reader, CompressionType customBlockInfoCompression, CompressionType customBlockCompression, UnityVersion specUnityVer = null)
|
||||||
{
|
{
|
||||||
m_Header = new Header();
|
m_Header = new Header();
|
||||||
m_Header.signature = reader.ReadStringToNull();
|
m_Header.signature = reader.ReadStringToNull();
|
||||||
@ -152,10 +152,10 @@ namespace AssetStudio
|
|||||||
throw new NotSupportedException(msg);
|
throw new NotSupportedException(msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
ReadBlocksInfoAndDirectory(reader, unityVer);
|
ReadBlocksInfoAndDirectory(reader, customBlockInfoCompression, unityVer);
|
||||||
using (var blocksStream = CreateBlocksStream(reader.FullPath))
|
using (var blocksStream = CreateBlocksStream(reader.FullPath))
|
||||||
{
|
{
|
||||||
ReadBlocks(reader, blocksStream, useZstd);
|
ReadBlocks(reader, customBlockCompression, blocksStream);
|
||||||
ReadFiles(blocksStream, reader.FullPath);
|
ReadFiles(blocksStream, reader.FullPath);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -224,7 +224,7 @@ namespace AssetStudio
|
|||||||
{
|
{
|
||||||
using (var memoryStream = new MemoryStream(uncompressedBytes))
|
using (var memoryStream = new MemoryStream(uncompressedBytes))
|
||||||
{
|
{
|
||||||
using (var decompressStream = SevenZipHelper.StreamDecompress(memoryStream))
|
using (var decompressStream = BundleDecompressionHelper.DecompressLzmaStream(memoryStream))
|
||||||
{
|
{
|
||||||
uncompressedBytes = decompressStream.ToArray();
|
uncompressedBytes = decompressStream.ToArray();
|
||||||
}
|
}
|
||||||
@ -287,7 +287,7 @@ namespace AssetStudio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReadBlocksInfoAndDirectory(FileReader reader, UnityVersion unityVer)
|
private void ReadBlocksInfoAndDirectory(FileReader reader, CompressionType customBlockInfoCompression, UnityVersion unityVer, bool silent = false)
|
||||||
{
|
{
|
||||||
byte[] blocksInfoBytes;
|
byte[] blocksInfoBytes;
|
||||||
|
|
||||||
@ -308,52 +308,82 @@ namespace AssetStudio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var compressedSize = (int)m_Header.compressedBlocksInfoSize;
|
||||||
|
var uncompressedSize = (int)m_Header.uncompressedBlocksInfoSize;
|
||||||
if ((m_Header.flags & ArchiveFlags.BlocksInfoAtTheEnd) != 0)
|
if ((m_Header.flags & ArchiveFlags.BlocksInfoAtTheEnd) != 0)
|
||||||
{
|
{
|
||||||
var position = reader.Position;
|
var position = reader.Position;
|
||||||
reader.Position = m_Header.size - m_Header.compressedBlocksInfoSize;
|
reader.Position = m_Header.size - compressedSize;
|
||||||
blocksInfoBytes = reader.ReadBytes((int)m_Header.compressedBlocksInfoSize);
|
blocksInfoBytes = reader.ReadBytes(compressedSize);
|
||||||
reader.Position = position;
|
reader.Position = position;
|
||||||
}
|
}
|
||||||
else //0x40 BlocksAndDirectoryInfoCombined
|
else //0x40 BlocksAndDirectoryInfoCombined
|
||||||
{
|
{
|
||||||
blocksInfoBytes = reader.ReadBytes((int)m_Header.compressedBlocksInfoSize);
|
blocksInfoBytes = reader.ReadBytes(compressedSize);
|
||||||
}
|
}
|
||||||
MemoryStream blocksInfoUncompressedStream;
|
|
||||||
var uncompressedSize = m_Header.uncompressedBlocksInfoSize;
|
|
||||||
var compressionType = (CompressionType)(m_Header.flags & ArchiveFlags.CompressionTypeMask);
|
var compressionType = (CompressionType)(m_Header.flags & ArchiveFlags.CompressionTypeMask);
|
||||||
|
if (customBlockInfoCompression == CompressionType.Auto)
|
||||||
|
{
|
||||||
|
if (!silent && compressionType > CompressionType.Lzham && Enum.IsDefined(typeof(CompressionType), compressionType))
|
||||||
|
{
|
||||||
|
Logger.Warning($"Non-standard blockInfo compression type: {(int)compressionType}. Trying to decompress as {compressionType} archive..");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (compressionType != CompressionType.None)
|
||||||
|
{
|
||||||
|
compressionType = customBlockInfoCompression;
|
||||||
|
if (!silent)
|
||||||
|
{
|
||||||
|
Logger.Info($"Custom blockInfo compression type: {customBlockInfoCompression}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Logger.Debug($"BlockInfo compression: {compressionType}");
|
||||||
|
|
||||||
|
int numWrite;
|
||||||
|
var errorMsg = string.Empty;
|
||||||
|
MemoryStream blocksInfoUncompressedStream;
|
||||||
switch (compressionType)
|
switch (compressionType)
|
||||||
{
|
{
|
||||||
case CompressionType.None:
|
case CompressionType.None:
|
||||||
{
|
{
|
||||||
blocksInfoUncompressedStream = new MemoryStream(blocksInfoBytes);
|
blocksInfoUncompressedStream = new MemoryStream(blocksInfoBytes);
|
||||||
|
numWrite = compressedSize;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CompressionType.Lzma:
|
case CompressionType.Lzma:
|
||||||
{
|
{
|
||||||
blocksInfoUncompressedStream = new MemoryStream((int) (uncompressedSize));
|
blocksInfoUncompressedStream = new MemoryStream(uncompressedSize);
|
||||||
using (var blocksInfoCompressedStream = new MemoryStream(blocksInfoBytes))
|
using (var blocksInfoCompressedStream = new MemoryStream(blocksInfoBytes))
|
||||||
{
|
{
|
||||||
SevenZipHelper.StreamDecompress(blocksInfoCompressedStream, blocksInfoUncompressedStream,
|
numWrite = (int)BundleDecompressionHelper.DecompressLzmaStream(blocksInfoCompressedStream, blocksInfoUncompressedStream, compressedSize, uncompressedSize, ref errorMsg);
|
||||||
m_Header.compressedBlocksInfoSize, m_Header.uncompressedBlocksInfoSize);
|
|
||||||
}
|
}
|
||||||
blocksInfoUncompressedStream.Position = 0;
|
blocksInfoUncompressedStream.Position = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CompressionType.Lz4:
|
case CompressionType.Lz4:
|
||||||
case CompressionType.Lz4HC:
|
case CompressionType.Lz4HC:
|
||||||
|
case CompressionType.Zstd:
|
||||||
|
case CompressionType.Oodle:
|
||||||
{
|
{
|
||||||
var uncompressedBytes = new byte[uncompressedSize];
|
var uncompressedBytes = new byte[uncompressedSize];
|
||||||
var numWrite = LZ4Codec.Decode(blocksInfoBytes, uncompressedBytes);
|
numWrite = BundleDecompressionHelper.DecompressBlock(compressionType, blocksInfoBytes, uncompressedBytes, ref errorMsg);
|
||||||
if (numWrite != uncompressedSize)
|
|
||||||
{
|
|
||||||
throw new IOException($"Lz4 decompression error, write {numWrite} bytes but expected {uncompressedSize} bytes");
|
|
||||||
}
|
|
||||||
blocksInfoUncompressedStream = new MemoryStream(uncompressedBytes);
|
blocksInfoUncompressedStream = new MemoryStream(uncompressedBytes);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CompressionType.Lzham:
|
||||||
|
throw new IOException($"Unsupported blockInfo compression type: {compressionType}.\n");
|
||||||
default:
|
default:
|
||||||
throw new IOException($"Unsupported block info compression type {compressionType}");
|
throw new IOException($"Unknown blockInfo compression type: {compressionType}.\nYou may try to specify the compression type manually.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numWrite != uncompressedSize)
|
||||||
|
{
|
||||||
|
var msg = $"{compressionType} blockInfo decompression error. {errorMsg}\nWrite {numWrite} bytes but expected {uncompressedSize} bytes.";
|
||||||
|
var exMsg = compressionType > CompressionType.Lz4HC
|
||||||
|
? "Wrong compression type or blockInfo data might be encrypted."
|
||||||
|
: "BlockInfo data might be encrypted.";
|
||||||
|
throw new IOException($"{msg}\n{exMsg}\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
using (var blocksInfoReader = new EndianBinaryReader(blocksInfoUncompressedStream))
|
using (var blocksInfoReader = new EndianBinaryReader(blocksInfoUncompressedStream))
|
||||||
@ -390,62 +420,65 @@ namespace AssetStudio
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ReadBlocks(FileReader reader, Stream blocksStream, bool useZstd)
|
private void ReadBlocks(FileReader reader, CompressionType customBlockCompression, Stream blocksStream)
|
||||||
{
|
{
|
||||||
var zstdCodec = new Decompressor();
|
var showCustomTypeWarning = true;
|
||||||
var i = 0;
|
|
||||||
foreach (var blockInfo in m_BlocksInfo)
|
foreach (var blockInfo in m_BlocksInfo)
|
||||||
{
|
{
|
||||||
var compressionType = (CompressionType)(blockInfo.flags & StorageBlockFlags.CompressionTypeMask);
|
var compressionType = (CompressionType)(blockInfo.flags & StorageBlockFlags.CompressionTypeMask);
|
||||||
|
if (customBlockCompression == CompressionType.Auto)
|
||||||
|
{
|
||||||
|
if (showCustomTypeWarning && compressionType > CompressionType.Lzham && Enum.IsDefined(typeof(CompressionType), compressionType))
|
||||||
|
{
|
||||||
|
Logger.Warning($"Non-standard block compression type: {(int)compressionType}. Trying to decompress as {compressionType} archive..");
|
||||||
|
showCustomTypeWarning = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (compressionType != CompressionType.None)
|
||||||
|
{
|
||||||
|
compressionType = customBlockCompression;
|
||||||
|
if (showCustomTypeWarning)
|
||||||
|
{
|
||||||
|
Logger.Info($"Custom block compression type: {customBlockCompression}");
|
||||||
|
showCustomTypeWarning = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Logger.Debug($"Block compression: {compressionType}");
|
||||||
|
|
||||||
|
long numWrite;
|
||||||
|
var errorMsg = string.Empty;
|
||||||
switch (compressionType)
|
switch (compressionType)
|
||||||
{
|
{
|
||||||
case CompressionType.None:
|
case CompressionType.None:
|
||||||
{
|
{
|
||||||
reader.BaseStream.CopyTo(blocksStream, blockInfo.compressedSize);
|
reader.BaseStream.CopyTo(blocksStream, blockInfo.compressedSize);
|
||||||
|
numWrite = blockInfo.compressedSize;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CompressionType.Lzma:
|
case CompressionType.Lzma:
|
||||||
{
|
{
|
||||||
SevenZipHelper.StreamDecompress(reader.BaseStream, blocksStream, blockInfo.compressedSize, blockInfo.uncompressedSize);
|
numWrite = BundleDecompressionHelper.DecompressLzmaStream(reader.BaseStream, blocksStream, blockInfo.compressedSize, blockInfo.uncompressedSize, ref errorMsg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case CompressionType.Lz4:
|
case CompressionType.Lz4:
|
||||||
case CompressionType.Lz4HC:
|
case CompressionType.Lz4HC:
|
||||||
case CompressionType.Custom:
|
case CompressionType.Zstd:
|
||||||
|
case CompressionType.Oodle:
|
||||||
{
|
{
|
||||||
var compressedSize = (int)blockInfo.compressedSize;
|
var compressedSize = (int)blockInfo.compressedSize;
|
||||||
var compressedBytes = BigArrayPool<byte>.Shared.Rent(compressedSize);
|
|
||||||
_ = reader.Read(compressedBytes, 0, compressedSize);
|
|
||||||
var uncompressedSize = (int)blockInfo.uncompressedSize;
|
var uncompressedSize = (int)blockInfo.uncompressedSize;
|
||||||
|
|
||||||
|
var compressedBytes = BigArrayPool<byte>.Shared.Rent(compressedSize);
|
||||||
var uncompressedBytes = BigArrayPool<byte>.Shared.Rent(uncompressedSize);
|
var uncompressedBytes = BigArrayPool<byte>.Shared.Rent(uncompressedSize);
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
var compTypeStr = compressionType.ToString();
|
_ = reader.Read(compressedBytes, 0, compressedSize);
|
||||||
if (compressionType == CompressionType.Custom)
|
var compressedSpan = new ReadOnlySpan<byte>(compressedBytes, 0, compressedSize);
|
||||||
{
|
var uncompressedSpan = new Span<byte>(uncompressedBytes, 0, uncompressedSize);
|
||||||
compTypeStr = useZstd ? "Zstd" : "Lz4";
|
|
||||||
if (i == 0)
|
|
||||||
{
|
|
||||||
Logger.Debug($"Custom block compression type was detected. Trying to decompress as {compTypeStr} archive..");
|
|
||||||
i++;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int numWrite;
|
numWrite = BundleDecompressionHelper.DecompressBlock(compressionType, compressedSpan, uncompressedSpan, ref errorMsg);
|
||||||
if (compressionType == CompressionType.Custom && useZstd)
|
if (numWrite == uncompressedSize)
|
||||||
{
|
blocksStream.Write(uncompressedBytes, 0, uncompressedSize);
|
||||||
numWrite = zstdCodec.Unwrap(compressedBytes, 0, compressedSize, uncompressedBytes, 0, uncompressedSize);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
numWrite = LZ4Codec.Decode(compressedBytes, 0, compressedSize, uncompressedBytes, 0, uncompressedSize);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (numWrite != uncompressedSize)
|
|
||||||
{
|
|
||||||
throw new IOException($"{compTypeStr} block decompression error, write {numWrite} bytes but expected {uncompressedSize} bytes");
|
|
||||||
}
|
|
||||||
blocksStream.Write(uncompressedBytes, 0, uncompressedSize);
|
|
||||||
}
|
}
|
||||||
finally
|
finally
|
||||||
{
|
{
|
||||||
@ -454,8 +487,19 @@ namespace AssetStudio
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case CompressionType.Lzham:
|
||||||
|
throw new IOException($"Unsupported block compression type: {compressionType}.\n");
|
||||||
default:
|
default:
|
||||||
throw new IOException($"Unsupported block compression type {compressionType}");
|
throw new IOException($"Unknown block compression type: {compressionType}.\nYou may try to specify the compression type manually.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (numWrite != blockInfo.uncompressedSize)
|
||||||
|
{
|
||||||
|
var msg = $"{compressionType} block decompression error. {errorMsg}\nWrite {numWrite} bytes but expected {blockInfo.uncompressedSize} bytes.";
|
||||||
|
var exMsg = compressionType > CompressionType.Lz4HC
|
||||||
|
? "Wrong compression type or block data might be encrypted."
|
||||||
|
: "Block data might be encrypted.";
|
||||||
|
throw new IOException($"{msg}\n{exMsg}\n");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
blocksStream.Position = 0;
|
blocksStream.Position = 0;
|
||||||
|
@ -30,6 +30,8 @@
|
|||||||
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\x64\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)runtimes\win-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\x64\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\win-x86\fmod.dll" DestinationFolder="$(TargetDir)runtimes\win-x86\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\win-x86\fmod.dll" DestinationFolder="$(TargetDir)runtimes\win-x86\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\win-x64\fmod.dll" DestinationFolder="$(TargetDir)runtimes\win-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\win-x64\fmod.dll" DestinationFolder="$(TargetDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\win-x86\ooz.dll" DestinationFolder="$(TargetDir)runtimes\win-x86\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\win-x64\ooz.dll" DestinationFolder="$(TargetDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="CopyExtraFilesPortableNet" AfterTargets="AfterBuild" Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFramework)' != 'net472' ">
|
<Target Name="CopyExtraFilesPortableNet" AfterTargets="AfterBuild" Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFramework)' != 'net472' ">
|
||||||
@ -37,12 +39,20 @@
|
|||||||
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x64\libAssetStudioFBXNative.so" DestinationFolder="$(TargetDir)runtimes\linux-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x64\libAssetStudioFBXNative.so" DestinationFolder="$(TargetDir)runtimes\linux-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\osx-x64\libAssetStudioFBXNative.dylib" DestinationFolder="$(TargetDir)runtimes\osx-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\osx-x64\libAssetStudioFBXNative.dylib" DestinationFolder="$(TargetDir)runtimes\osx-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\osx-arm64\libAssetStudioFBXNative.dylib" DestinationFolder="$(TargetDir)runtimes\osx-arm64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\osx-arm64\libAssetStudioFBXNative.dylib" DestinationFolder="$(TargetDir)runtimes\osx-arm64\native" ContinueOnError="false" />
|
||||||
|
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x86\libfmod.so" DestinationFolder="$(TargetDir)runtimes\linux-x86\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x86\libfmod.so" DestinationFolder="$(TargetDir)runtimes\linux-x86\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x64\libfmod.so" DestinationFolder="$(TargetDir)runtimes\linux-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x64\libfmod.so" DestinationFolder="$(TargetDir)runtimes\linux-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\linux-arm64\libfmod.so" DestinationFolder="$(TargetDir)runtimes\linux-arm64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-arm64\libfmod.so" DestinationFolder="$(TargetDir)runtimes\linux-arm64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\osx-x64\libfmod.dylib" DestinationFolder="$(TargetDir)runtimes\osx-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\osx-x64\libfmod.dylib" DestinationFolder="$(TargetDir)runtimes\osx-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\osx-arm64\libfmod.dylib" DestinationFolder="$(TargetDir)runtimes\osx-arm64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\osx-arm64\libfmod.dylib" DestinationFolder="$(TargetDir)runtimes\osx-arm64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\win-arm64\fmod.dll" DestinationFolder="$(TargetDir)runtimes\win-arm64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\win-arm64\fmod.dll" DestinationFolder="$(TargetDir)runtimes\win-arm64\native" ContinueOnError="false" />
|
||||||
|
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x86\libooz.so" DestinationFolder="$(TargetDir)runtimes\linux-x86\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x64\libooz.so" DestinationFolder="$(TargetDir)runtimes\linux-x64\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-arm64\libooz.so" DestinationFolder="$(TargetDir)runtimes\linux-arm64\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\osx-x64\libooz.dylib" DestinationFolder="$(TargetDir)runtimes\osx-x64\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\osx-arm64\libooz.dylib" DestinationFolder="$(TargetDir)runtimes\osx-arm64\native" ContinueOnError="false" />
|
||||||
|
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\linux-arm64\libTexture2DDecoderNative.so" DestinationFolder="$(TargetDir)runtimes\linux-arm64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-arm64\libTexture2DDecoderNative.so" DestinationFolder="$(TargetDir)runtimes\linux-arm64\native" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
@ -56,6 +66,8 @@
|
|||||||
<Copy SourceFiles="$(TargetDir)runtimes\win-x64\native\Texture2DDecoderNative.dll" DestinationFolder="$(PublishDir)runtimes\win-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\win-x64\native\Texture2DDecoderNative.dll" DestinationFolder="$(PublishDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\win-x86\native\fmod.dll" DestinationFolder="$(PublishDir)runtimes\win-x86\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\win-x86\native\fmod.dll" DestinationFolder="$(PublishDir)runtimes\win-x86\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\win-x64\native\fmod.dll" DestinationFolder="$(PublishDir)runtimes\win-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\win-x64\native\fmod.dll" DestinationFolder="$(PublishDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)runtimes\win-x86\native\ooz.dll" DestinationFolder="$(PublishDir)runtimes\win-x86\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)runtimes\win-x64\native\ooz.dll" DestinationFolder="$(PublishDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="PublishExtraFilesPortableNet" AfterTargets="Publish" Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFramework)' != 'net472' ">
|
<Target Name="PublishExtraFilesPortableNet" AfterTargets="Publish" Condition=" '$(RuntimeIdentifier)' == '' AND '$(TargetFramework)' != 'net472' ">
|
||||||
@ -63,12 +75,20 @@
|
|||||||
<Copy SourceFiles="$(TargetDir)runtimes\linux-x64\native\libAssetStudioFBXNative.so" DestinationFolder="$(PublishDir)runtimes\linux-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\linux-x64\native\libAssetStudioFBXNative.so" DestinationFolder="$(PublishDir)runtimes\linux-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\osx-x64\native\libAssetStudioFBXNative.dylib" DestinationFolder="$(PublishDir)runtimes\osx-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\osx-x64\native\libAssetStudioFBXNative.dylib" DestinationFolder="$(PublishDir)runtimes\osx-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\osx-arm64\native\libAssetStudioFBXNative.dylib" DestinationFolder="$(PublishDir)runtimes\osx-arm64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\osx-arm64\native\libAssetStudioFBXNative.dylib" DestinationFolder="$(PublishDir)runtimes\osx-arm64\native" ContinueOnError="false" />
|
||||||
|
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\linux-x86\native\libfmod.so" DestinationFolder="$(PublishDir)runtimes\linux-x86\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\linux-x86\native\libfmod.so" DestinationFolder="$(PublishDir)runtimes\linux-x86\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\linux-x64\native\libfmod.so" DestinationFolder="$(PublishDir)runtimes\linux-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\linux-x64\native\libfmod.so" DestinationFolder="$(PublishDir)runtimes\linux-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\linux-arm64\native\libfmod.so" DestinationFolder="$(PublishDir)runtimes\linux-arm64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\linux-arm64\native\libfmod.so" DestinationFolder="$(PublishDir)runtimes\linux-arm64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\osx-x64\native\libfmod.dylib" DestinationFolder="$(PublishDir)runtimes\osx-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\osx-x64\native\libfmod.dylib" DestinationFolder="$(PublishDir)runtimes\osx-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\osx-arm64\native\libfmod.dylib" DestinationFolder="$(PublishDir)runtimes\osx-arm64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\osx-arm64\native\libfmod.dylib" DestinationFolder="$(PublishDir)runtimes\osx-arm64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\win-arm64\native\fmod.dll" DestinationFolder="$(PublishDir)runtimes\win-arm64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\win-arm64\native\fmod.dll" DestinationFolder="$(PublishDir)runtimes\win-arm64\native" ContinueOnError="false" />
|
||||||
|
|
||||||
|
<Copy SourceFiles="$(TargetDir)runtimes\linux-x86\native\libooz.so" DestinationFolder="$(PublishDir)runtimes\linux-x86\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)runtimes\linux-x64\native\libooz.so" DestinationFolder="$(PublishDir)runtimes\linux-x64\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)runtimes\linux-arm64\native\libooz.so" DestinationFolder="$(PublishDir)runtimes\linux-arm64\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)runtimes\osx-x64\native\libooz.dylib" DestinationFolder="$(PublishDir)runtimes\osx-x64\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)runtimes\osx-arm64\native\libooz.dylib" DestinationFolder="$(PublishDir)runtimes\osx-arm64\native" ContinueOnError="false" />
|
||||||
|
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\linux-arm64\native\libTexture2DDecoderNative.so" DestinationFolder="$(PublishDir)runtimes\linux-arm64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\linux-arm64\native\libTexture2DDecoderNative.so" DestinationFolder="$(PublishDir)runtimes\linux-arm64\native" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
@ -77,6 +97,7 @@
|
|||||||
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\Win32\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\Win32\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\Win32\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\Win32\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\win-x86\fmod.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\win-x86\fmod.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\win-x86\ooz.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="CopyExtraFilesWin64" AfterTargets="AfterBuild" Condition=" '$(RuntimeIdentifier)' == 'win-x64' ">
|
<Target Name="CopyExtraFilesWin64" AfterTargets="AfterBuild" Condition=" '$(RuntimeIdentifier)' == 'win-x64' ">
|
||||||
@ -84,6 +105,7 @@
|
|||||||
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\x64\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\x64\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\win-x64\fmod.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\win-x64\fmod.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\win-x64\ooz.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="PublishExtraFilesWin" AfterTargets="Publish" Condition=" $(RuntimeIdentifier.Contains('win-x')) ">
|
<Target Name="PublishExtraFilesWin" AfterTargets="Publish" Condition=" $(RuntimeIdentifier.Contains('win-x')) ">
|
||||||
@ -91,6 +113,7 @@
|
|||||||
<Copy SourceFiles="$(TargetDir)\AssetStudioFBXNative.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\AssetStudioFBXNative.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)\Texture2DDecoderNative.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\Texture2DDecoderNative.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)\fmod.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\fmod.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)\ooz.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="CopyExtraFilesWinArm64" AfterTargets="AfterBuild" Condition=" '$(RuntimeIdentifier)' == 'win-arm64' ">
|
<Target Name="CopyExtraFilesWinArm64" AfterTargets="AfterBuild" Condition=" '$(RuntimeIdentifier)' == 'win-arm64' ">
|
||||||
@ -107,36 +130,42 @@
|
|||||||
<Message Text="Copying extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
<Message Text="Copying extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x64\libAssetStudioFBXNative.so" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x64\libAssetStudioFBXNative.so" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x64\libfmod.so" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x64\libfmod.so" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-x64\libooz.so" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="PublishExtraFilesLinux64" AfterTargets="Publish" Condition=" '$(RuntimeIdentifier)' == 'linux-x64' ">
|
<Target Name="PublishExtraFilesLinux64" AfterTargets="Publish" Condition=" '$(RuntimeIdentifier)' == 'linux-x64' ">
|
||||||
<Message Text="Publishing extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
<Message Text="Publishing extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
||||||
<Copy SourceFiles="$(TargetDir)\libAssetStudioFBXNative.so" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\libAssetStudioFBXNative.so" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)\libfmod.so" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\libfmod.so" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)\libooz.so" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="CopyExtraFilesLinuxArm64" AfterTargets="AfterBuild" Condition=" '$(RuntimeIdentifier)' == 'linux-arm64' ">
|
<Target Name="CopyExtraFilesLinuxArm64" AfterTargets="AfterBuild" Condition=" '$(RuntimeIdentifier)' == 'linux-arm64' ">
|
||||||
<Message Text="Copying extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
<Message Text="Copying extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\linux-arm64\libTexture2DDecoderNative.so" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-arm64\libTexture2DDecoderNative.so" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\linux-arm64\libfmod.so" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-arm64\libfmod.so" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\linux-arm64\libooz.so" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="PublishExtraFilesLinuxArm64" AfterTargets="Publish" Condition=" '$(RuntimeIdentifier)' == 'linux-arm64' ">
|
<Target Name="PublishExtraFilesLinuxArm64" AfterTargets="Publish" Condition=" '$(RuntimeIdentifier)' == 'linux-arm64' ">
|
||||||
<Message Text="Publishing extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
<Message Text="Publishing extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
||||||
<Copy SourceFiles="$(TargetDir)\libTexture2DDecoderNative.so" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\libTexture2DDecoderNative.so" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)\libfmod.so" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\libfmod.so" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)\libooz.so" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="CopyExtraFilesMac" AfterTargets="AfterBuild" Condition=" $(RuntimeIdentifier.Contains('osx-')) ">
|
<Target Name="CopyExtraFilesMac" AfterTargets="AfterBuild" Condition=" $(RuntimeIdentifier.Contains('osx-')) ">
|
||||||
<Message Text="Copying extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
<Message Text="Copying extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\$(RuntimeIdentifier)\libAssetStudioFBXNative.dylib" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\$(RuntimeIdentifier)\libAssetStudioFBXNative.dylib" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\$(RuntimeIdentifier)\libfmod.dylib" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\$(RuntimeIdentifier)\libfmod.dylib" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\$(RuntimeIdentifier)\libooz.dylib" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="PublishExtraFilesMac" AfterTargets="Publish" Condition=" $(RuntimeIdentifier.Contains('osx-')) ">
|
<Target Name="PublishExtraFilesMac" AfterTargets="Publish" Condition=" $(RuntimeIdentifier.Contains('osx-')) ">
|
||||||
<Message Text="Publishing extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
<Message Text="Publishing extra files for $(RuntimeIdentifier)($(TargetFramework))... " Importance="high" />
|
||||||
<Copy SourceFiles="$(TargetDir)\libAssetStudioFBXNative.dylib" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\libAssetStudioFBXNative.dylib" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)\libfmod.dylib" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\libfmod.dylib" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)\libooz.dylib" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
BIN
AssetStudioCLI/Libraries/linux-arm64/libooz.so
Normal file
BIN
AssetStudioCLI/Libraries/linux-arm64/libooz.so
Normal file
Binary file not shown.
BIN
AssetStudioCLI/Libraries/linux-x64/libooz.so
Normal file
BIN
AssetStudioCLI/Libraries/linux-x64/libooz.so
Normal file
Binary file not shown.
BIN
AssetStudioCLI/Libraries/linux-x86/libooz.so
Normal file
BIN
AssetStudioCLI/Libraries/linux-x86/libooz.so
Normal file
Binary file not shown.
BIN
AssetStudioCLI/Libraries/osx-arm64/libooz.dylib
Normal file
BIN
AssetStudioCLI/Libraries/osx-arm64/libooz.dylib
Normal file
Binary file not shown.
BIN
AssetStudioCLI/Libraries/osx-x64/libooz.dylib
Normal file
BIN
AssetStudioCLI/Libraries/osx-x64/libooz.dylib
Normal file
Binary file not shown.
BIN
AssetStudioCLI/Libraries/win-x64/ooz.dll
Normal file
BIN
AssetStudioCLI/Libraries/win-x64/ooz.dll
Normal file
Binary file not shown.
BIN
AssetStudioCLI/Libraries/win-x86/ooz.dll
Normal file
BIN
AssetStudioCLI/Libraries/win-x86/ooz.dll
Normal file
Binary file not shown.
@ -68,12 +68,6 @@ namespace AssetStudioCLI.Options
|
|||||||
NameAndContainer,
|
NameAndContainer,
|
||||||
}
|
}
|
||||||
|
|
||||||
internal enum CustomCompressionType
|
|
||||||
{
|
|
||||||
Zstd,
|
|
||||||
Lz4,
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static class CLIOptions
|
internal static class CLIOptions
|
||||||
{
|
{
|
||||||
public static bool isParsed;
|
public static bool isParsed;
|
||||||
@ -115,7 +109,8 @@ namespace AssetStudioCLI.Options
|
|||||||
public static Option<List<string>> o_filterByPathID;
|
public static Option<List<string>> o_filterByPathID;
|
||||||
public static Option<List<string>> o_filterByText;
|
public static Option<List<string>> o_filterByText;
|
||||||
//advanced
|
//advanced
|
||||||
public static Option<CustomCompressionType> o_customCompressionType;
|
public static Option<CompressionType> o_bundleBlockInfoCompression;
|
||||||
|
public static Option<CompressionType> o_bundleBlockCompression;
|
||||||
public static Option<int> o_maxParallelExportTasks;
|
public static Option<int> o_maxParallelExportTasks;
|
||||||
public static Option<ExportListType> o_exportAssetList;
|
public static Option<ExportListType> o_exportAssetList;
|
||||||
public static Option<string> o_assemblyPath;
|
public static Option<string> o_assemblyPath;
|
||||||
@ -425,15 +420,33 @@ namespace AssetStudioCLI.Options
|
|||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region Init Advanced Options
|
#region Init Advanced Options
|
||||||
o_customCompressionType = new GroupedOption<CustomCompressionType>
|
o_bundleBlockInfoCompression = new GroupedOption<CompressionType>
|
||||||
(
|
(
|
||||||
optionDefaultValue: CustomCompressionType.Zstd,
|
optionDefaultValue: CompressionType.Auto,
|
||||||
optionName: "--custom-compression <value>",
|
optionName: "--blockinfo-comp <value>",
|
||||||
optionDescription: "Specify the compression type for assets that use custom compression\n" +
|
optionDescription: "Specify the compression type of bundle's blockInfo data\n" +
|
||||||
"<Value: zstd(default) | lz4>\n" +
|
"<Value: auto(default) | zstd | oodle | lz4 | lzma>\n" +
|
||||||
|
"Auto - Use compression type specified in an asset bundle\n" +
|
||||||
"Zstd - Try to decompress as zstd archive\n" +
|
"Zstd - Try to decompress as zstd archive\n" +
|
||||||
"Lz4 - Try to decompress as lz4 archive\n",
|
"Oodle - Try to decompress as oodle archive\n" +
|
||||||
optionExample: "Example: \"--custom-compression lz4\"\n",
|
"Lz4 - Try to decompress as lz4/lz4hc archive\n" +
|
||||||
|
"Lzma - Try to decompress as lzma archive\n",
|
||||||
|
optionExample: "Example: \"--blockinfo-comp lz4\"\n",
|
||||||
|
optionHelpGroup: HelpGroups.Advanced
|
||||||
|
);
|
||||||
|
|
||||||
|
o_bundleBlockCompression = new GroupedOption<CompressionType>
|
||||||
|
(
|
||||||
|
optionDefaultValue: CompressionType.Auto,
|
||||||
|
optionName: "--block-comp <value>",
|
||||||
|
optionDescription: "Specify the compression type of bundle's block data\n" +
|
||||||
|
"<Value: auto(default) | zstd | oodle | lz4 | lzma>\n" +
|
||||||
|
"Auto - Use compression type specified in an asset bundle\n" +
|
||||||
|
"Zstd - Try to decompress as zstd archive\n" +
|
||||||
|
"Oodle - Try to decompress as oodle archive\n" +
|
||||||
|
"Lz4 - Try to decompress as lz4/lz4hc archive\n" +
|
||||||
|
"Lzma - Try to decompress as lzma archive\n",
|
||||||
|
optionExample: "Example: \"--block-comp zstd\"\n",
|
||||||
optionHelpGroup: HelpGroups.Advanced
|
optionHelpGroup: HelpGroups.Advanced
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -975,19 +988,53 @@ namespace AssetStudioCLI.Options
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "--custom-compression":
|
case "--blockinfo-comp":
|
||||||
switch (value.ToLower())
|
switch (value.ToLower())
|
||||||
{
|
{
|
||||||
|
case "auto":
|
||||||
|
o_bundleBlockInfoCompression.Value = CompressionType.Zstd;
|
||||||
|
break;
|
||||||
case "zstd":
|
case "zstd":
|
||||||
o_customCompressionType.Value = CustomCompressionType.Zstd;
|
o_bundleBlockInfoCompression.Value = CompressionType.Zstd;
|
||||||
|
break;
|
||||||
|
case "oodle":
|
||||||
|
o_bundleBlockInfoCompression.Value = CompressionType.Oodle;
|
||||||
break;
|
break;
|
||||||
case "lz4":
|
case "lz4":
|
||||||
case "lz4hc":
|
case "lz4hc":
|
||||||
o_customCompressionType.Value = CustomCompressionType.Lz4;
|
o_bundleBlockInfoCompression.Value = CompressionType.Lz4HC;
|
||||||
|
break;
|
||||||
|
case "lzma":
|
||||||
|
o_bundleBlockInfoCompression.Value = CompressionType.Lzma;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
Console.WriteLine($"{"Error".Color(brightRed)} during parsing [{option.Color(brightYellow)}] option. Unsupported compression type: [{value.Color(brightRed)}].\n");
|
Console.WriteLine($"{"Error".Color(brightRed)} during parsing [{option.Color(brightYellow)}] option. Unsupported compression type: [{value.Color(brightRed)}].\n");
|
||||||
ShowOptionDescription(o_customCompressionType);
|
ShowOptionDescription(o_bundleBlockInfoCompression);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "--block-comp":
|
||||||
|
switch (value.ToLower())
|
||||||
|
{
|
||||||
|
case "auto":
|
||||||
|
o_bundleBlockCompression.Value = CompressionType.Zstd;
|
||||||
|
break;
|
||||||
|
case "zstd":
|
||||||
|
o_bundleBlockCompression.Value = CompressionType.Zstd;
|
||||||
|
break;
|
||||||
|
case "oodle":
|
||||||
|
o_bundleBlockCompression.Value = CompressionType.Oodle;
|
||||||
|
break;
|
||||||
|
case "lz4":
|
||||||
|
case "lz4hc":
|
||||||
|
o_bundleBlockCompression.Value = CompressionType.Lz4HC;
|
||||||
|
break;
|
||||||
|
case "lzma":
|
||||||
|
o_bundleBlockCompression.Value = CompressionType.Lzma;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
Console.WriteLine($"{"Error".Color(brightRed)} during parsing [{option.Color(brightYellow)}] option. Unsupported compression type: [{value.Color(brightRed)}].\n");
|
||||||
|
ShowOptionDescription(o_bundleBlockCompression);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1235,10 +1282,6 @@ namespace AssetStudioCLI.Options
|
|||||||
var sb = new StringBuilder();
|
var sb = new StringBuilder();
|
||||||
sb.AppendLine("[Current Options]");
|
sb.AppendLine("[Current Options]");
|
||||||
sb.AppendLine($"# Working Mode: {o_workMode}");
|
sb.AppendLine($"# Working Mode: {o_workMode}");
|
||||||
if (o_customCompressionType.Value != o_customCompressionType.DefaultValue)
|
|
||||||
{
|
|
||||||
sb.AppendLine($"# Custom Compression Type: {o_customCompressionType}");
|
|
||||||
}
|
|
||||||
if (o_workMode.Value != WorkMode.Extract)
|
if (o_workMode.Value != WorkMode.Extract)
|
||||||
{
|
{
|
||||||
sb.AppendLine($"# Parse Assets Using TypeTree: {!f_avoidLoadingViaTypetree.Value}");
|
sb.AppendLine($"# Parse Assets Using TypeTree: {!f_avoidLoadingViaTypetree.Value}");
|
||||||
@ -1248,6 +1291,8 @@ namespace AssetStudioCLI.Options
|
|||||||
{
|
{
|
||||||
sb.AppendLine($"# Output Path: \"{o_outputFolder}\"");
|
sb.AppendLine($"# Output Path: \"{o_outputFolder}\"");
|
||||||
}
|
}
|
||||||
|
sb.AppendLine($"Bundle BlockInfo Compression Type: {o_bundleBlockInfoCompression}");
|
||||||
|
sb.AppendLine($"Bundle Block Compression Type: {o_bundleBlockCompression}");
|
||||||
switch (o_workMode.Value)
|
switch (o_workMode.Value)
|
||||||
{
|
{
|
||||||
case WorkMode.Export:
|
case WorkMode.Export:
|
||||||
|
@ -92,7 +92,7 @@ namespace AssetStudioCLI
|
|||||||
var count = 0;
|
var count = 0;
|
||||||
var bundleStream = new OffsetStream(reader);
|
var bundleStream = new OffsetStream(reader);
|
||||||
var bundleReader = new FileReader(reader.FullPath, bundleStream);
|
var bundleReader = new FileReader(reader.FullPath, bundleStream);
|
||||||
var bundleFile = new BundleFile(bundleReader, assetsManager.ZstdEnabled, assetsManager.SpecifyUnityVersion);
|
var bundleFile = new BundleFile(bundleReader, assetsManager.CustomBlockInfoCompression, assetsManager.CustomBlockCompression, assetsManager.SpecifyUnityVersion);
|
||||||
var extractPath = Path.Combine(savePath, reader.FileName + "_unpacked");
|
var extractPath = Path.Combine(savePath, reader.FileName + "_unpacked");
|
||||||
if (bundleFile.fileList.Length > 0)
|
if (bundleFile.fileList.Length > 0)
|
||||||
{
|
{
|
||||||
@ -109,7 +109,7 @@ namespace AssetStudioCLI
|
|||||||
bundleReader.FileName = $"{reader.FileName}_0x{bundleStream.Offset:X}";
|
bundleReader.FileName = $"{reader.FileName}_0x{bundleStream.Offset:X}";
|
||||||
}
|
}
|
||||||
Logger.Info($"[MultiBundle] Decompressing \"{reader.FileName}\" from offset: 0x{bundleStream.Offset:X}..");
|
Logger.Info($"[MultiBundle] Decompressing \"{reader.FileName}\" from offset: 0x{bundleStream.Offset:X}..");
|
||||||
bundleFile = new BundleFile(bundleReader, assetsManager.ZstdEnabled, assetsManager.SpecifyUnityVersion);
|
bundleFile = new BundleFile(bundleReader, assetsManager.CustomBlockInfoCompression, assetsManager.CustomBlockCompression, assetsManager.SpecifyUnityVersion);
|
||||||
if (bundleFile.fileList.Length > 0)
|
if (bundleFile.fileList.Length > 0)
|
||||||
{
|
{
|
||||||
count += ExtractStreamFile(extractPath, bundleFile.fileList);
|
count += ExtractStreamFile(extractPath, bundleFile.fileList);
|
||||||
@ -160,7 +160,8 @@ namespace AssetStudioCLI
|
|||||||
{
|
{
|
||||||
var isLoaded = false;
|
var isLoaded = false;
|
||||||
assetsManager.SpecifyUnityVersion = CLIOptions.o_unityVersion.Value;
|
assetsManager.SpecifyUnityVersion = CLIOptions.o_unityVersion.Value;
|
||||||
assetsManager.ZstdEnabled = CLIOptions.o_customCompressionType.Value == CustomCompressionType.Zstd;
|
assetsManager.CustomBlockInfoCompression = CLIOptions.o_bundleBlockInfoCompression.Value;
|
||||||
|
assetsManager.CustomBlockCompression = CLIOptions.o_bundleBlockCompression.Value;
|
||||||
assetsManager.LoadingViaTypeTreeEnabled = !CLIOptions.f_avoidLoadingViaTypetree.Value;
|
assetsManager.LoadingViaTypeTreeEnabled = !CLIOptions.f_avoidLoadingViaTypetree.Value;
|
||||||
if (!CLIOptions.f_loadAllAssets.Value)
|
if (!CLIOptions.f_loadAllAssets.Value)
|
||||||
{
|
{
|
||||||
|
@ -82,6 +82,8 @@
|
|||||||
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)runtimes\win-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\x86\fmod.dll" DestinationFolder="$(TargetDir)runtimes\win-x86\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\x86\fmod.dll" DestinationFolder="$(TargetDir)runtimes\win-x86\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\x64\fmod.dll" DestinationFolder="$(TargetDir)runtimes\win-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\x64\fmod.dll" DestinationFolder="$(TargetDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\x86\ooz.dll" DestinationFolder="$(TargetDir)runtimes\win-x86\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\x64\ooz.dll" DestinationFolder="$(TargetDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<!-- Publishing an app as framework-dependent produces a cross-platform binary as a dll file, and a platform-specific executable that targets your current platform.
|
<!-- Publishing an app as framework-dependent produces a cross-platform binary as a dll file, and a platform-specific executable that targets your current platform.
|
||||||
@ -94,6 +96,8 @@
|
|||||||
<Copy SourceFiles="$(TargetDir)runtimes\win-x64\native\Texture2DDecoderNative.dll" DestinationFolder="$(PublishDir)runtimes\win-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\win-x64\native\Texture2DDecoderNative.dll" DestinationFolder="$(PublishDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\win-x86\native\fmod.dll" DestinationFolder="$(PublishDir)runtimes\win-x86\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\win-x86\native\fmod.dll" DestinationFolder="$(PublishDir)runtimes\win-x86\native" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)runtimes\win-x64\native\fmod.dll" DestinationFolder="$(PublishDir)runtimes\win-x64\native" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)runtimes\win-x64\native\fmod.dll" DestinationFolder="$(PublishDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)runtimes\win-x86\native\ooz.dll" DestinationFolder="$(PublishDir)runtimes\win-x86\native" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)runtimes\win-x64\native\ooz.dll" DestinationFolder="$(PublishDir)runtimes\win-x64\native" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<!-- No need to publish net472 build of AssetStudioGUI -->
|
<!-- No need to publish net472 build of AssetStudioGUI -->
|
||||||
@ -107,6 +111,7 @@
|
|||||||
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\Win32\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\Win32\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\Win32\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\Win32\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\x86\fmod.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\x86\fmod.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\x86\ooz.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="CopyExtraFilesWin64" AfterTargets="AfterBuild" Condition=" '$(RuntimeIdentifier)' == 'win-x64' AND '$(TargetFramework)' != 'net472' ">
|
<Target Name="CopyExtraFilesWin64" AfterTargets="AfterBuild" Condition=" '$(RuntimeIdentifier)' == 'win-x64' AND '$(TargetFramework)' != 'net472' ">
|
||||||
@ -114,6 +119,7 @@
|
|||||||
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\x64\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(SolutionDir)Texture2DDecoderNative\bin\x64\$(Configuration)\Texture2DDecoderNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(SolutionDir)AssetStudioFBXNative\bin\x64\$(Configuration)\AssetStudioFBXNative.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(ProjectDir)Libraries\x64\fmod.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(ProjectDir)Libraries\x64\fmod.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(ProjectDir)Libraries\x64\ooz.dll" DestinationFolder="$(TargetDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
<Target Name="PublishExtraFilesWin" AfterTargets="Publish" Condition=" $(RuntimeIdentifier.Contains('win')) AND '$(TargetFramework)' != 'net472' ">
|
<Target Name="PublishExtraFilesWin" AfterTargets="Publish" Condition=" $(RuntimeIdentifier.Contains('win')) AND '$(TargetFramework)' != 'net472' ">
|
||||||
@ -121,6 +127,7 @@
|
|||||||
<Copy SourceFiles="$(TargetDir)\AssetStudioFBXNative.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\AssetStudioFBXNative.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)\Texture2DDecoderNative.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\Texture2DDecoderNative.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
<Copy SourceFiles="$(TargetDir)\fmod.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
<Copy SourceFiles="$(TargetDir)\fmod.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
|
<Copy SourceFiles="$(TargetDir)\ooz.dll" DestinationFolder="$(PublishDir)" ContinueOnError="false" />
|
||||||
</Target>
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
80
AssetStudioGUI/AssetStudioGUIForm.Designer.cs
generated
80
AssetStudioGUI/AssetStudioGUIForm.Designer.cs
generated
@ -47,8 +47,10 @@
|
|||||||
this.useDumpTreeViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.useDumpTreeViewToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.buildTreeStructureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.buildTreeStructureToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.customCompressionTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.customCompressionTypeToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.customCompressionZstdToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.blockInfoCompressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.customCompressionLZ4ToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
this.customBlockInfoCompressionComboBoxToolStripMenuItem = new System.Windows.Forms.ToolStripComboBox();
|
||||||
|
this.blockCompressionToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
|
this.customBlockCompressionComboBoxToolStripMenuItem = new System.Windows.Forms.ToolStripComboBox();
|
||||||
this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripMenuItem();
|
this.toolStripMenuItem14 = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
this.specifyUnityVersion = new System.Windows.Forms.ToolStripTextBox();
|
this.specifyUnityVersion = new System.Windows.Forms.ToolStripTextBox();
|
||||||
this.showExpOpt = new System.Windows.Forms.ToolStripMenuItem();
|
this.showExpOpt = new System.Windows.Forms.ToolStripMenuItem();
|
||||||
@ -359,33 +361,59 @@
|
|||||||
// customCompressionTypeToolStripMenuItem
|
// customCompressionTypeToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.customCompressionTypeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
this.customCompressionTypeToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
|
||||||
this.customCompressionZstdToolStripMenuItem,
|
this.blockInfoCompressionToolStripMenuItem,
|
||||||
this.customCompressionLZ4ToolStripMenuItem});
|
this.customBlockInfoCompressionComboBoxToolStripMenuItem,
|
||||||
|
this.blockCompressionToolStripMenuItem,
|
||||||
|
this.customBlockCompressionComboBoxToolStripMenuItem});
|
||||||
this.customCompressionTypeToolStripMenuItem.Name = "customCompressionTypeToolStripMenuItem";
|
this.customCompressionTypeToolStripMenuItem.Name = "customCompressionTypeToolStripMenuItem";
|
||||||
this.customCompressionTypeToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
this.customCompressionTypeToolStripMenuItem.Size = new System.Drawing.Size(241, 22);
|
||||||
this.customCompressionTypeToolStripMenuItem.Text = "Custom compression type";
|
this.customCompressionTypeToolStripMenuItem.Text = "Bundle compression type";
|
||||||
//
|
//
|
||||||
// customCompressionZstdToolStripMenuItem
|
// blockInfoCompressionToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.customCompressionZstdToolStripMenuItem.Checked = true;
|
this.blockInfoCompressionToolStripMenuItem.Enabled = false;
|
||||||
this.customCompressionZstdToolStripMenuItem.CheckOnClick = true;
|
this.blockInfoCompressionToolStripMenuItem.Name = "blockInfoCompressionToolStripMenuItem";
|
||||||
this.customCompressionZstdToolStripMenuItem.CheckState = System.Windows.Forms.CheckState.Checked;
|
this.blockInfoCompressionToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
|
||||||
this.customCompressionZstdToolStripMenuItem.Name = "customCompressionZstdToolStripMenuItem";
|
this.blockInfoCompressionToolStripMenuItem.Text = "BlockInfo Compression";
|
||||||
this.customCompressionZstdToolStripMenuItem.Size = new System.Drawing.Size(130, 22);
|
|
||||||
this.customCompressionZstdToolStripMenuItem.Text = "Zstd";
|
|
||||||
this.customCompressionZstdToolStripMenuItem.ToolTipText = "If selected, Zstd-decompression will be used for assets with custom compression t" +
|
|
||||||
"ype";
|
|
||||||
this.customCompressionZstdToolStripMenuItem.CheckedChanged += new System.EventHandler(this.customCompressionZstd_CheckedChanged);
|
|
||||||
//
|
//
|
||||||
// customCompressionLZ4ToolStripMenuItem
|
// customBlockInfoCompressionComboBoxToolStripMenuItem
|
||||||
//
|
//
|
||||||
this.customCompressionLZ4ToolStripMenuItem.CheckOnClick = true;
|
this.customBlockInfoCompressionComboBoxToolStripMenuItem.DropDownHeight = 80;
|
||||||
this.customCompressionLZ4ToolStripMenuItem.Name = "customCompressionLZ4ToolStripMenuItem";
|
this.customBlockInfoCompressionComboBoxToolStripMenuItem.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
this.customCompressionLZ4ToolStripMenuItem.Size = new System.Drawing.Size(130, 22);
|
this.customBlockInfoCompressionComboBoxToolStripMenuItem.IntegralHeight = false;
|
||||||
this.customCompressionLZ4ToolStripMenuItem.Text = "Lz4/Lz4HC";
|
this.customBlockInfoCompressionComboBoxToolStripMenuItem.Items.AddRange(new object[] {
|
||||||
this.customCompressionLZ4ToolStripMenuItem.ToolTipText = "If selected, Lz4-decompression will be used for assets with custom compression ty" +
|
"Auto",
|
||||||
"pe";
|
"Zstd",
|
||||||
this.customCompressionLZ4ToolStripMenuItem.CheckedChanged += new System.EventHandler(this.customCompressionLZ4_CheckedChanged);
|
"Oodle",
|
||||||
|
"Lz4/Lz4HC",
|
||||||
|
"Lzma"});
|
||||||
|
this.customBlockInfoCompressionComboBoxToolStripMenuItem.Name = "customBlockInfoCompressionComboBoxToolStripMenuItem";
|
||||||
|
this.customBlockInfoCompressionComboBoxToolStripMenuItem.Size = new System.Drawing.Size(100, 23);
|
||||||
|
this.customBlockInfoCompressionComboBoxToolStripMenuItem.ToolTipText = "Selected compression type will override detected type from asset bundle";
|
||||||
|
this.customBlockInfoCompressionComboBoxToolStripMenuItem.SelectedIndexChanged += new System.EventHandler(this.customBlockInfoCompressionComboBoxToolStripMenuItem_SelectedIndexChanged);
|
||||||
|
//
|
||||||
|
// blockCompressionToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.blockCompressionToolStripMenuItem.Enabled = false;
|
||||||
|
this.blockCompressionToolStripMenuItem.Name = "blockCompressionToolStripMenuItem";
|
||||||
|
this.blockCompressionToolStripMenuItem.Size = new System.Drawing.Size(197, 22);
|
||||||
|
this.blockCompressionToolStripMenuItem.Text = "Block Compression";
|
||||||
|
//
|
||||||
|
// customBlockCompressionComboBoxToolStripMenuItem
|
||||||
|
//
|
||||||
|
this.customBlockCompressionComboBoxToolStripMenuItem.DropDownHeight = 80;
|
||||||
|
this.customBlockCompressionComboBoxToolStripMenuItem.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
this.customBlockCompressionComboBoxToolStripMenuItem.IntegralHeight = false;
|
||||||
|
this.customBlockCompressionComboBoxToolStripMenuItem.Items.AddRange(new object[] {
|
||||||
|
"Auto",
|
||||||
|
"Zstd",
|
||||||
|
"Oodle",
|
||||||
|
"Lz4/Lz4HC",
|
||||||
|
"Lzma"});
|
||||||
|
this.customBlockCompressionComboBoxToolStripMenuItem.Name = "customBlockCompressionComboBoxToolStripMenuItem";
|
||||||
|
this.customBlockCompressionComboBoxToolStripMenuItem.Size = new System.Drawing.Size(100, 23);
|
||||||
|
this.customBlockCompressionComboBoxToolStripMenuItem.ToolTipText = "Selected compression type will override detected type from asset bundle";
|
||||||
|
this.customBlockCompressionComboBoxToolStripMenuItem.SelectedIndexChanged += new System.EventHandler(this.customBlockCompressionComboBoxToolStripMenuItem_SelectedIndexChanged);
|
||||||
//
|
//
|
||||||
// toolStripMenuItem14
|
// toolStripMenuItem14
|
||||||
//
|
//
|
||||||
@ -1746,8 +1774,6 @@
|
|||||||
private System.Windows.Forms.ToolStripMenuItem l2DModelWithFadeListToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem l2DModelWithFadeListToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem exportL2DWithFadeLstToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem exportL2DWithFadeLstToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem customCompressionTypeToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem customCompressionTypeToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripMenuItem customCompressionZstdToolStripMenuItem;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem customCompressionLZ4ToolStripMenuItem;
|
|
||||||
private System.Windows.Forms.ToolStripMenuItem useAssetLoadingViaTypetreeToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem useAssetLoadingViaTypetreeToolStripMenuItem;
|
||||||
private System.Windows.Forms.ToolStripSeparator assetLoadingToolStripSeparator;
|
private System.Windows.Forms.ToolStripSeparator assetLoadingToolStripSeparator;
|
||||||
private System.Windows.Forms.TreeView dumpTreeView;
|
private System.Windows.Forms.TreeView dumpTreeView;
|
||||||
@ -1763,6 +1789,10 @@
|
|||||||
private System.Windows.Forms.ToolStripMenuItem colorThemeDarkToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem colorThemeDarkToolStripMenuItem;
|
||||||
private System.Windows.Forms.Label FMODaudioChannelsLabel;
|
private System.Windows.Forms.Label FMODaudioChannelsLabel;
|
||||||
private System.Windows.Forms.ToolStripMenuItem autoPlayAudioAssetsToolStripMenuItem;
|
private System.Windows.Forms.ToolStripMenuItem autoPlayAudioAssetsToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripComboBox customBlockCompressionComboBoxToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem blockCompressionToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripMenuItem blockInfoCompressionToolStripMenuItem;
|
||||||
|
private System.Windows.Forms.ToolStripComboBox customBlockInfoCompressionComboBoxToolStripMenuItem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -145,6 +145,8 @@ namespace AssetStudioGUI
|
|||||||
useAssetLoadingViaTypetreeToolStripMenuItem.Checked = Properties.Settings.Default.useTypetreeLoading;
|
useAssetLoadingViaTypetreeToolStripMenuItem.Checked = Properties.Settings.Default.useTypetreeLoading;
|
||||||
useDumpTreeViewToolStripMenuItem.Checked = Properties.Settings.Default.useDumpTreeView;
|
useDumpTreeViewToolStripMenuItem.Checked = Properties.Settings.Default.useDumpTreeView;
|
||||||
autoPlayAudioAssetsToolStripMenuItem.Checked = Properties.Settings.Default.autoplayAudio;
|
autoPlayAudioAssetsToolStripMenuItem.Checked = Properties.Settings.Default.autoplayAudio;
|
||||||
|
customBlockCompressionComboBoxToolStripMenuItem.SelectedIndex = 0;
|
||||||
|
customBlockInfoCompressionComboBoxToolStripMenuItem.SelectedIndex = 0;
|
||||||
FMODinit();
|
FMODinit();
|
||||||
listSearchFilterMode.SelectedIndex = 0;
|
listSearchFilterMode.SelectedIndex = 0;
|
||||||
if (string.IsNullOrEmpty(Properties.Settings.Default.fbxSettings))
|
if (string.IsNullOrEmpty(Properties.Settings.Default.fbxSettings))
|
||||||
@ -2422,16 +2424,50 @@ namespace AssetStudioGUI
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void customCompressionZstd_CheckedChanged(object sender, EventArgs e)
|
private void customBlockCompressionComboBoxToolStripMenuItem_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
customCompressionLZ4ToolStripMenuItem.Checked = !customCompressionZstdToolStripMenuItem.Checked;
|
var selectedTypeIndex = customBlockCompressionComboBoxToolStripMenuItem.SelectedIndex;
|
||||||
assetsManager.ZstdEnabled = customCompressionZstdToolStripMenuItem.Checked;
|
switch (selectedTypeIndex)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
assetsManager.CustomBlockCompression = CompressionType.Auto;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
assetsManager.CustomBlockCompression = CompressionType.Zstd;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
assetsManager.CustomBlockCompression = CompressionType.Oodle;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
assetsManager.CustomBlockCompression = CompressionType.Lz4HC;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
assetsManager.CustomBlockCompression = CompressionType.Lzma;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void customCompressionLZ4_CheckedChanged(object sender, EventArgs e)
|
private void customBlockInfoCompressionComboBoxToolStripMenuItem_SelectedIndexChanged(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
customCompressionZstdToolStripMenuItem.Checked = !customCompressionLZ4ToolStripMenuItem.Checked;
|
var selectedTypeIndex = customBlockInfoCompressionComboBoxToolStripMenuItem.SelectedIndex;
|
||||||
assetsManager.ZstdEnabled = customCompressionZstdToolStripMenuItem.Checked;
|
switch (selectedTypeIndex)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
assetsManager.CustomBlockInfoCompression = CompressionType.Auto;
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
assetsManager.CustomBlockInfoCompression = CompressionType.Zstd;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
assetsManager.CustomBlockInfoCompression = CompressionType.Oodle;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
assetsManager.CustomBlockInfoCompression = CompressionType.Lz4HC;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
assetsManager.CustomBlockInfoCompression = CompressionType.Lzma;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void useAssetLoadingViaTypetreeToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
|
private void useAssetLoadingViaTypetreeToolStripMenuItem_CheckedChanged(object sender, EventArgs e)
|
||||||
|
@ -140,7 +140,7 @@ namespace AssetStudioGUI
|
|||||||
var count = 0;
|
var count = 0;
|
||||||
var bundleStream = new OffsetStream(reader);
|
var bundleStream = new OffsetStream(reader);
|
||||||
var bundleReader = new FileReader(reader.FullPath, bundleStream);
|
var bundleReader = new FileReader(reader.FullPath, bundleStream);
|
||||||
var bundleFile = new BundleFile(bundleReader, assetsManager.ZstdEnabled, assetsManager.SpecifyUnityVersion);
|
var bundleFile = new BundleFile(bundleReader, assetsManager.CustomBlockInfoCompression, assetsManager.CustomBlockCompression, assetsManager.SpecifyUnityVersion);
|
||||||
var extractPath = Path.Combine(savePath, reader.FileName + "_unpacked");
|
var extractPath = Path.Combine(savePath, reader.FileName + "_unpacked");
|
||||||
if (bundleFile.fileList.Length > 0)
|
if (bundleFile.fileList.Length > 0)
|
||||||
{
|
{
|
||||||
@ -157,7 +157,7 @@ namespace AssetStudioGUI
|
|||||||
bundleReader.FileName = $"{reader.FileName}_0x{bundleStream.Offset:X}";
|
bundleReader.FileName = $"{reader.FileName}_0x{bundleStream.Offset:X}";
|
||||||
}
|
}
|
||||||
Logger.Info($"[MultiBundle] Decompressing \"{reader.FileName}\" from offset: 0x{bundleStream.Offset:X}..");
|
Logger.Info($"[MultiBundle] Decompressing \"{reader.FileName}\" from offset: 0x{bundleStream.Offset:X}..");
|
||||||
bundleFile = new BundleFile(bundleReader, assetsManager.ZstdEnabled, assetsManager.SpecifyUnityVersion);
|
bundleFile = new BundleFile(bundleReader, assetsManager.CustomBlockInfoCompression, assetsManager.CustomBlockCompression, assetsManager.SpecifyUnityVersion);
|
||||||
if (bundleFile.fileList.Length > 0)
|
if (bundleFile.fileList.Length > 0)
|
||||||
{
|
{
|
||||||
count += ExtractStreamFile(extractPath, bundleFile.fileList);
|
count += ExtractStreamFile(extractPath, bundleFile.fileList);
|
||||||
|
Loading…
Reference in New Issue
Block a user