Пример #1
0
        static void Main(string[] args)
        {
            if (args.Length != 1 || args[0] == "/?")
            {
                OutputUsage();
                return;
            }

            if (!File.Exists(args[0]))
            {
                Console.WriteLine("Can not find the specified PHP Obfustator Project File: " + args[0]);
                return;
            }

            ObfuscationConfig config = null;
            try
            {
                config = ObfuscationConfig.Open(args[0]);
            }
            catch(Exception)
            {
                Console.WriteLine("Could not open the specified PHP Obfuscator Project File: " + args[0]);
                return;
            }

            if(null == config)
            {
                Console.WriteLine("Could not open the specified PHP Obfuscator Project File: " + args[0]);
                return;
            }

            try
            {
                ObfuscatorUI ui = new ObfuscatorUI();
                Obfuscator obfuscator = new Obfuscator(ui);
                obfuscator.OutputPatterns();
                obfuscator.Start(config, false);
            }
            catch (Exception exp)
            {
                Console.WriteLine("There was an error obfuscating your project: " + exp.Message);
                return;
            }

        }
Пример #2
0
        static void Main(string[] args)
        {
            if (args.Length != 1 || args[0] == "/?")
            {
                OutputUsage();
                return;
            }

            if (!File.Exists(args[0]))
            {
                Console.WriteLine("Can not find the specified PHP Obfustator Project File: " + args[0]);
                return;
            }

            ObfuscationConfig config = null;

            try
            {
                config = ObfuscationConfig.Open(args[0]);
            }
            catch (Exception)
            {
                Console.WriteLine("Could not open the specified PHP Obfuscator Project File: " + args[0]);
                return;
            }

            if (null == config)
            {
                Console.WriteLine("Could not open the specified PHP Obfuscator Project File: " + args[0]);
                return;
            }

            try
            {
                ObfuscatorUI ui         = new ObfuscatorUI();
                Obfuscator   obfuscator = new Obfuscator(ui);
                obfuscator.OutputPatterns();
                obfuscator.Start(config, false);
            }
            catch (Exception exp)
            {
                Console.WriteLine("There was an error obfuscating your project: " + exp.Message);
                return;
            }
        }