public DecompilerContext(Dictionary <string, object> properties, IFernflowerLogger logger, StructContext structContext, ClassesProcessor classProcessor, PoolInterceptor interceptor) { this.properties = properties; this.logger = logger; this.structContext = structContext; this.classProcessor = classProcessor; this.poolInterceptor = interceptor; this.counterContainer = new CounterContainer(); }
private static IIdentifierRenamer LoadHelper(string className, IFernflowerLogger logger) { if (className != null) { try { return((IIdentifierRenamer)Activator.CreateInstance(AppDomain.CurrentDomain.GetAssemblies().SelectMany(c => c.GetTypes()).First(c => c.Name == className))); } catch (Exception e) { logger.WriteMessage("Cannot load renamer '" + className + "'", IFernflowerLogger.Severity .Warn, e); } } return(new ConverterHelper()); }
protected internal ConsoleDecompiler(FileSystemInfo destination, Dictionary <string, object > options, IFernflowerLogger logger) { // ******************************************************************* // Implementation // ******************************************************************* root = destination; engine = new Fernflower(this, this, options, logger); }
public Fernflower(IIBytecodeProvider provider, IIResultSaver saver, Dictionary <string , object> customProperties, IFernflowerLogger logger) { Dictionary <string, object> properties = new Dictionary <string, object>(IFernflowerPreferences.Defaults); if (customProperties != null) { Sharpen.Collections.PutAll(properties, customProperties); } string level = (string)properties.GetOrNull(IFernflowerPreferences.Log_Level); if (level != null) { try { logger.SetSeverity(IFernflowerLogger.Severity.ValueOf(level.ToUpper())); } catch (ArgumentException) { } } structContext = new StructContext(saver, this, new LazyLoader(provider)); classProcessor = new ClassesProcessor(structContext); PoolInterceptor interceptor = null; if ("1".Equals(properties.GetOrNull(IFernflowerPreferences.Rename_Entities))) { helper = LoadHelper((string)properties.GetOrNull(IFernflowerPreferences.User_Renamer_Class ), logger); interceptor = new PoolInterceptor(); converter = new IdentifierConverter(structContext, helper, interceptor); } else { helper = null; converter = null; } DecompilerContext context = new DecompilerContext(properties, logger, structContext , classProcessor, interceptor); DecompilerContext.SetCurrentContext(context); }
public BaseDecompiler(IIBytecodeProvider provider, IIResultSaver saver, Dictionary <string, object> options, IFernflowerLogger logger) { engine = new Fernflower(provider, saver, options, logger); }