本文整理汇总了C#中ImageMap.AddItemWithSize方法的典型用法代码示例。如果您正苦于以下问题:C# ImageMap.AddItemWithSize方法的具体用法?C# ImageMap.AddItemWithSize怎么用?C# ImageMap.AddItemWithSize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageMap
的用法示例。
在下文中一共展示了ImageMap.AddItemWithSize方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateItem_MiddleOfEmptyRange
public void CreateItem_MiddleOfEmptyRange()
{
var map = new ImageMap(addrBase, 0x0100);
map.AddItemWithSize(
addrBase + 0x10,
new ImageMapItem(0x10) { DataType = new ArrayType(PrimitiveType.Byte, 10) });
map.Dump();
Assert.AreEqual(3, map.Items.Count);
ImageMapItem item;
Assert.IsTrue(map.TryFindItemExact(addrBase, out item));
Assert.AreEqual(0x10, item.Size);
Assert.IsInstanceOf<UnknownType>(item.DataType);
}
示例2: chkShowData_CheckedChanged
private void chkShowData_CheckedChanged(object sender, EventArgs e)
{
if (chkShowData.Checked)
{
var img = new LoadedImage(Address.Ptr32(0x00100000), new byte[2560]);
var imgMap = new ImageMap(img.BaseAddress, img.Length);
imgMap.AddItemWithSize(Address.Ptr32(0x00100000), new ImageMapBlock { Size = 30 });
imgMap.AddItemWithSize(Address.Ptr32(0x00100100), new ImageMapBlock { Size = 300 });
imgMap.AddItemWithSize(Address.Ptr32(0x00100500), new ImageMapBlock { Size = 600 });
memoryControl1.ProgramImage = img;
memoryControl1.Architecture = new X86ArchitectureFlat32();
imageMapView1.Image = img;
imageMapView1.ImageMap = imgMap;
}
else
{
memoryControl1.ProgramImage = null;
memoryControl1.Architecture = null;
}
}
示例3: CreateImageMapItem
private Address CreateImageMapItem(ImageMap map, DataType dt, Address addr = null)
{
addr = (addr != null) ? addr : map.Items.Keys.LastOrDefault();
var curAddr = (addr != null) ? addr : map.BaseAddress;
var size = (uint)dt.Size;
var imageMapItem = new ImageMapItem(size) { Address = curAddr };
if (dt != null)
imageMapItem.DataType = dt;
map.AddItemWithSize(curAddr, imageMapItem);
return imageMapItem.EndAddress;
}
示例4: ImageMap_CreateItem_AtExistingRange
public void ImageMap_CreateItem_AtExistingRange()
{
var map = new ImageMap(addrBase, 0x0100);
map.AddItemWithSize(
addrBase,
new ImageMapItem(0x10) { DataType = new ArrayType(PrimitiveType.Byte, 0x10) });
map.Dump();
ImageMapItem item;
Assert.IsTrue(map.TryFindItemExact(addrBase, out item));
Assert.AreEqual("(arr byte 16)", item.DataType.ToString());
Assert.IsTrue(map.TryFindItemExact(addrBase + 0x10, out item));
Assert.IsInstanceOf<UnknownType>(item.DataType);
}