コード例 #1
0
        /// <summary>
        /// Read the file
        /// </summary>
        public void Read()
        {
            if (this.ReaderStrategy == null)
            {
                throw new ArgumentNullException("ReaderStrategy");
            }
            if (this.ReaderProperty == null)
            {
                throw new ArgumentNullException("ReaderProperty");
            }

            // Open
            this.ReaderStrategy.Open();

            // Get file type
            this.TypeOfCOFF = this.FindCOFFFileType();

            // Check if this is a PE/COFF file; if not then return
            if (this.TypeOfCOFF == EnumCOFFFileType.NONE)
            {
                throw new NotSupportedException("This is not COFF file");
            }

            this.FileLayoutBrowse = FactoryCOFFFileBrowse.Browser(this.TypeOfCOFF, this.ReaderStrategy);

            this.FileLayoutBrowse.Read(this.ReaderStrategy);



            // Close file
            this.ReaderStrategy.Close();
        }
コード例 #2
0
        internal void ReadCOFFFile(EnumCOFFFileType fileType)
        {
            ICOFFFileLayoutBrowse browser = FactoryCOFFFileBrowse.Browser(fileType);

            browser.Read(this.ReaderStrategy);
        }