public static void Obfuscate(params string[] assemblies) { if (assemblies == null || assemblies.Length == 0) { throw new ArgumentException("No assmemblies provided to obfuscate", "assemblies"); } //Run the obfuscator CloakManager manager = new CloakManager(); //Configure it (as necessary) - tasks etc manager.RegisterTask <CloakTasks.MappingTask>(); manager.RegisterTask <CloakTasks.ObfuscationTask>(); manager.RegisterTask <CloakTasks.OutputAssembliesTask>(); //Create a cloaking context InitialisationSettings settings = new InitialisationSettings(); settings.AssembliesToObfuscate.AddRange(assemblies); settings.ObfuscateAllModifiers = true; settings.OutputDirectory = Path.Combine(Environment.CurrentDirectory, "Obfuscated"); if (!Directory.Exists(settings.OutputDirectory)) { Directory.CreateDirectory(settings.OutputDirectory); } settings.Validate(); ICloakContext cloakContext = new CloakContext(settings); //Run the manager manager.Run(cloakContext); }
static void Main(string[] args) { //Basic parsing of arguments for now var parser = new CommandLineArgumentParser(); parser.Parse(args); //Create a cloak manager var manager = new CloakManager(); //Create a cloaking context var cloakContext = new CloakContext(parser.Settings); //Run the manager manager.Run(cloakContext); }
public void Execute() { LoggerFactory.LogInfo = LogInfo; LoggerFactory.LogWarn = LogWarning; LoggerFactory.LogError = LogError; var settings = new InitialisationSettings(Config); var manager = new CloakManager(); var cloakContext = new CloakContext(settings, ModuleDefinition); manager.Run(cloakContext); }
public static void Obfuscate(params string[] assemblies) { if (assemblies == null || assemblies.Length == 0) throw new ArgumentException("No assmemblies provided to obfuscate", "assemblies"); //Run the obfuscator CloakManager manager = new CloakManager(); //Configure it (as necessary) - tasks etc manager.RegisterTask<CloakTasks.MappingTask>(); manager.RegisterTask<CloakTasks.ObfuscationTask>(); //Create a cloaking context InitialisationSettings settings = new InitialisationSettings(); settings.AssembliesToObfuscate.AddRange(assemblies); settings.ObfuscateAllModifiers = true; settings.OutputDirectory = Path.Combine(Environment.CurrentDirectory, "Obfuscated"); if (!Directory.Exists(settings.OutputDirectory)) Directory.CreateDirectory(settings.OutputDirectory); settings.Validate(); ICloakContext cloakContext = new CloakContext(settings); //Run the manager manager.Run(cloakContext); }