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


C# IProcessorArchitecture.CreateFrame方法代码示例

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


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

示例1: Win32Platform

        //$TODO: http://www.delorie.com/djgpp/doc/rbinter/ix/29.html int 29 for console apps!
        //$TODO: http://msdn.microsoft.com/en-us/data/dn774154(v=vs.99).aspx

		public Win32Platform(IServiceProvider services, IProcessorArchitecture arch) : base(services, arch)
		{
            int3svc = new SystemService
            {
                SyscallInfo = new SyscallInfo
                {
                    Vector = 3,
                    RegisterValues = new RegValue[0],
                },
                Name = "int3",
                Signature = new ProcedureSignature(null, new Identifier[0]),
                Characteristics = new ProcedureCharacteristics(),
            };
            var frame = arch.CreateFrame();
            int29svc = new SystemService
            {
                SyscallInfo = new SyscallInfo
                {
                    Vector = 0x29,
                    RegisterValues = new RegValue[0]
                },
                Name = "__fastfail",
                Signature = new ProcedureSignature(
                    null,
                    frame.EnsureRegister(Registers.ecx)), //$bug what about win64?
                Characteristics = new ProcedureCharacteristics
                {
                    Terminates = true
                }
            };
        }
开发者ID:melbcat,项目名称:reko,代码行数:34,代码来源:Win32Platform.cs

示例2: Build

		public SystemService Build(IProcessorArchitecture arch)
		{
			SystemService svc = new SystemService();
			svc.Name = Name;
			svc.SyscallInfo = new SyscallInfo();
			svc.SyscallInfo.Vector = Convert.ToInt32(SyscallInfo.Vector, 16);
			if (SyscallInfo.RegisterValues != null)
			{
				svc.SyscallInfo.RegisterValues = new RegValue[SyscallInfo.RegisterValues.Length];
				for (int i = 0; i < SyscallInfo.RegisterValues.Length; ++i)
				{
                    svc.SyscallInfo.RegisterValues[i] = new RegValue
                    {
                        Register = arch.GetRegister(SyscallInfo.RegisterValues[i].Register),
                        Value = Convert.ToInt32(SyscallInfo.RegisterValues[i].Value, 16),
                    };
				}
			}
			else
			{
				svc.SyscallInfo.RegisterValues = new RegValue[0];
			}
            TypeLibraryLoader loader = new TypeLibraryLoader(arch, true);
			ProcedureSerializer sser = arch.CreateProcedureSerializer(loader, "stdapi");
            svc.Signature = sser.Deserialize(Signature, arch.CreateFrame());
			svc.Characteristics = Characteristics != null ? Characteristics : DefaultProcedureCharacteristics.Instance;
			return svc;
		}
开发者ID:killbug2004,项目名称:reko,代码行数:28,代码来源:SerializedService.cs

示例3: Init

 private void Init(IProcessorArchitecture arch, string name, Dictionary<string, Block> blocks)
 {
     if (arch == null)
         throw new ArgumentNullException("arch");
     this.Architecture = arch;
     this.Procedure = new Procedure(name, arch.CreateFrame());
     this.blocks = blocks ?? new Dictionary<string, Block>();
     this.unresolvedProcedures = new List<ProcUpdater>();
     BuildBody();
 }
开发者ID:killbug2004,项目名称:reko,代码行数:10,代码来源:ProcedureBuilder.cs

示例4: Win32Platform

 //$TODO: http://www.delorie.com/djgpp/doc/rbinter/ix/29.html int 29 for console apps!
 //$TODO: http://msdn.microsoft.com/en-us/data/dn774154(v=vs.99).aspx
 public Win32Platform(IServiceProvider services, IProcessorArchitecture arch)
     : base(services, arch)
 {
     //$REVIEW: should probably be loaded from configuration.
     Heuristics.ProcedurePrologs = new BytePattern[] {
         new BytePattern
         {
             Bytes = new byte[]{ 0x55, 0x8B, 0xEC },
             Mask =  new byte[]{ 0xFF, 0xFF, 0xFF }
         }
     };
     int3svc = new SystemService
     {
         SyscallInfo = new SyscallInfo
         {
             Vector = 3,
             RegisterValues = new RegValue[0],
         },
         Name = "int3",
         Signature = new ProcedureSignature(null, new Identifier[0]),
         Characteristics = new ProcedureCharacteristics(),
     };
     var frame = arch.CreateFrame();
     int29svc = new SystemService
     {
         SyscallInfo = new SyscallInfo
         {
             Vector = 0x29,
             RegisterValues = new RegValue[0]
         },
         Name = "__fastfail",
         Signature = new ProcedureSignature(
             null,
             frame.EnsureRegister(Registers.ecx)), //$bug what about win64?
         Characteristics = new ProcedureCharacteristics
         {
             Terminates = true
         }
     };
 }
