Esempio n. 1
0
        public override void Read(BitsStream stream)
        {
            bool IsResourceFile = stream.ReadBool();
            long Offset = (long)stream.ReadBits(23);
            int Size = (int)stream.ReadBits(24);
            NameOffset = (int)stream.ReadBits(16);

            ContentEntryIndex = stream.ReadInt();
            ContentEntryCount = stream.ReadInt();
        }
Esempio n. 2
0
        public void Read(BigEndianBinaryReader br)
        {
            Identifier = (HeaderIDs)br.ReadInt32();
            EntryCount = br.ReadInt32();
            TOCSize = EntryCount * 16;

            BitsStream stream = new BitsStream(br.BaseStream);
            stream.Position = 8;
            stream.ReadBits(1);
            nameShift = (int)stream.ReadBits(3);
            namesLength = (int)stream.ReadBits(28);
            br.BaseStream.Position = 12;

            EncryptedFlag = br.ReadInt32();
        }
Esempio n. 3
0
        public override void Read(BitsStream stream)
        {
            try
            {
                IsResourceFile = stream.ReadBool();
                Offset = (long)stream.ReadBits(23);
                SizeInArchive = (int)stream.ReadBits(24);
                NameOffset = (int)stream.ReadBits(16);

                Offset <<= 9;

                if (IsResourceFile)
                {
                    if (Size == 0xFFFFFF)
                    {
                        throw new Exception("Resource with size -1, not supported");
                    }
                    uint systemFlag = (uint)stream.ReadInt();
                    uint graphicsFlag = (uint)stream.ReadInt();

                    IsCompressed = false;
                    IsEncrypted = false;
                    Size = SizeInArchive;
                }
                else
                {
                    Size = stream.ReadInt();
                    IsEncrypted = stream.ReadInt() == 1;
                    IsCompressed = Size != 0 ? true : false;
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Esempio n. 4
0
 internal static bool ReadAsDirectory(BitsStream stream)
 {
     bool dir = stream.ReadInt() == 2147483392;
     stream.Seek(stream.Position - 4);
     return dir;
 }
Esempio n. 5
0
 public abstract void Read(BitsStream br);