AssetsTools.NET icon indicating copy to clipboard operation
AssetsTools.NET copied to clipboard

System.OutOfMemoryException when Unpack

Open johnwhile opened this issue 4 years ago • 1 comments

I am trying to uncompress the bundle files because I can't read the compressed files. This code:

    AssetsManager helper = new AssetsManager();
    helper.LoadClassPackage("classdata.tpk");
    var inst = helper.LoadBundleFile(inputFilename, false);
    var file = inst.file;
    if (file.bundleHeader6.GetCompressionType() == 0) return;
    using (FileStream stream = File.Open(outputFilename, FileMode.Create, FileAccess.ReadWrite))
    {
        file.reader.Position = 0;
        file.Unpack(file.reader, new AssetsFileWriter(stream));
        stream.Position = 0;
    }

With reference from NuGet crash with message for a bundle file of 900MB but not with a bundle of 6MB System.OutOfMemoryException in AssetsTools.NET.AssetBundleFile.Unpack(AssetsFileReader reader, AssetsFileWriter writer) same error from version 2.0.7 to 2.0.9

but work correctly if i donwload the source code and add to my tool the AssetsTools.NET.csproj project

johnwhile avatar Nov 28 '21 14:11 johnwhile

compile as 64 bit

Sighyu avatar Mar 30 '22 13:03 Sighyu