本文整理汇总了C#中IPEImage.CreateFullStream方法的典型用法代码示例。如果您正苦于以下问题:C# IPEImage.CreateFullStream方法的具体用法?C# IPEImage.CreateFullStream怎么用?C# IPEImage.CreateFullStream使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IPEImage
的用法示例。
在下文中一共展示了IPEImage.CreateFullStream方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Win32ResourcesPE
/// <summary>
/// Constructor
/// </summary>
/// <param name="peImage">The PE image</param>
/// <param name="rsrcReader">Reader for the whole Win32 resources section (usually
/// the .rsrc section) or <c>null</c> if we should create one from the resource data
/// directory in the optional header. This instance owns the reader.</param>
public Win32ResourcesPE(IPEImage peImage, IBinaryReader rsrcReader) {
this.rvaConverter = peImage;
this.dataReader = peImage.CreateFullStream();
if (rsrcReader != null)
this.rsrcReader = rsrcReader;
else {
var dataDir = peImage.ImageNTHeaders.OptionalHeader.DataDirectories[2];
if (dataDir.VirtualAddress != 0 && dataDir.Size != 0)
this.rsrcReader = peImage.CreateStream(dataDir.VirtualAddress, dataDir.Size);
else
this.rsrcReader = MemoryImageStream.CreateEmpty();
}
Initialize();
}
示例2: Initialize
void Initialize(IPEImage peImage) {
this.peImage = peImage;
this.peStream = peImage.CreateFullStream();
}
示例3: GetOrCreate
public AsmEdHexDocument GetOrCreate(IPEImage peImage)
{
var filename = GetFullPath(peImage.FileName);
lock (lockObj) {
AsmEdHexDocument doc;
if (filenameToDoc.TryGetValue(filename, out doc))
return doc;
using (var stream = peImage.CreateFullStream()) {
var data = stream.ReadAllBytes();
doc = new AsmEdHexDocument(data, filename);
filenameToDoc.Add(filename, doc);
return doc;
}
}
}
示例4: GetOrCreate
public AsmEdHexDocument GetOrCreate(IPEImage peImage) {
var filename = GetFullPath(peImage.FileName);
lock (lockObj) {
var doc = TryGet_NoLock(filename);
if (doc != null)
return doc;
using (var stream = peImage.CreateFullStream()) {
var data = stream.ReadAllBytes();
doc = new AsmEdHexDocument(data, filename);
filenameToDoc[filename] = new WeakReference(doc);
return doc;
}
}
}
示例5: GetOrCreate
HexBuffer GetOrCreate(IPEImage peImage) {
var filename = GetFullPath(peImage.FileName);
HexBuffer buffer;
lock (lockObj) {
buffer = TryGet_NoLock(filename);
if (buffer != null)
return buffer;
using (var stream = peImage.CreateFullStream()) {
var data = stream.ReadAllBytes();
buffer = hexBufferFactoryService.Create(data, filename, hexBufferFactoryService.DefaultFileTags);
filenameToBuffer[filename] = new WeakReference(buffer);
}
}
return NotifyBufferCreated(buffer);
}