/// <summary>
        /// Read from a stream and get system control info, if possible
        /// </summary>
        /// <param name="reader">BinaryReader representing the input stream</param>
        /// <returns>System control info object, null on error</returns>
        public static SystemControlInfo Read(BinaryReader reader)
        {
            SystemControlInfo sci = new SystemControlInfo();

            try
            {
                sci.ApplicationTitle    = reader.ReadChars(8);
                sci.Reserved1           = reader.ReadBytes(5);
                sci.Flag                = reader.ReadByte();
                sci.RemasterVersion     = reader.ReadBytes(2);
                sci.TextCodesetInfo     = CodeSetInfo.Read(reader);
                sci.StackSize           = reader.ReadUInt32();
                sci.ReadOnlyCodeSetInfo = CodeSetInfo.Read(reader);
                sci.Reserved2           = reader.ReadBytes(4);
                sci.DataCodeSetInfo     = CodeSetInfo.Read(reader);
                sci.BSSSize             = reader.ReadUInt32();

                sci.DependencyModuleList = new byte[48][];
                for (int i = 0; i < 48; i++)
                {
                    sci.DependencyModuleList[i] = reader.ReadBytes(8);
                }

                sci.SystemInfo = SystemInfo.Read(reader);
                return(sci);
            }
            catch
            {
                return(null);
            }
        }
Exemple #2
0
        /// <summary>
        /// Read from a stream and get code set info, if possible
        /// </summary>
        /// <param name="reader">BinaryReader representing the input stream</param>
        /// <returns>Code set info object, null on error</returns>
        public static CodeSetInfo Read(BinaryReader reader)
        {
            CodeSetInfo csi = new CodeSetInfo();

            try
            {
                csi.Address = reader.ReadBytes(4);
                csi.PhysicalRegionSizeInPages = reader.ReadUInt32();
                csi.SizeInBytes = reader.ReadUInt32();
                return(csi);
            }
            catch
            {
                return(null);
            }
        }