///public bool ReadInitial(AssetsFileReader reader, LPARAM lPar, AssetsFileVerifyLogger errorLogger = NULL); public void Read(AssetsFileReader reader) { signature = reader.ReadNullTerminated(); fileVersion = reader.ReadUInt32(); minPlayerVersion = reader.ReadNullTerminated(); fileEngineVersion = reader.ReadNullTerminated(); totalFileSize = reader.ReadInt64(); compressedSize = reader.ReadUInt32(); decompressedSize = reader.ReadUInt32(); flags = reader.ReadUInt32(); }
///public bool ReadInitial(AssetsFileReader reader, LPARAM lPar, AssetsFileVerifyLogger errorLogger = NULL); public bool Read(AssetsFileReader reader /*, AssetsFileVerifyLogger errorLogger = null*/) { signature = reader.ReadNullTerminated(); fileVersion = reader.ReadUInt32(); minPlayerVersion = reader.ReadNullTerminated(); fileEngineVersion = reader.ReadNullTerminated(); totalFileSize = reader.ReadUInt64(); compressedSize = reader.ReadUInt32(); decompressedSize = reader.ReadUInt32(); flags = reader.ReadUInt32(); return(true); }
///void Free(); public void Read(long filePos, AssetsFileReader reader) { reader.Position = filePos; checksumLow = reader.ReadUInt64(); checksumHigh = reader.ReadUInt64(); blockCount = reader.ReadInt32(); blockInf = new AssetBundleBlockInfo06[blockCount]; for (int i = 0; i < blockCount; i++) { blockInf[i] = new AssetBundleBlockInfo06(); blockInf[i].decompressedSize = reader.ReadUInt32(); blockInf[i].compressedSize = reader.ReadUInt32(); blockInf[i].flags = reader.ReadUInt16(); } directoryCount = reader.ReadInt32(); dirInf = new AssetBundleDirectoryInfo06[directoryCount]; for (int i = 0; i < directoryCount; i++) { dirInf[i] = new AssetBundleDirectoryInfo06(); dirInf[i].offset = reader.ReadInt64(); dirInf[i].decompressedSize = reader.ReadInt64(); dirInf[i].flags = reader.ReadUInt32(); dirInf[i].name = reader.ReadNullTerminated(); } }
public ulong Read(ulong absFilePos, AssetsFileReader reader, bool bigEndian) { guid = new GUID128(); guid.Read(reader.Position, reader); bufferedPath = new byte[] { reader.ReadByte() }; //todo: why type = reader.ReadInt32(); assetPath = reader.ReadNullTerminated(); if (assetPath.StartsWith("library/")) { assetPath = "Resources\\" + assetPath.Substring(8); } return(reader.Position); }
//todo: bundleheader3 is read regardless of version 3 or 6, see https://7daystodie.com/forums/showthread.php?22675-Unity-Assets-Bundle-Extractor&p=761867&viewfull=1#post761867 //"just check if bundleHeader3.fileVersion is 3 or 6." public bool Read(AssetsFileReader reader, /*AssetsFileVerifyLogger errorLogger = NULL,*/ bool allowCompressed = false) { reader.ReadNullTerminated(); if (reader.ReadUInt32() == 6) { reader.Position = 0; bundleHeader6 = new AssetsBundleHeader06(); if (bundleHeader6.Read(reader)) { if (bundleHeader6.signature == "UnityFS") { bundleInf6 = new AssetsBundleBlockAndDirectoryList06(); if ((bundleHeader6.flags & 0x3F) != 0) { if (allowCompressed) { return(true); } else { Close(); return(false); } } else { return(bundleInf6.Read(bundleHeader6.GetBundleInfoOffset(), reader)); } } else { new NotImplementedException("Non UnityFS bundles are not supported yet."); } } } else if (reader.ReadUInt32() == 3) { new NotImplementedException("Version 3 bundles are not supported yet."); } else { new Exception("AssetsBundleFile.Read : Unknown file version!"); } return(false); }
public uint _fmt; //not stored here in the .assets file, the variable is just to remember the .assets file version public ulong Read(ulong absFilePos, AssetsFileReader reader, uint version, bool bigEndian) { unityVersion = reader.ReadNullTerminated(); this.version = reader.ReadUInt32(); hasTypeTree = reader.ReadBoolean(); fieldCount = reader.ReadUInt32(); pTypes_Unity5 = new Type_0D[fieldCount]; for (int i = 0; i < fieldCount; i++) { Type_0D type0d = new Type_0D(); type0d.Read(hasTypeTree, reader.Position, reader, version, version, bigEndian); pTypes_Unity5[i] = type0d; } if (version < 0x0E) { dwUnknown = reader.ReadUInt24(); } _fmt = version; //-todo: figure out what the heck this is for. if ver = -1 on write does it set it to default or something? return(reader.Position); }//Minimum AssetsFile format : 6
public ulong Read(ulong absFilePos, AssetsFileReader reader, uint version, bool bigEndian) { unityVersion = reader.ReadNullTerminated(); this.version = reader.ReadUInt32(); hasTypeTree = reader.ReadBoolean(); fieldCount = reader.ReadUInt32(); pTypes_Unity5 = new Type_0D[fieldCount]; for (int i = 0; i < fieldCount; i++) { Type_0D type0d = new Type_0D(); type0d.Read(hasTypeTree, reader.Position, reader, version, version, bigEndian); pTypes_Unity5[i] = type0d; } if (version < 0x0E) { dwUnknown = reader.ReadUInt32(); } _fmt = version; return(reader.Position); }
///void Free(); public bool Read(ulong filePos, AssetsFileReader reader /*, AssetsFileVerifyLogger errorLogger = NULL*/) { reader.Position = filePos; checksumLow = reader.ReadUInt64(); checksumHigh = reader.ReadUInt64(); blockCount = reader.ReadUInt32(); blockInf = new AssetsBundleBlockInfo06[blockCount]; for (int i = 0; i < blockCount; i++) { blockInf[i].decompressedSize = reader.ReadUInt32(); blockInf[i].compressedSize = reader.ReadUInt32(); blockInf[i].flags = reader.ReadUInt16(); } directoryCount = reader.ReadUInt32(); dirInf = new AssetsBundleDirectoryInfo06[directoryCount]; for (int i = 0; i < directoryCount; i++) { dirInf[i].offset = reader.ReadUInt64(); dirInf[i].decompressedSize = reader.ReadUInt64(); dirInf[i].flags = reader.ReadUInt32(); dirInf[i].name = reader.ReadNullTerminated(); } return(true); }