当前位置: 首页>>代码示例>>C#>>正文


C# ImageMap.AddItemWithSize方法代码示例

本文整理汇总了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);
 }
开发者ID:nemerle,项目名称:reko,代码行数:13,代码来源:ImageMapTests.cs

示例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;

            }
        }
开发者ID:gitter-badger,项目名称:reko,代码行数:22,代码来源:MemoryControlDialog.cs

示例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;
        }
开发者ID:relaxar,项目名称:reko,代码行数:13,代码来源:ImageMapTests.cs

示例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);
 }
开发者ID:nemerle,项目名称:reko,代码行数:13,代码来源:ImageMapTests.cs


注:本文中的ImageMap.AddItemWithSize方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。