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


C# IntelArchitecture.CreateFrame方法代码示例

本文整理汇总了C#中Reko.Arch.X86.IntelArchitecture.CreateFrame方法的典型用法代码示例。如果您正苦于以下问题:C# IntelArchitecture.CreateFrame方法的具体用法?C# IntelArchitecture.CreateFrame怎么用?C# IntelArchitecture.CreateFrame使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Reko.Arch.X86.IntelArchitecture的用法示例。


在下文中一共展示了IntelArchitecture.CreateFrame方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Setup

		public void Setup()
		{
            var arch = new IntelArchitecture(ProcessorMode.Protected32);
			f = arch.CreateFrame();
            liveness = new IdentifierLiveness(arch);
			isLiveHelper = new RegisterLiveness.IsLiveHelper(arch);
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:IsLiveHelperTests.cs

示例2: Fstsw_Setup

 public void Fstsw_Setup()
 {
     arch = new IntelArchitecture(ProcessorMode.Protected32);
     asm = new X86Assembler(arch, Address.Ptr32(0x10000), new List<EntryPoint>());
     Procedure proc = new Procedure("test", arch.CreateFrame());
     orw = new OperandRewriter32(arch, proc.Frame, null);
     emitter = new ProcedureBuilder();
 }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:8,代码来源:FstswChainMatcherTests.cs

示例3: TestGrfWithOneBit

 public void TestGrfWithOneBit()
 {
     IProcessorArchitecture arch = new IntelArchitecture(ProcessorMode.Real);
     SignatureBuilder sb = new SignatureBuilder(null, arch);
     sb.AddFlagGroupReturnValue((uint) FlagM.CF, arch.CreateFrame());
     ProcedureSignature sig = sb.BuildSignature();
     Assert.AreEqual("bool", sig.ReturnValue.DataType.ToString());
 }
开发者ID:nemerle,项目名称:reko,代码行数:8,代码来源:SignatureBuilderTests.cs

示例4: Fstsw_Setup

 public void Fstsw_Setup()
 {
     arch = new X86ArchitectureFlat32();
     asm = new X86Assembler(null, new DefaultPlatform(null, new X86ArchitectureFlat32()), Address.Ptr32(0x10000), new List<ImageSymbol>());
     Procedure proc = new Procedure("test", arch.CreateFrame());
     orw = new OperandRewriter32(arch, proc.Frame, null);
     emitter = new ProcedureBuilder();
 }
开发者ID:relaxar,项目名称:reko,代码行数:8,代码来源:FstswChainMatcherTests.cs

示例5: ApplicationBuilderTests

 public ApplicationBuilderTests()
 {
     arch = new IntelArchitecture(ProcessorMode.Protected32);
     frame = arch.CreateFrame();
     ret = frame.EnsureRegister(Registers.eax);
     arg04 = new Identifier("arg04",   PrimitiveType.Word32, new StackArgumentStorage(4, PrimitiveType.Word32));
     arg08 = new Identifier("arg08",   PrimitiveType.Word16, new StackArgumentStorage(8, PrimitiveType.Word16));
     arg0C = new Identifier("arg0C",   PrimitiveType.Byte, new StackArgumentStorage(0x0C, PrimitiveType.Byte));
     regOut = new Identifier("edxOut", PrimitiveType.Word32, new OutArgumentStorage(frame.EnsureRegister(Registers.edx)));
     sig = new ProcedureSignature(ret,
         new Identifier[] { arg04, arg08, arg0C, regOut });
 }
开发者ID:nemerle,项目名称:reko,代码行数:12,代码来源:ApplicationBuilderTests.cs

示例6: Setup

		public void Setup()
		{
            var sc = new ServiceContainer();
            sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
			arch = new IntelArchitecture(ProcessorMode.Real);
            platform = new MsdosPlatform(sc, arch);
			sigser = new X86ProcedureSerializer(
                arch, 
                new TypeLibraryDeserializer(platform, true, new TypeLibrary()),
                "stdapi");
            argser = new ArgumentSerializer(sigser, arch, arch.CreateFrame(), null);
		}
开发者ID:gitter-badger,项目名称:reko,代码行数:12,代码来源:ArgumentSerializerTests.cs

示例7: ApplicationBuilderTests

		public ApplicationBuilderTests()
		{
			arch = new X86ArchitectureFlat32();
            frame = arch.CreateFrame();
			ret = frame.EnsureRegister(Registers.eax);
			arg04 = new Identifier("arg04",   PrimitiveType.Word32, new StackArgumentStorage(4, PrimitiveType.Word32));
			arg08 = new Identifier("arg08",   PrimitiveType.Word16, new StackArgumentStorage(8, PrimitiveType.Word16));
			arg0C = new Identifier("arg0C",   PrimitiveType.Byte, new StackArgumentStorage(0x0C, PrimitiveType.Byte));
			regOut = new Identifier("edxOut", PrimitiveType.Word32, new OutArgumentStorage(frame.EnsureRegister(Registers.edx)));
            sig = new FunctionType(
                ret,
                new Identifier[] { arg04, arg08, arg0C, regOut });
        }
开发者ID:relaxar,项目名称:reko,代码行数:13,代码来源:ApplicationBuilderTests.cs

示例8: Setup

        public void Setup()
        {
            arch = new IntelArchitecture(ProcessorMode.Real);
            var image = new LoadedImage(Address.Ptr32(0x10000), new byte[4]);
            var prog = new Program(
                image,
                image.CreateImageMap(),
                arch,
                null);
            var procAddress = Address.Ptr32(0x10000000);
            instr = new X86Instruction(Opcode.nop, PrimitiveType.Word16, PrimitiveType.Word16)
            {
                Address = procAddress,
            };

            proc = Procedure.Create(procAddress, arch.CreateFrame());
            orw = new OperandRewriter16(arch, proc.Frame, new FakeRewriterHost(prog));
            state = (X86State)arch.CreateProcessorState();
        }
开发者ID:nemerle,项目名称:reko,代码行数:19,代码来源:OperandRewriterRealModeTests.cs

示例9: Setup

		public void Setup()
		{
			arch = new X86ArchitectureReal();
            var mem = new MemoryArea(Address.Ptr32(0x10000), new byte[4]);
			var prog = new Program(
                new SegmentMap(
                    mem.BaseAddress,
                    new ImageSegment(
                        "code", mem, AccessMode.ReadWriteExecute)),
                arch,
                new DefaultPlatform(null, arch));
			var procAddress = Address.Ptr32(0x10000000);
            instr = new X86Instruction(Opcode.nop, PrimitiveType.Word16, PrimitiveType.Word16)
            {
                Address = procAddress,
            };

            proc = Procedure.Create(procAddress, arch.CreateFrame());
			orw = new OperandRewriter16(arch, proc.Frame, new FakeRewriterHost(prog));
            state = (X86State)arch.CreateProcessorState();
        }
开发者ID:relaxar,项目名称:reko,代码行数:21,代码来源:OperandRewriterRealModeTests.cs

示例10: Setup

 public void Setup()
 {
     mr = new MockRepository();
     var sc = new ServiceContainer();
     sc.AddService<IFileSystemService>(new FileSystemServiceImpl());
     arch = new X86ArchitectureReal();
     platform = new MsdosPlatform(sc, arch);
     sigser = mr.Stub<ProcedureSerializer>(
         arch,
         new TypeLibraryDeserializer(platform, true, new TypeLibrary()),
         "stdapi");
     argser = new ArgumentDeserializer(
         sigser,
         arch,
         arch.CreateFrame(),
         // It's possible that old, hand-written assembler passes
         // arguments on unaligned offsets
         13,
         4);
     mr.ReplayAll();
 }
开发者ID:relaxar,项目名称:reko,代码行数:21,代码来源:ArgumentDeserializerTests.cs

示例11: Setup

 public void Setup()
 {
     var arch = new IntelArchitecture(ProcessorMode.Real);
     proc = Procedure.Create("foo", Address.Ptr32(0x100), arch.CreateFrame());
     alias = new Aliases(proc, arch);
 }
开发者ID:nemerle,项目名称:reko,代码行数:6,代码来源:AliasTests.cs

示例12: BuildTest

 private void BuildTest(IntelArchitecture arch, Address addr, IPlatform platform, Action<X86Assembler> m)
 {
     proc = new Procedure("test", arch.CreateFrame());
     block = proc.AddBlock("testblock");
     this.state = arch.CreateProcessorState();
     var asm = new X86Assembler(sc, new DefaultPlatform(sc, arch), addr, new List<ImageSymbol>());
     scanner = mr.StrictMock<IScanner>();
     scanner.Stub(s => s.Services).Return(sc);
     m(asm);
     lr = asm.GetImage();
     host = new RewriterHost(
         asm.ImportReferences,
         new Dictionary<string, FunctionType>
         {
             {
                 "GetDC",
                 new FunctionType(
                     new Identifier("", new Pointer(VoidType.Instance, 4), new RegisterStorage("eax", 0, 0, PrimitiveType.Word32)),
                     new [] {
                         new Identifier("arg",
                             new TypeReference(
                                 "HWND",
                                 new Pointer(VoidType.Instance, 4)),
                             new StackArgumentStorage(4, new TypeReference(
                                 "HWND",
                                 new Pointer(VoidType.Instance, 4))))
                     })
                 {
                     StackDelta = 4,
                 }
             }
        },
        new Dictionary<string, DataType>());
     var rw = arch.CreateRewriter(
         lr.SegmentMap.Segments.Values.First().MemoryArea.CreateLeReader(addr), 
         this.state, 
         proc.Frame,
         host);
     this.program = new Program
     {
         Architecture = arch,
         SegmentMap = lr.SegmentMap,
         ImageMap = lr.ImageMap,
         Platform = platform,
     };
     using (mr.Record())
     {
         scanner.Stub(x => x.FindContainingBlock(Arg<Address>.Is.Anything)).Return(block);
         scanner.Stub(x => x.GetTrace(null, null, null)).IgnoreArguments().Return(rw);
         scanner.Stub(x => x.Services).Return(sc);
     }
     wi = new BlockWorkitem(scanner, program, state, addr);
 }
开发者ID:relaxar,项目名称:reko,代码行数:53,代码来源:BlockWorkitem.X86Tests.cs

示例13: Setup

 public void Setup()
 {
     var arch = new IntelArchitecture(ProcessorMode.Real);
     proc = new Procedure("foo", arch.CreateFrame());
     alias = new Aliases(proc, arch);
 }
开发者ID:melbcat,项目名称:reko,代码行数:6,代码来源:AliasTests.cs

示例14: BuildTest

        private void BuildTest(IntelArchitecture arch, Address addr, IPlatform platform, Action<X86Assembler> m)
        {
            this.arch = new IntelArchitecture(ProcessorMode.Protected32);
            proc = new Procedure("test", arch.CreateFrame());
            block = proc.AddBlock("testblock");
            this.state = arch.CreateProcessorState();
            var asm = new X86Assembler(sc, new DefaultPlatform(sc, arch), addr, new List<EntryPoint>());
            scanner = mr.StrictMock<IScanner>();
            m(asm);
            lr = asm.GetImage();
            host = new RewriterHost(asm.ImportReferences,
                new Dictionary<string, ProcedureSignature>
                {
                {
                    "GetDC", 
                    new ProcedureSignature(
                        new Identifier("", new Pointer(VoidType.Instance, 4), new RegisterStorage("eax", 0, 0, PrimitiveType.Word32)),
                        new Identifier("arg", 
                            new TypeReference(
                                "HWND",
                                new Pointer(VoidType.Instance, 4)),
                            new StackArgumentStorage(0, new TypeReference(
                                "HWND",
                                new Pointer(VoidType.Instance, 4)))))
                                {
                                    StackDelta = 4,
}
                }
              });
            var rw = arch.CreateRewriter(lr.Image.CreateLeReader(addr), this.state, proc.Frame, host);
            var prog = new Program
            {
                Architecture = arch,
                Image = lr.Image,
                ImageMap = lr.ImageMap,
                Platform = platform,
            };
            using (mr.Record())
            {
                scanner.Stub(x => x.FindContainingBlock(Arg<Address>.Is.Anything)).Return(block);
                scanner.Stub(x => x.GetTrace(null, null, null)).IgnoreArguments().Return(rw);
            }
            wi = new BlockWorkitem(scanner, prog, state, addr);
        }
开发者ID:gitter-badger,项目名称:reko,代码行数:44,代码来源:BlockWorkitem.X86Tests.cs

示例15: Setup

		public void Setup()
		{
			arch = new IntelArchitecture(ProcessorMode.Real);
			sigser = new X86ProcedureSerializer(arch, new TypeLibraryLoader(arch, true), "stdapi");
            argser = new ArgumentSerializer(sigser, arch, arch.CreateFrame(), null);
		}
开发者ID:gh0std4ncer,项目名称:reko,代码行数:6,代码来源:ArgumentSerializerTests.cs


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