/// <summary>
		/// Constructor
		/// </summary>
		/// <param name="reader">PE file reader pointing to the start of this section</param>
		/// <param name="verify">Verify section</param>
		/// <exception cref="BadImageFormatException">Thrown if verification fails</exception>
		public ImageNTHeaders(IImageStream reader, bool verify) {
			SetStartOffset(reader);
			this.signature = reader.ReadUInt32();
			if (verify && this.signature != 0x4550)
				throw new BadImageFormatException("Invalid NT headers signature");
			this.imageFileHeader = new ImageFileHeader(reader, verify);
			this.imageOptionalHeader = CreateImageOptionalHeader(reader, verify);
			SetEndoffset(reader);
		}
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="reader">PE file reader pointing to the start of this section</param>
 /// <param name="verify">Verify section</param>
 /// <exception cref="BadImageFormatException">Thrown if verification fails</exception>
 public ImageNTHeaders(IImageStream reader, bool verify)
 {
     SetStartOffset(reader);
     this.signature = reader.ReadUInt32();
     if (verify && this.signature != 0x4550)
     {
         throw new BadImageFormatException("Invalid NT headers signature");
     }
     this.imageFileHeader     = new ImageFileHeader(reader, verify);
     this.imageOptionalHeader = CreateImageOptionalHeader(reader, verify);
     SetEndoffset(reader);
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="reader">PE file reader pointing to the start of this section</param>
 /// <param name="verify">Verify section</param>
 /// <exception cref="BadImageFormatException">Thrown if verification fails</exception>
 public ImageNTHeaders(ref DataReader reader, bool verify)
 {
     SetStartOffset(ref reader);
     signature = reader.ReadUInt32();
     // Mono only checks the low 2 bytes
     if (verify && (ushort)signature != 0x4550)
     {
         throw new BadImageFormatException("Invalid NT headers signature");
     }
     imageFileHeader     = new ImageFileHeader(ref reader, verify);
     imageOptionalHeader = CreateImageOptionalHeader(ref reader, verify);
     SetEndoffset(ref reader);
 }
Example #4
0
		public ImageFileHeaderNode(HexBuffer buffer, ImageFileHeader fileHeader)
			: base(HexSpan.FromBounds((ulong)fileHeader.StartOffset, (ulong)fileHeader.EndOffset)) {
			imageFileHeaderVM = new ImageFileHeaderVM(buffer, Span.Start);
		}
 public ImageFileHeaderTreeNode(HexDocument doc, ImageFileHeader fileHeader)
     : base((ulong)fileHeader.StartOffset, (ulong)fileHeader.EndOffset - 1)
 {
     this.imageFileHeaderVM = new ImageFileHeaderVM(doc, StartOffset);
 }