Пример #1
0
        private byte[] LoadData(FileEntry entry, bool getCustom)
        {
            /*
            if (entry.CustomData == null)
            {

                byte[] data = _rpfFile.ReadData(entry.Offset, entry.SizeInArchive);

                if (entry.IsCompressed)
                {
                    data = DataUtil.DecompressDeflate(data, entry.Size);
                }

                return data;
            }
            else
            {
                return entry.CustomData;
            }
             */

            byte[] data;
            if (getCustom && entry.CustomData != null)
                data = entry.CustomData;
            else
                data = _rpfFile.ReadData(entry.Offset, entry.SizeInArchive);
            if (entry.IsCompressed && entry.IsEncrypted && !entry.IsResourceFile)
            {
                data = DataUtil.DecryptNew(data);
                data = xcompress2.Decompress(data, (int)entry.Size);
            }
            else if (entry.IsCompressed && !entry.IsEncrypted && !entry.IsResourceFile)
            {
                data = xcompress2.Decompress(data, (int)entry.Size);
            }
            return data;
        }
Пример #2
0
 private void StoreData(FileEntry entry, byte[] data)
 {
     entry.SetCustomData(data);
 }