示例#1
0
文件: PEImage.cs 项目: sthiy/dnlib
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="imageStreamCreator">The PE stream creator</param>
 /// <param name="imageLayout">Image layout</param>
 /// <param name="verify">Verify PE file data</param>
 public PEImage(IImageStreamCreator imageStreamCreator, ImageLayout imageLayout, bool verify)
 {
     try {
         this.imageStreamCreator = imageStreamCreator;
         this.peType = ConvertImageLayout(imageLayout);
         ResetReader();
         this.peInfo = new PEInfo(imageStream, verify);
         Initialize();
     }
     catch {
         Dispose();
         throw;
     }
 }
示例#2
0
			/// <inheritdoc/>
			public FileOffset ToFileOffset(PEInfo peInfo, RVA rva) {
				return (FileOffset)rva;
			}
示例#3
0
			/// <inheritdoc/>
			public RVA ToRVA(PEInfo peInfo, FileOffset offset) {
				return (RVA)offset;
			}
示例#4
0
			/// <inheritdoc/>
			public FileOffset ToFileOffset(PEInfo peInfo, RVA rva) {
				return peInfo.ToFileOffset(rva);
			}
示例#5
0
			/// <inheritdoc/>
			public RVA ToRVA(PEInfo peInfo, FileOffset offset) {
				return peInfo.ToRVA(offset);
			}
示例#6
0
		/// <inheritdoc/>
		public void Dispose() {
			IDisposable id;
			if (win32Resources.IsValueInitialized && (id = win32Resources.Value) != null)
				id.Dispose();
			if ((id = imageStream) != null)
				id.Dispose();
			if ((id = imageStreamCreator) != null)
				id.Dispose();
			win32Resources.Value = null;
			imageStream = null;
			imageStreamCreator = null;
			peType = null;
			peInfo = null;
		}
示例#7
0
		/// <inheritdoc/>
		public void Dispose() {
			if (win32Resources.IsValueInitialized && win32Resources.Value != null)
				win32Resources.Value.Dispose();
			if (imageStream != null)
				imageStream.Dispose();
			if (imageStreamCreator != null)
				imageStreamCreator.Dispose();
			win32Resources.Value = null;
			imageStream = null;
			imageStreamCreator = null;
			peType = null;
			peInfo = null;
		}
示例#8
0
 /// <inheritdoc/>
 public FileOffset ToFileOffset(PEInfo peInfo, RVA rva)
 {
     return((FileOffset)rva);
 }
示例#9
0
 /// <inheritdoc/>
 public FileOffset ToFileOffset(PEInfo peInfo, RVA rva)
 {
     return(peInfo.ToFileOffset(rva));
 }
示例#10
0
 /// <inheritdoc/>
 public RVA ToRVA(PEInfo peInfo, FileOffset offset)
 {
     return((RVA)offset);
 }
示例#11
0
 /// <inheritdoc/>
 public RVA ToRVA(PEInfo peInfo, FileOffset offset)
 {
     return(peInfo.ToRVA(offset));
 }
示例#12
0
 public FileOffset?ToFileOffset(PEInfo peInfo, RVA rva) => (FileOffset)rva;
示例#13
0
 public RVA?ToRVA(PEInfo peInfo, FileOffset offset) => (RVA)offset;
示例#14
0
 public FileOffset?ToFileOffset(PEInfo peInfo, RVA rva) => peInfo.ToFileOffset(rva);
示例#15
0
 public RVA?ToRVA(PEInfo peInfo, FileOffset offset) => peInfo.ToRVA(offset);