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


C# Instruction.BD方法代码示例

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


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

示例1: Bc_C

        static List<CStatement> Bc_C(uint pc, uint instruction)
        {
            Instruction i = new Instruction(instruction);
            List<CStatement> stats = new List<CStatement>();

            if ((i.BO() & 4) == 0)
            {
                CStatement ctrSub = new CStatement(CStatement.Kinds.Subtraction, "CTR", 1);
                CStatement ctrAss = new CStatement(CStatement.Kinds.Assignment, "CTR", ctrSub);
                stats.Add(ctrAss);
            }

            CStatement final = ConditionCheck(i);

            uint destination = (uint)(int)(short)(i.BD() << 2);
            if ((instruction & 2) != 2)
                destination += pc;

            Function f = decompiler.Functions.Find(delegate(Function fn) { return fn.Address == destination; });
            String destName;
            if (f != null)
                destName = f.Name;
            else
                destName = "L" + destination.ToString("X8");

            CStatement branch = new CStatement();
            if (i.LK())
            {
                if (f != null && decompiler.IgnoredCalls.Contains(f))
                    return new List<CStatement>();

                if (f != null && f.Returns.Name == "void" && f.Returns.Kind == CType.TypeKind.ValueType)
                {
                    branch.Kind = CStatement.Kinds.Call;
                    branch.CallFuncName = destName;
                    branch.CalledFunction = f;
                }
                else
                {
                    branch.Kind = CStatement.Kinds.Assignment;
                    branch.Op1 = new CStatement.COperand("r3");

                    CStatement realBranch = new CStatement(CStatement.Kinds.Call);
                    realBranch.CallFuncName = destName;
                    realBranch.CalledFunction = f;

                    branch.Op2 = new CStatement.COperand(realBranch);
                }
            }
            else
            {
                if (f != null && decompiler.CallIsRet.Contains(f))
                    branch.Kind = CStatement.Kinds.Return;
                else
                {
                    branch.Kind = CStatement.Kinds.Goto;
                    branch.BranchDestination = destName;
                    branch.BranchDestinationAddr = destination;
                }
            }

            if (final == null)
                final = branch;
            else
            {
                final.InnerBlock = new List<CStatement>();
                final.InnerBlock.Add(branch);
            }

            stats.Add(final);
            return stats;
        }
开发者ID:aomega08,项目名称:X360Decompiler,代码行数:72,代码来源:XenonInstructions.cs


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