本文整理汇总了C#中ImageMap.TryFindSegment方法的典型用法代码示例。如果您正苦于以下问题:C# ImageMap.TryFindSegment方法的具体用法?C# ImageMap.TryFindSegment怎么用?C# ImageMap.TryFindSegment使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ImageMap
的用法示例。
在下文中一共展示了ImageMap.TryFindSegment方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Dump
public void Dump(Program program, ImageMap map, TextWriter stm)
{
ImageMapSegment segment = null;
if (map == null)
{
DumpAssembler(program.Image, program.Image.BaseAddress, program.Image.BaseAddress + (uint)program.Image.Length, stm);
}
else
{
foreach (ImageMapItem i in map.Items.Values)
{
if (!program.Image.IsValidAddress(i.Address))
continue;
ImageMapSegment seg;
if (!map.TryFindSegment(i.Address, out seg))
continue;
if (seg != segment)
{
segment = seg;
stm.WriteLine(";;; Segment {0} ({1})", seg.Name, seg.Address);
}
// Address addrLast = i.Address + i.Size;
ImageMapBlock block = i as ImageMapBlock;
if (block != null)
{
stm.WriteLine();
if (program.Procedures.ContainsKey(block.Address))
{
stm.WriteLine(block.Address.GenerateName("fn","()"));
}
else
{
stm.WriteLine(block.Address.GenerateName("l",":"));
}
DumpAssembler(program.Image, block.Address, block.Address + block.Size, stm);
continue;
}
ImageMapVectorTable table = i as ImageMapVectorTable;
if (table != null)
{
stm.WriteLine("{0} table at {1} ({2} bytes)",
table.IsCallTable?"Call":"Jump",
table.Address, table.Size);
foreach (Address addr in table.Addresses)
{
stm.WriteLine("\t{0}", addr != null ? addr.ToString() : "-- null --");
}
DumpData(program.Image, i.Address, i.Size, stm);
}
else
{
var segLast = segment.Address + segment.ContentSize;
var size = segLast - i.Address;
size = Math.Min(i.Size, size);
DumpData(program.Image, i.Address, size, stm);
}
}
}
}