• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# SerializedSignature类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中SerializedSignature的典型用法代码示例。如果您正苦于以下问题:C# SerializedSignature类的具体用法?C# SerializedSignature怎么用?C# SerializedSignature使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SerializedSignature类属于命名空间,在下文中一共展示了SerializedSignature类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: Parse

        public void Parse(string signatureString)
        {
            this.str = signatureString;
            idx = 0;
            try
            {
                var ret = ParseReturn();
                var procName = ParseProcedureName();
                if (procName == null)
                    return;
                var procArgs = ParseProcedureArgs();
                if (procArgs == null)
                    return;

                ProcedureName = procName;
                Signature = new SerializedSignature();
                Signature.ReturnValue = ret;
                Signature.Arguments = procArgs;
                IsValid = true;
            }
            catch
            {
                IsValid = false;
            }
        }
开发者ID:gitter-badger,项目名称:reko,代码行数:25,代码来源:SignatureParser.cs


示例2: Given_Sig

 private void Given_Sig(SerializedType ret, params Argument_v1 [] args)
 {
     ssig = new SerializedSignature
     {
         ReturnValue = new Argument_v1 { Type = ret }
     };
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:7,代码来源:MipsProcedureSerializerTests.cs


示例3: Deserialize

        public override ProcedureSignature Deserialize(SerializedSignature ss, Frame frame)
        {
            if (ss == null)
                return null;
            this.argser = new ArgumentSerializer(this, Architecture, frame, ss.Convention);
            Identifier ret = null;
            int fpuDelta = FpuStackOffset;

            FpuStackOffset = 0;
            if (ss.ReturnValue != null)
            {
                ret = argser.DeserializeReturnValue(ss.ReturnValue);
                fpuDelta += FpuStackOffset;
            }

            FpuStackOffset = 0;
            var args = new List<Identifier>();
            if (ss.Arguments != null)
            {
                for (int iArg = 0; iArg < ss.Arguments.Length; ++iArg)
                {
                    var sArg = ss.Arguments[iArg];
                    var arg = DeserializeArgument(sArg, iArg, ss.Convention);
                    args.Add(arg);
                }
                fpuDelta -= FpuStackOffset;
            }
            FpuStackOffset = fpuDelta;

            var sig = new ProcedureSignature(ret, args.ToArray());
            ApplyConvention(ss, sig);
            return sig;
        }
开发者ID:feelworld,项目名称:reko,代码行数:33,代码来源:X86_64ProcedureSerializer.cs


示例4: Deserialize

        public override FunctionType Deserialize(SerializedSignature ss, Frame frame)
        {
            if (ss == null)
                return new FunctionType();
            if (ss == null)
                return null;
            var argser = new ArgumentDeserializer(this, Architecture, frame, 0, Architecture.WordWidth.Size);
            Identifier ret = null;

            if (ss.ReturnValue != null)
            {
                ret = argser.DeserializeReturnValue(ss.ReturnValue);
            }

            var args = new List<Identifier>();
            this.gr = 0;
            if (ss.Arguments != null)
            {
                for (int iArg = 0; iArg < ss.Arguments.Length; ++iArg)
                {
                    var sArg = ss.Arguments[iArg];
                    Identifier arg = DeserializeArgument(argser, sArg);
                    args.Add(arg);
                }
            }

            var sig = new FunctionType(ret, args.ToArray());
            return sig;
        }
开发者ID:relaxar,项目名称:reko,代码行数:29,代码来源:Rt11ProcedureSerializer.cs


示例5: Deserialize

        public override ProcedureSignature Deserialize(SerializedSignature ss, Frame frame)
        {
            if (ss == null)
                return null;
            var argser = new ArgumentSerializer(this, Architecture, frame, ss.Convention);
            Identifier ret = null;

            if (ss.ReturnValue != null)
            {
                ret = argser.DeserializeReturnValue(ss.ReturnValue);
            }

            var args = new List<Identifier>();
            if (ss.Arguments != null)
            {
                for (int iArg = 0; iArg < ss.Arguments.Length; ++iArg)
                {
                    var sArg = ss.Arguments[iArg];
                    Identifier arg = argser.Deserialize(sArg);
                    args.Add(arg);
                }
            }

            var sig = new ProcedureSignature(ret, args.ToArray());
            return sig;
        }
开发者ID:gitter-badger,项目名称:reko,代码行数:26,代码来源:M68kProcedureSerializer.cs


示例6: Dec_LoadCallSignatures

        public void Dec_LoadCallSignatures()
        {
            var arch = new X86ArchitectureReal();
            Program program = new Program { 
                Architecture = arch,
                Platform = new MsdosPlatform(sc, arch)
            };
            decompiler.Project = new Project
            {
                Programs = { program },
            };
            SerializedSignature sig = new SerializedSignature();
            sig.Arguments = new Argument_v1[] {
			    new Argument_v1 {
			        Kind = new Register_v1("ds")
                },
                new Argument_v1 {
			        Kind = new Register_v1("bx"),
                }
            };
            var al = new List<SerializedCall_v1> {
                new SerializedCall_v1(Address.SegPtr(0x0C32, 0x3200), sig)
            };
            var sigs = decompiler.LoadCallSignatures(program, al);

            FunctionType ps = sigs[Address.SegPtr(0x0C32, 0x3200)];
            Assert.IsNotNull(ps, "Expected a call signature for address");
        }
开发者ID:relaxar,项目名称:reko,代码行数:28,代码来源:DecompilerTests.cs


示例7: Dec_LoadCallSignatures

        public void Dec_LoadCallSignatures()
        {
            var arch = new IntelArchitecture(ProcessorMode.Real);
            Program program = new Program {
                Architecture = arch,
                Platform = new MsdosPlatform(null, arch)
            };
            decompiler.Project = new Project
            {
                Programs = { program },
            };
            List<SerializedCall_v1> al = new List<SerializedCall_v1>();
            SerializedSignature sig = new SerializedSignature();
            sig.Arguments = new Argument_v1[] {
                new Argument_v1 {
                    Kind = new Register_v1("ds")
                },
                new Argument_v1 {
                    Kind = new Register_v1("bx"),
                }
            };
            al.Add(new SerializedCall_v1(Address.SegPtr(0x0C32, 0x3200), sig));
            var sigs = decompiler.LoadCallSignatures(program, al);

            ProcedureSignature ps = sigs[Address.SegPtr(0x0C32, 0x3200)];
            Assert.IsNotNull(ps, "Expected a call signature for address");
        }
开发者ID:feelworld,项目名称:reko,代码行数:27,代码来源:DecompilerTests.cs


示例8: VoidFunctionSignature

		public void VoidFunctionSignature()
		{
			SerializedSignature sig = new SerializedSignature();
            Given_X86ProcedureSerializer();
            ProcedureSignature ps = ser.Deserialize(sig, arch.CreateFrame());
			Assert.AreEqual("void foo()", ps.ToString("foo"));
			Assert.IsTrue(ps.ParametersValid);
		}
开发者ID:gh0std4ncer,项目名称:reko,代码行数:8,代码来源:SerializedSequenceTests.cs


示例9: ApplyConvention

 public void ApplyConvention(SerializedSignature ssig, FunctionType sig)
 {
     string d = ssig.Convention;
     if (d == null || d.Length == 0)
         d = DefaultConvention;
     sig.StackDelta = 0;
     sig.FpuStackDelta = FpuStackOffset;
 }
开发者ID:relaxar,项目名称:reko,代码行数:8,代码来源:X86ProcedureSerializer.cs


示例10: PopulateSignatureFields

 private void PopulateSignatureFields(SerializedSignature sig)
 {
     if (sig.ReturnValue != null)
     {
         ListViewItem item = new ListViewItem("<Return value>"); 
         item.Tag = sig.ReturnValue;
         dlg.ArgumentList.Items.Add(item);
     }
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:9,代码来源:ProcedureDialogInteractor.cs


示例11: Deserialize

        public override FunctionType Deserialize(SerializedSignature ss, Frame frame)
        {
            int ncrn = 0;
            int nsaa = 0;
            // mem arg forb ret val

            var argser = new ArgumentDeserializer(
               this,
               Architecture,
               frame,
               Architecture.PointerType.Size,
               Architecture.WordWidth.Size);

            Identifier ret = null;
            if (ss.ReturnValue != null)
            {
                ret = argser.DeserializeReturnValue(ss.ReturnValue);
            }

            var args = new List<Identifier>();
            if (ss.Arguments != null)
            {
                foreach (var sArg in ss.Arguments)
                {
                    var dt = sArg.Type.Accept(TypeLoader);
                    var sizeInWords = (dt.Size + 3) / 4;

                    if (sizeInWords == 2 && (ncrn & 1) == 1)
                        ++ncrn;
                    Identifier arg;
                    if (sizeInWords <= 4 - ncrn)
                    {
                        if (sizeInWords == 2)
                        {
                            arg = frame.EnsureSequence(
                                Architecture.GetRegister(argRegs[ncrn]),
                                Architecture.GetRegister(argRegs[ncrn + 1]),
                                dt);
                            ncrn += 2;
                        }
                        else
                        {
                            arg = frame.EnsureRegister(
                                Architecture.GetRegister(argRegs[ncrn]));
                            ncrn += 1;
                        }
                    }
                    else
                    {
                        arg = frame.EnsureStackArgument(nsaa, dt);
                        nsaa += AlignedStackArgumentSize(dt);
                    }
                    args.Add(arg);
                }
            }
            return new FunctionType(ret, args.ToArray());
        }
开发者ID:uxmal,项目名称:reko,代码行数:57,代码来源:ArmProcedureSerializer.cs


示例12: ApplyConvention

 public void ApplyConvention(SerializedSignature ssig, ProcedureSignature sig)
 {
     string d = ssig.Convention;
     if (d == null || d.Length == 0)
         d = DefaultConvention;
     if (d == "stdapi" || d == "__stdcall" || d == "pascal")
         sig.StackDelta = StackOffset;
     sig.FpuStackDelta = FpuStackOffset;
 }
开发者ID:feelworld,项目名称:reko,代码行数:9,代码来源:X86ProcedureSerializer.cs


示例13: Deserialize

        public override FunctionType Deserialize(SerializedSignature ss, Frame frame)
        {
            if (ss == null)
                return null;
            this.argDeser = new ArgumentDeserializer(
                this,
                Architecture,
                frame,
                Architecture.PointerType.Size, //$BUG: x86 real mode?
                Architecture.WordWidth.Size);
            Identifier ret = null;
            int fpuDelta = FpuStackOffset;

            FpuStackOffset = 0;
            if (ss.ReturnValue != null)
            {
                ret = argDeser.DeserializeReturnValue(ss.ReturnValue);
                fpuDelta += FpuStackOffset;
            }

            FpuStackOffset = 0;
            var args = new List<Identifier>();
            if (ss.EnclosingType != null)
            {
                var arg = DeserializeImplicitThisArgument(ss);
                args.Add(arg);
            }
            if (ss.Arguments != null)
            {
                if (ss.Convention == "pascal")
                {
                    for (int iArg = ss.Arguments.Length -1; iArg >= 0; --iArg)
                    {
                        var sArg = ss.Arguments[iArg];
                        var arg = DeserializeArgument(sArg, iArg, ss.Convention);
                        args.Add(arg);
                    }
                    args.Reverse();
                }
                else
                {
                    for (int iArg = 0; iArg < ss.Arguments.Length; ++iArg)
                    {
                        var sArg = ss.Arguments[iArg];
                        var arg = DeserializeArgument(sArg, iArg, ss.Convention);
                        args.Add(arg);
                    }
                }
                fpuDelta -= FpuStackOffset;
            }
            FpuStackOffset = fpuDelta;
            var sig = new FunctionType(ret, args.ToArray());
            sig.IsInstanceMetod = ss.IsInstanceMethod;
            ApplyConvention(ss, sig);
            return sig;
        }
开发者ID:relaxar,项目名称:reko,代码行数:56,代码来源:X86ProcedureSerializer.cs


示例14: ApplyConvention

		public void ApplyConvention(SerializedSignature ssig, ProcedureSignature sig)
		{
			string d = ssig.Convention;
			if (d == null || d.Length == 0)
				d = defaultConvention;
			if (d != null && d == "stdapi")
				sig.StackDelta = stackOffset;

			sig.FpuStackDelta = fpuStackOffset;
		}
开发者ID:killbug2004,项目名称:reko,代码行数:10,代码来源:SignatureSerializer.cs


示例15: Verify

 private void Verify(SerializedSignature ssig, string outputFilename)
 {
     using (FileUnitTester fut = new FileUnitTester(outputFilename))
     {
         XmlTextWriter x = new FilteringXmlWriter(fut.TextWriter);
         x.Formatting = Formatting.Indented;
         XmlSerializer ser = SerializedLibrary.CreateSerializer_v1(ssig.GetType());
         ser.Serialize(x, ssig);
         fut.AssertFilesEqual();
     }
 }
开发者ID:gitter-badger,项目名称:reko,代码行数:11,代码来源:PowerPcProcedureSerializerTests.cs


示例16: ApplyConvention

 public void ApplyConvention(SerializedSignature ssig, ProcedureSignature sig)
 {
     string d = ssig.Convention;
     if (d == null || d.Length == 0)
         d = DefaultConvention;
     sig.StackDelta = Architecture.PointerType.Size;  //$BUG: far/near pointers?
     if (d == "stdapi" || d == "__stdcall" || d == "pascal")
         sig.StackDelta += StackOffset;
     sig.FpuStackDelta = FpuStackOffset;
     sig.ReturnAddressOnStack = Architecture.PointerType.Size;   //$BUG: x86 real mode?
 }
开发者ID:nemerle,项目名称:reko,代码行数:11,代码来源:X86ProcedureSerializer.cs


示例17: PpcPs_DeserializeFpuStackReturnValue

 public void PpcPs_DeserializeFpuStackReturnValue()
 {
     var ssig = new SerializedSignature
     {
         ReturnValue = new Argument_v1
         {
             Type = new PrimitiveType_v1(Domain.Real, 8),
         }
     };
     Given_ProcedureSerializer();
     var sig = ser.Deserialize(ssig, arch.CreateFrame());
     Assert.AreEqual("f1", sig.ReturnValue.Storage.ToString());
 }
开发者ID:nemerle,项目名称:reko,代码行数:13,代码来源:PowerPcProcedureSerializerTests.cs


示例18: PpcPs_DeserializeFpuArgument

 public void PpcPs_DeserializeFpuArgument()
 {
     var ssig = new SerializedSignature
     {
         Convention = "stdapi",
         ReturnValue = RegArg(Type("int"), "r3"),
         Arguments = new Argument_v1[] {
             FpuArg(Type("double"), "f1")
         }
     };
     Given_ProcedureSerializer();
     var sig = ser.Deserialize(ssig, arch.CreateFrame());
     Assert.AreEqual("Register int test(Register word64 f1)", sig.ToString("test"));
 }
开发者ID:nemerle,项目名称:reko,代码行数:14,代码来源:PowerPcProcedureSerializerTests.cs


示例19: ProcSer_DeserializeFpuStackReturnValue

 public void ProcSer_DeserializeFpuStackReturnValue()
 {
     var ssig = new SerializedSignature
     {
         Convention = "stdapi",
         ReturnValue = new Argument_v1
         {
             Type = new SerializedTypeReference("double"),
             Kind = new FpuStackVariable_v1 { ByteSize = 8 },
         }
     };
     Given_ProcedureSerializer("stdapi");
     var sig = ser.Deserialize(ssig, arch.CreateFrame());
     Assert.AreEqual(1, sig.FpuStackDelta);
 }
开发者ID:feelworld,项目名称:reko,代码行数:15,代码来源:X86ProcedureSerializerTests.cs


示例20: BuildSsigAxBxCl

        public static SerializedSignature BuildSsigAxBxCl()
        {
            SerializedSignature ssig = new SerializedSignature();

            Argument_v1 sarg = new Argument_v1();
            sarg.Type = new PrimitiveType_v1(Domain.SignedInt, 2);
            sarg.Kind = new Register_v1("ax");
            ssig.ReturnValue = sarg;

            ssig.Arguments = new Argument_v1[]
            {
                new Argument_v1 { Kind = new Register_v1("bx") },
                new Argument_v1 { Kind = new Register_v1("cl") },
            };
            return ssig;
        }
开发者ID:nemerle,项目名称:reko,代码行数:16,代码来源:SerializedSignatureTests.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Serializer类代码示例发布时间:2022-05-24
下一篇:
C# SerializedProperty类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap