示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
    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);
    }
示例#4
0
文件: Program.cs 项目: lxa520/NCloak
        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);
        }
示例#5
0
        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);
        }