Example #1
0
 public FDictionaryHeader(BinaryReader reader)
 {
     Magic                   = reader.ReadUInt32();
     DictionaryVersion       = reader.ReadUInt32();
     OodleMajorHeaderVersion = reader.ReadUInt32();
     HashTableSize           = reader.ReadInt32();
     DictionaryData          = new FOodleCompressedData(reader);
     CompressorData          = new FOodleCompressedData(reader);
 }
Example #2
0
        // [DllImport("oo2core_5_win64")]
        // private static extern int OodleLZ_Compress(uint format, byte[] buffer, long bufferSize, byte[] outputBuffer, ulong level);

        static byte[] DecompressOodle(BinaryReader reader, FOodleCompressedData DataInfo)
        {
            reader.BaseStream.Seek(DataInfo.Offset, SeekOrigin.Begin);
            var CompressedData   = reader.ReadBytes((int)DataInfo.CompressedLength);
            var DecompressedData = new byte[DataInfo.DecompressedLength];

            var OodleLen = OodleLZ_Decompress(CompressedData, DecompressedData);

            if (OodleLen != DataInfo.DecompressedLength)
            {
                Console.WriteLine($"Didn't decompress correctly. Read {OodleLen}, should be {DataInfo.DecompressedLength}");
            }
            return(DecompressedData);
        }