Exemple #1
0
        public virtual void Load(Stream stream)
        {
            stream.Position = 0;

            var reader = new DataReader(stream, Endianess.BigEndian);

            while (reader.Position < reader.Length)
            {
                var identInt = reader.ReadUInt32();
                var ident    = (PsoSection)identInt;
                var length   = reader.ReadInt32();

                reader.Position -= 8;

                var sectionData   = reader.ReadBytes(length);
                var sectionStream = new MemoryStream(sectionData);
                var sectionReader = new DataReader(sectionStream, Endianess.BigEndian);

                switch (ident)
                {
                case PsoSection.Data:
                    DataSection = new PsoDataSection();
                    DataSection.Read(sectionReader);
                    break;

                case PsoSection.DataMapping:
                    DataMappingSection = new PsoDataMappingSection();
                    DataMappingSection.Read(sectionReader);
                    break;

                case PsoSection.Definition:
                    DefinitionSection = new PsoDefinitionSection();
                    DefinitionSection.Read(sectionReader);
                    break;

                default:
                    // ignore
                    break;
                }
            }
        }
Exemple #2
0
        public virtual void Load(Stream stream)
        {
            stream.Position = 0;

            var reader = new DataReader(stream, Endianess.BigEndian);

            while (reader.Position < reader.Length)
            {
                var identInt = reader.ReadUInt32();
                var ident    = (PsoSection)identInt;
                var length   = reader.ReadInt32();

                reader.Position -= 8;

                var sectionData   = reader.ReadBytes(length);
                var sectionStream = new MemoryStream(sectionData);
                var sectionReader = new DataReader(sectionStream, Endianess.BigEndian);

                switch (ident)
                {
                case PsoSection.PSIN:      //0x5053494E  "PSIN"  - ID / data section
                    DataSection = new PsoDataSection();
                    DataSection.Read(sectionReader);
                    break;

                case PsoSection.PMAP:      //0x504D4150  "PMAP"  //data mapping
                    DataMappingSection = new PsoDataMappingSection();
                    DataMappingSection.Read(sectionReader);
                    break;

                case PsoSection.PSCH:      //0x50534348  "PSCH"  //schema
                    DefinitionSection = new PsoDefinitionSection();
                    DefinitionSection.Read(sectionReader);
                    break;

                case PsoSection.STRF:      //0x53545246  "STRF"  //paths/STRINGS  (folder strings?)
                    STRFSection = new PsoSTRFSection();
                    STRFSection.Read(sectionReader);
                    break;

                case PsoSection.STRS:      //0x53545253  "STRS"  //names/strings  (DES_)
                    STRSSection = new PsoSTRSSection();
                    STRSSection.Read(sectionReader);
                    break;

                case PsoSection.STRE:      //0x53545245  "STRE"  //probably encrypted strings.....
                    STRESection = new PsoSTRESection();
                    STRESection.Read(sectionReader);
                    break;

                case PsoSection.PSIG:      //0x50534947  "PSIG"  //signature?
                    PSIGSection = new PsoPSIGSection();
                    PSIGSection.Read(sectionReader);
                    break;

                case PsoSection.CHKS:      //0x43484B53  "CHKS"  //checksum?
                    CHKSSection = new PsoCHKSSection();
                    CHKSSection.Read(sectionReader);
                    break;

                default:
                    break;
                }
            }
        }
Exemple #3
0
        public virtual void Load(Stream stream)
        {
            stream.Position = 0;

            var reader = new DataReader(stream, Endianess.BigEndian);

            while (reader.Position < reader.Length)
            {
                var identInt = reader.ReadUInt32();
                var ident    = (PsoSection)identInt;
                var length   = reader.ReadInt32();

                reader.Position -= 8;

                var sectionData   = reader.ReadBytes(length);
                var sectionStream = new MemoryStream(sectionData);
                var sectionReader = new DataReader(sectionStream, Endianess.BigEndian);

                switch (ident)
                {
                case PsoSection.PSIN:
                    DataSection = new PsoDataSection();
                    DataSection.Read(sectionReader);
                    break;

                case PsoSection.PMAP:
                    DataMappingSection = new PsoDataMappingSection();
                    DataMappingSection.Read(sectionReader);
                    break;

                case PsoSection.PSCH:
                    DefinitionSection = new PsoDefinitionSection();
                    DefinitionSection.Read(sectionReader);
                    break;

                case PsoSection.STRF:
                    STRFSection = new PsoSTRFSection();
                    STRFSection.Read(sectionReader);
                    break;

                case PsoSection.STRS:
                    STRSSection = new PsoSTRSSection();
                    STRSSection.Read(sectionReader);
                    break;

                case PsoSection.STRE:
                    STRESection = new PsoSTRESection();
                    STRESection.Read(sectionReader);
                    break;

                case PsoSection.PSIG:
                    PSIGSection = new PsoPSIGSection();
                    PSIGSection.Read(sectionReader);
                    break;

                case PsoSection.CHKS:
                    CHKSSection = new PsoCHKSSection();
                    CHKSSection.Read(sectionReader);
                    break;

                default:
                    break;
                }
            }
        }