示例#1
0
        public void Run(DevirtualisationContext context)
        {
            var flagHelper = VmHelperGenerator.ImportFlagHelper(context.TargetImage, context.Constants);

            foreach (var method in context.VirtualisedMethods)
            {
                if (method.IsExport &&
                    !context.Options.SelectedExports.Contains(method.ExportId.Value, method.ExportInfo))
                {
                    continue;
                }

                RecompileToCilAst(context, method);
                GenerateCil(context, method, flagHelper);
            }
        }
示例#2
0
        public void Run(DevirtualisationContext context)
        {
            var flagHelper = VmHelperGenerator.ImportFlagHelper(context.TargetModule, context.Constants);

            foreach (var method in context.VirtualisedMethods)
            {
                try
                {
                    if (method.ILCompilationUnit == null ||
                        method.IsExport && !context.Options.SelectedExports.Contains(method.ExportId.Value))
                    {
                        continue;
                    }

                    RecompileToCilAst(context, method);
                    GenerateCil(context, method, flagHelper);
                }
                catch (Exception e) when(context.Options.EnableSalvageMode)
                {
                    context.Logger.Error(Tag, $"Failed to recompile function_{method.Function.EntrypointAddress:X4}. {e.Message}");
                }
            }
        }