コード例 #1
0
 public Ast.Statements.BlockStatement Process(DecompilationContext context, Ast.Statements.BlockStatement body)
 {
     this.decompilationContext = context;
     this.theCFG = context.MethodContext.ControlFlowGraph;
     ProcessTheControlFlowGraph();
     return(body);
 }
コード例 #2
0
 public Ast.Statements.BlockStatement Process(DecompilationContext context, Ast.Statements.BlockStatement body)
 {
     this.context = context;
     if (ShouldExecuteStep())
     {
         ProcessTheCFG();
         AnalyzeAssignments();
     }
     return(body);
 }
コード例 #3
0
        public Ast.Statements.BlockStatement Process(DecompilationContext context, Ast.Statements.BlockStatement body)
        {
            this.moveNextMethodContext = context.MethodContext;
            this.theCFG = this.moveNextMethodContext.ControlFlowGraph;
            moveNextMethodContext.IsMethodBodyChanged = true;

            StateMachineUtilities.FixInstructionConnections(theCFG.Blocks);

            if (!ProcessCFG())
            {
                context.StopPipeline();
            }
            return(body);
        }
コード例 #4
0
 public Ast.Statements.BlockStatement Process(Decompiler.DecompilationContext context, Ast.Statements.BlockStatement body)
 {
     body = (BlockStatement) new LinqQueriesRebuilder(context.MethodContext).Visit(body);
     return(body);
 }
コード例 #5
0
        public Ast.Statements.BlockStatement Process(Decompiler.DecompilationContext context, Ast.Statements.BlockStatement body)
        {
            if (!new ExpressionTreesFinder().ContainsExpressionTree(body))
            {
                return(body);
            }

            this.context    = context;
            this.typeSystem = context.TypeContext.CurrentType.Module.TypeSystem;
            this.failure    = false;
            BlockStatement clone = (BlockStatement)Visit(body.Clone());

            if (failure || usedVariables.Count == 0 || !TryRemoveUnusedVariableAssignments(clone))
            {
                return(body);
            }
            clone = (BlockStatement) new ClosureVariablesRemover(context.MethodContext).Visit(clone);
            clone = new CombinedTransformerStep()
            {
                Method = context.MethodContext.Method
            }.Process(context, clone);
            return(clone);
        }
コード例 #6
0
 public override ICodeNode VisitBlockStatement(Ast.Statements.BlockStatement node)
 {
     return(node);
 }
コード例 #7
0
        public Ast.Statements.BlockStatement Process(Decompiler.DecompilationContext context, Ast.Statements.BlockStatement body)
        {
            Visit(body);
            List <Instruction> instructions = new List <Instruction>(body.UnderlyingSameMethodInstructions);
            List <Instruction> nonUniques   = GetNonUniqueInstructions(instructions);

            if (nonUniques.Count > 0)
            {
                throw new Exception("Instruction duplication detected after: " + previousStep);
            }
            return(body);
        }
コード例 #8
0
 public Ast.Statements.BlockStatement Process(Decompiler.DecompilationContext context, Ast.Statements.BlockStatement body)
 {
     this.context    = context;
     this.typeSystem = context.TypeContext.CurrentType.Module.TypeSystem;
     return((Telerik.JustDecompiler.Ast.Statements.BlockStatement)Visit(body));
 }
コード例 #9
0
        public Ast.Statements.BlockStatement Process(Decompiler.DecompilationContext context, Ast.Statements.BlockStatement body)
        {
            HashSet <Instruction> mappedInstructions = new HashSet <Instruction>(body.UnderlyingSameMethodInstructions);

            if (context.MethodContext.IsMethodBodyChanged)
            {
                context.MethodContext.Method.RefreshBody();
                context.MethodContext.IsMethodBodyChanged = false;
            }

            List <Instruction> unmappedInstructions = new List <Instruction>();

            foreach (Instruction instruction in context.MethodContext.Method.Body.Instructions)
            {
                if (!mappedInstructions.Contains(instruction))
                {
                    unmappedInstructions.Add(instruction);
                }
            }

            if (unmappedInstructions.Count > 0)
            {
                StringBuilder stringBuilder = new StringBuilder("Found unmapped instructions.\n");
                foreach (Instruction unmappedInstruction in unmappedInstructions)
                {
                    stringBuilder.AppendLine(unmappedInstruction.ToString());
                }
                throw new Exception(stringBuilder.ToString());
            }

            return(body);
        }
コード例 #10
0
 public Ast.Statements.BlockStatement Process(Decompiler.DecompilationContext context, Ast.Statements.BlockStatement body)
 {
     this.methodContext = context.MethodContext;
     mappedInstructions.UnionWith(body.UnderlyingSameMethodInstructions);
     Visit(body);
     return(body);
 }