/// <summary> /// Executes the translation. /// </summary> /// <param name="paths">The paths.</param> /// <param name="extensionProgress">If <c>true</c>, periodically write progress to console /// if the input binaries are adequately large.</param> /// <returns>The computed cfg and type environment.</returns> public static (Cfg, TypeEnvironment) ExecuteTranslation(string[] paths, bool extensionProgress = false) { (var assemblies, var totalSize) = GetAssemblies(paths); InstructionParser.RegisterAllKnownParsers(); var reportProgressExtension = totalSize > 1e7 && extensionProgress; var decompilationService = new DecompilationService(assemblies, reportProgressExtension); var tenvParser = new TenvParserService(reportProgressExtension); var cfgParser = new CfgParserService(reportProgressExtension); var result = decompilationService .Execute() .ThenExecute(tenvParser) .ThenExecute(cfgParser); var tenv = result.GetResult <TenvParserResult>().TypeEnvironment; var cfg = result.GetResult <CfgParserResult>().Cfg; Log.PrintAllUnknownInstruction(); Log.WriteLine(); Log.PrintCoverageStats(result.GetResult <CfgParserResult>().Methods); return(cfg, tenv); }
/// <summary> /// Executes the translation. /// </summary> /// <param name="paths">The paths.</param> /// <param name="printprocs">The printprocs.</param> /// <returns></returns> public static (Cfg, TypeEnvironment) ExecuteTranslation(string[] paths, string printprocs = null) { var assemblies = GetAssemblies(paths); InstructionParser.RegisterAllKnownParsers(); var decompilationService = new DecompilationService(assemblies); var tenvParser = new TenvParserService(); var cfgParser = new CfgParserService(); var result = decompilationService .Execute() .ThenExecute(tenvParser) .ThenExecute(cfgParser); var tenv = result.GetResult <TenvParserResult>().TypeEnvironment; var cfg = result.GetResult <CfgParserResult>().Cfg; if (printprocs != null) { PrintCfg(cfg, printprocs); } Log.PrintAllUnknownInstruction(); Log.WriteLine(); Log.PrintCoverageStats(result.GetResult <CfgParserResult>().Methods); return(cfg, tenv); }