开发者ID:feelworld,项目名称:reko,代码行数:42,代码来源:Win32Platform.cs

示例5: Win32Platform

        //$TODO: http://www.delorie.com/djgpp/doc/rbinter/ix/29.html int 29 for console apps!
        //$TODO: http://msdn.microsoft.com/en-us/data/dn774154(v=vs.99).aspx

        //$TODO: we need a Win32Base platform, possibly with a Windows base platform, and make this
        // x86-specific.
        public Win32Platform(IServiceProvider services, IProcessorArchitecture arch) : base(services, arch, "win32")
        {
            var frame = arch.CreateFrame();
            this.services = new Dictionary<int, SystemService>
            {
                {
                    3,
                    new SystemService
                    {
                        SyscallInfo = new SyscallInfo
                        {
                            Vector = 3,
                            RegisterValues = new RegValue[0],
                        },
                        Name = "int3",
                        Signature = FunctionType.Action(new Identifier[0]),
                        Characteristics = new ProcedureCharacteristics(),
                    }
                },
                {
                    0x29,
                    new SystemService
                    {
                        SyscallInfo = new SyscallInfo
                        {
                            Vector = 0x29,
                            RegisterValues = new RegValue[0]
                        },
                        Name = "__fastfail",
                        Signature = new FunctionType(
                            null,
                            frame.EnsureRegister(Registers.ecx)),
                        Characteristics = new ProcedureCharacteristics
                        {
                            Terminates = true
                        }
                    }
                }
            };
        }
开发者ID:uxmal,项目名称:reko,代码行数:45,代码来源:Win32Platform.cs

示例6: SignatureFromName

 /// <summary>
 /// Guesses the signature of a procedure based on its name.
 /// </summary>
 /// <param name="fnName"></param>
 /// <param name="loader"></param>
 /// <param name="arch"></param>
 /// <returns></returns>
 public static ProcedureSignature SignatureFromName(string fnName, TypeLibraryLoader loader, IProcessorArchitecture arch)
 {
     int argBytes;
     if (fnName[0] == '_')
     {
         // Win32 prefixes cdecl and stdcall functions with '_'. Stdcalls will have @<nn> 
         // where <nn> is the number of bytes pushed on the stack. If 0 bytes are pushed
         // the result is indistinguishable from the corresponding cdecl call, which is OK.
         int lastAt = fnName.LastIndexOf('@');
         if (lastAt < 0)
             return CdeclSignature(fnName.Substring(1), arch);
         string name = fnName.Substring(1, lastAt - 1);
         if (!Int32.TryParse(fnName.Substring(lastAt + 1), out argBytes))
             return CdeclSignature(name, arch);
         else
             return StdcallSignature(name, argBytes, arch);
     }
     else if (fnName[0] == '@')
     {
         // Win32 prefixes fastcall functions with '@'.
         int lastAt = fnName.LastIndexOf('@');
         if (lastAt <= 0)
             return CdeclSignature(fnName.Substring(1), arch);
         string name = fnName.Substring(1, lastAt - 1);
         if (!Int32.TryParse(fnName.Substring(lastAt + 1), out argBytes))
             return CdeclSignature(name, arch);
         else
             return FastcallSignature(name, argBytes, arch);
     }
     else if (fnName[0] == '?')
     {
         // Microsoft-mangled signatures begin with '?'
         var pmnp = new MsMangledNameParser(fnName);
         StructField_v1 field = null;
         try
         {
             field = pmnp.Parse();
         }
         catch (Exception ex)
         {
             Debug.Print("*** Error parsing {0}. {1}", fnName, ex.Message);
             pmnp.ToString();
             return null;
         }
         var sproc = field.Type as SerializedSignature;
         if (sproc != null)
         {
             var sser = arch.CreateProcedureSerializer(loader, "__cdecl");
             return sser.Deserialize(sproc, arch.CreateFrame());    //$BUGBUG: catch dupes?   
         }
     }
     return null;
 }
开发者ID:gh0std4ncer,项目名称:reko,代码行数:60,代码来源:SignatureGuesser.cs


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