示例#1
0
        private void Read(Stream input)
        {
            BinaryReader reader            = new BinaryReader(input, Encoding.Default, true);
            uint         magicNumber1      = reader.ReadUInt32();
            uint         magicNumber2      = reader.ReadUInt32();
            int          entityCount       = reader.ReadInt32();
            int          stringTableOffset = reader.ReadInt32();
            int          offsetData        = reader.ReadInt32();

            reader.Skip(12);
            for (int i = 0; i < entityCount; i++)
            {
                FoxEntity entity = FoxEntity.ReadFoxEntity(input);
                _entities.Add(entity);
            }

            FoxStringLookupLiteral stringLookupLiteral;

            while ((stringLookupLiteral = FoxStringLookupLiteral.ReadFoxStringLookupLiteral(input)) != null)
            {
                _stringLookupLiterals.Add(stringLookupLiteral);
            }
            input.AlignRead(16);
            reader.Skip(2);
            byte[] eof = reader.ReadBytes(3);
            input.AlignRead(16);
        }
示例#2
0
 public void Read(Stream input, short valueCount)
 {
     for (int i = 0; i < valueCount; i++)
     {
         FoxHash hash = FoxHash.ReadFoxHash(input);
         FoxStringLookupLiteral key = new FoxStringLookupLiteral
         {
             Hash = hash
         };
         T value = new T();
         value.Read(input);
         input.AlignRead(16);
         _map.Add(key, value);
     }
 }
        public override void Read(Stream input)
        {
            BinaryReader reader = new BinaryReader(input, Encoding.ASCII, true);
            uint magic = reader.ReadUInt32();
            byte fileCount = reader.ReadByte();
            ushort headerSize = reader.ReadUInt16();
            byte padding = reader.ReadByte();

            List<SbpEntry> entries = new List<SbpEntry>();
            for (int i = 0; i < fileCount; i++)
            {
                var entry = new SbpEntry();
                entry.FileName = Name;
                entry.Read(reader);
                entries.Add(entry);
            }
            input.AlignRead(16);
            Entries = entries;
        }
示例#4
0
        private void Read(Stream input)
        {
            BinaryReader reader = new BinaryReader(input, Encoding.Default, true);

            NameHash = reader.ReadUInt64();

            DataType      = (FoxDataType)reader.ReadByte();
            ContainerType = (FoxContainerType)reader.ReadByte();
            short  valueCount = reader.ReadInt16();
            short  offset     = reader.ReadInt16();
            ushort size       = reader.ReadUInt16();

            int unknown2 = reader.ReadInt32();
            int unknown3 = reader.ReadInt32();
            int unknown4 = reader.ReadInt32();
            int unknown5 = reader.ReadInt32();

            Container = FoxContainerFactory.ReadFoxContainer(input, DataType, ContainerType, valueCount);
            input.AlignRead(16);
        }
示例#5
0
        public override void Read(Stream input)
        {
            BinaryReader reader     = new BinaryReader(input, Encoding.ASCII, true);
            uint         magic      = reader.ReadUInt32();
            byte         fileCount  = reader.ReadByte();
            ushort       headerSize = reader.ReadUInt16();
            byte         padding    = reader.ReadByte();

            List <SbpEntry> entries    = new List <SbpEntry>();
            string          entityName = Path.GetFileNameWithoutExtension(Name);

            for (int i = 0; i < fileCount; i++)
            {
                var entry = new SbpEntry();
                entry.FileName = entityName;
                entry.Read(reader);
                entries.Add(entry);
            }
            input.AlignRead(16);
            Entries = entries;
        }
