Beispiel #1
0
        private void ReadData(Stream SCMStream)
        {
            reader = new BinaryReader(SCMStream);
            reader.BaseStream.CopyTo(Data);

            uint JumpOpSize    = 2u + 1u + 4u;
            uint JumpParamSize = 2u + 1u;

            reader.BaseStream.Position = JumpOpSize;
            target = (SCMTarget)reader.ReadByte();

            globalSectionOffset = JumpOpSize + 1u;

            reader.BaseStream.Position = JumpParamSize;
            modelSectionOffset         = reader.ReadUInt32() + JumpOpSize + 1u;

            reader.BaseStream.Position = modelSectionOffset - JumpOpSize - 1u + JumpParamSize;
            missionSectionOffset       = reader.ReadUInt32() + JumpOpSize + 1u;

            reader.BaseStream.Position = missionSectionOffset - JumpOpSize - 1u + JumpParamSize;
            codeSectionOffset          = reader.ReadUInt32();

            reader.BaseStream.Position = modelSectionOffset;
            uint ModelCount = reader.ReadUInt32();

            for (uint i = 0; i < ModelCount; i++)
            {
                models.Add(reader.ReadVCString(24));
            }

            reader.BaseStream.Position = missionSectionOffset;
            mainSize           = reader.ReadUInt32();
            missionLargestSize = reader.ReadUInt32();

            uint MissionCount = reader.ReadUInt32();

            for (int i = 0; i < MissionCount; i++)
            {
                missionOffsets.Add(reader.ReadUInt32());
            }

            reader.Close();
        }
Beispiel #2
0
        private void ReadData(Stream SCMStream)
        {
            BinaryReader Reader = new BinaryReader(SCMStream);

            uint JumpOpSize    = 2u + 1u + 4u;
            uint JumpParamSize = 2u + 1u;

            Reader.BaseStream.Position = JumpOpSize;
            m_Target = (SCMTarget)Reader.ReadByte();

            m_GlobalSectionOffset = JumpOpSize + 1u;

            Reader.BaseStream.Position = JumpParamSize;
            m_ModelSectionOffset       = Reader.ReadUInt32() + JumpOpSize + 1u;

            Reader.BaseStream.Position = m_ModelSectionOffset - JumpOpSize - 1u + JumpParamSize;
            m_MissionSectionOffset     = Reader.ReadUInt32() + JumpOpSize + 1u;

            Reader.BaseStream.Position = m_MissionSectionOffset - JumpOpSize - 1u + JumpParamSize;
            m_CodeSectionOffset        = Reader.ReadUInt32();

            Reader.BaseStream.Position = m_ModelSectionOffset;
            uint ModelCount = Reader.ReadUInt32();

            for (uint i = 0; i < ModelCount; i++)
            {
                m_Models.Add(Reader.ReadVCString(24));
            }

            Reader.BaseStream.Position = m_MissionSectionOffset;
            m_MainSize           = Reader.ReadUInt32();
            m_MissionLargestSize = Reader.ReadUInt32();

            uint MissionCount = Reader.ReadUInt32();

            for (int i = 0; i < MissionCount; i++)
            {
                m_MissionOffsets.Add(Reader.ReadUInt32());
            }
        }