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


C# ImageMap.TryFindSegment方法代码示例

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


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