示例#6
0
        private void Read(Stream input)
        {
            BinaryReader reader     = new BinaryReader(input, Encoding.Default, true);
            short        headerSize = reader.ReadInt16();

            Unknown1 = reader.ReadInt16();
            short padding1     = reader.ReadInt16();
            uint  magicNumber1 = reader.ReadUInt32();

            Address = reader.ReadUInt32();
            uint padding2 = reader.ReadUInt32();

            Unknown2 = reader.ReadInt32();
            int unknown5 = reader.ReadInt32();

            Version       = reader.ReadInt16();
            ClassNameHash = reader.ReadUInt64();
            ushort staticPropertyCount = reader.ReadUInt16();
            uint   dynamicPropetyCount = reader.ReadUInt16();
            int    offset         = reader.ReadInt32();
            int    staticDataSize = reader.ReadInt32();
            int    dataSize       = reader.ReadInt32();

            input.AlignRead(16);

            for (int i = 0; i < staticPropertyCount; i++)
            {
                FoxProperty property = FoxProperty.ReadFoxProperty(input);
                if (property.Container == null)
                {
                    property.Container = null;
                }
                _staticProperties.Add(property);
            }
            for (int i = 0; i < dynamicPropetyCount; i++)
            {
                FoxProperty property = FoxProperty.ReadFoxProperty(input);
                _dynamicProperties.Add(property);
            }
        }
示例#7
0
        public void Read(Stream inputStream)
        {
            BinaryReader reader      = new BinaryReader(inputStream, Encoding.Default, true);
            string       magicNumber = reader.ReadString(4);
            short        endianess   = reader.ReadInt16();
            byte         entryCount  = reader.ReadByte();

            reader.Skip(1);
            short headerSize = reader.ReadInt16();

            inputStream.AlignRead(16);
            List <FfntEntryHeader> ffntEntryHeaders = new List <FfntEntryHeader>();

            for (int i = 0; i < entryCount; i++)
            {
                ffntEntryHeaders.Add(FfntEntryHeader.ReadFfntEntryHeader(inputStream));
            }

            foreach (var header in ffntEntryHeaders)
            {
                Entries.Add(header.ReadData(inputStream));
            }
        }
        private void Read(Stream input)
        {
            BinaryReader reader = new BinaryReader(input, Encoding.Default, true);
            short headerSize = reader.ReadInt16();
            Unknown1 = reader.ReadInt16();
            short padding1 = reader.ReadInt16();
            uint magicNumber1 = reader.ReadUInt32();
            Address = reader.ReadUInt32();
            uint padding2 = reader.ReadUInt32();
            Unknown2 = reader.ReadInt32();
            int unknown5 = reader.ReadInt32();
            Version = reader.ReadInt16();
            ClassNameHash = reader.ReadUInt64();
            ushort staticPropertyCount = reader.ReadUInt16();
            uint dynamicPropetyCount = reader.ReadUInt16();
            int offset = reader.ReadInt32();
            int staticDataSize = reader.ReadInt32();
            int dataSize = reader.ReadInt32();
            input.AlignRead(16);

            for (int i = 0; i < staticPropertyCount; i++)
            {
                FoxProperty property = FoxProperty.ReadFoxProperty(input);
                if (property.Container == null)
                    property.Container = null;
                _staticProperties.Add(property);
            }
            for (int i = 0; i < dynamicPropetyCount; i++)
            {
                FoxProperty property = FoxProperty.ReadFoxProperty(input);
                _dynamicProperties.Add(property);
            }
        }
示例#9
0
        private void Read(Stream input)
        {
            BinaryReader reader = new BinaryReader(input, Encoding.Default, true);
            uint magicNumber1 = reader.ReadUInt32();
            uint magicNumber2 = reader.ReadUInt32();
            int entityCount = reader.ReadInt32();
            int stringTableOffset = reader.ReadInt32();
            int offsetData = reader.ReadInt32();
            reader.Skip(12);
            for (int i = 0; i < entityCount; i++)
            {
                FoxEntity entity = FoxEntity.ReadFoxEntity(input);
                _entities.Add(entity);
            }

            FoxStringLookupLiteral stringLookupLiteral;
            while ((stringLookupLiteral = FoxStringLookupLiteral.ReadFoxStringLookupLiteral(input)) != null)
            {
                _stringLookupLiterals.Add(stringLookupLiteral);
            }
            input.AlignRead(16);
            reader.Skip(2);
            string eof = reader.ReadString(3);
            input.AlignRead(16);
        }