コード例 #1
0
ファイル: Main.cs プロジェクト: deveck/doTSS
        public static void Main(string[] args)
        {
            log4net.Appender.DebugAppender appender = new log4net.Appender.DebugAppender ();
            appender.Name = "DebugAppender";
            appender.Layout = new log4net.Layout.PatternLayout ("[%date{dd.MM.yyyy HH:mm:ss,fff}]-%-5level-[%c]: %message%newline");
            log4net.Config.BasicConfigurator.Configure (appender);

            CommandLineHandler cmdlHandler = new CommandLineHandler ();
            cmdlHandler.RegisterCallback ("help", CmdCallback_Help);
            cmdlHandler.RegisterCallback ("help_scripts", CmdCallback_HelpScripts);

            string scriptFile = null;
            cmdlHandler.RegisterCallback ("script", delegate(CommandLineHandler.CommandOption cmdOption)
            {
                if (cmdOption.Arguments != null && cmdOption.Arguments.Length > 0)
                    scriptFile = cmdOption.Arguments[0];
            });

            cmdlHandler.Parse (args);

            if (scriptFile == null)
                new TPMConsole ().Run ();
            else
                new TPMConsole().RunScriptFile(scriptFile);
        }
コード例 #2
0
ファイル: Main.cs プロジェクト: smuthubabu/doTSS
        public static void Main(string[] args)
        {
            log4net.Appender.DebugAppender appender = new log4net.Appender.DebugAppender();
            appender.Name   = "DebugAppender";
            appender.Layout = new log4net.Layout.PatternLayout("[%date{dd.MM.yyyy HH:mm:ss,fff}]-%-5level-[%c]: %message%newline");
            log4net.Config.BasicConfigurator.Configure(appender);

            CommandLineHandler cmdlHandler = new CommandLineHandler();

            cmdlHandler.RegisterCallback("help", CmdCallback_Help);
            cmdlHandler.RegisterCallback("help_scripts", CmdCallback_HelpScripts);

            string scriptFile = null;

            cmdlHandler.RegisterCallback("script", delegate(CommandLineHandler.CommandOption cmdOption)
            {
                if (cmdOption.Arguments != null && cmdOption.Arguments.Length > 0)
                {
                    scriptFile = cmdOption.Arguments[0];
                }
            });

            cmdlHandler.Parse(args);

            if (scriptFile == null)
            {
                new TPMConsole().Run();
            }
            else
            {
                new TPMConsole().RunScriptFile(scriptFile);
            }
        }
コード例 #3
0
ファイル: TPMServer.cs プロジェクト: deveck/doTSS
        /// <summary>
        /// Console entrypoint
        /// </summary>
        /// <param name="args">Command line arguments. you can override the default config file by supplying "--config=/path/to/configfile.conf"</param>
        public static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += HandleAppDomainCurrentDomainUnhandledException;

            CommandLineHandler commandLineHandler = new CommandLineHandler();
            commandLineHandler.RegisterCallback("help", OutputHelp);
            commandLineHandler.RegisterCallback("h", OutputHelp);
            commandLineHandler.Parse(args);

            TPMServerContext ctx = new TPMServerContext();
            ctx.Start();

            Thread.Sleep(Timeout.Infinite);
        }
コード例 #4
0
        /// <summary>
        /// Console entrypoint
        /// </summary>
        /// <param name="args">Command line arguments. you can override the default config file by supplying "--config=/path/to/configfile.conf"</param>
        public static void Main(string[] args)
        {
            AppDomain.CurrentDomain.UnhandledException += HandleAppDomainCurrentDomainUnhandledException;

            CommandLineHandler commandLineHandler = new CommandLineHandler();

            commandLineHandler.RegisterCallback("help", OutputHelp);
            commandLineHandler.RegisterCallback("h", OutputHelp);
            commandLineHandler.Parse(args);


            TPMServerContext ctx = new TPMServerContext();

            ctx.Start();

            Thread.Sleep(Timeout.Infinite);
        }
コード例 #5
0
ファイル: Main.cs プロジェクト: areiter/InMemoryFuzzing
        public static void Main(string[] args)
        {
            SetupLogging ();

            if (args == null || args.Length == 0)
                OutputHelp (null);
            else
            {
                CommandLineHandler cmdLineHandler = new CommandLineHandler ();
                cmdLineHandler.RegisterCallback ("fuzz", SetFuzzingMode );
                cmdLineHandler.RegisterCallback ("analyze", SetAnalyzationMode );
                cmdLineHandler.RegisterCallback ("xmlinput", ParseXmlInput);
                cmdLineHandler.RegisterCallback ("help", OutputHelp);
                cmdLineHandler.Parse (args);
            }

            if(_programMode == null)
            {
                OutputHelp(null);
                return;
            }

            if (_programMode.Value == MainClass.ProgramMode.Fuzz &&
                _fuzzControllers != null)
            {
                foreach (FuzzController fc in _fuzzControllers)
                    fc.Fuzz ();
            }
            else if(_programMode.Value == MainClass.ProgramMode.Analyze &&
                    _analyzeController != null)
                _analyzeController.Analyze();
            else
            {
                Console.WriteLine("Could not find a configuration \n\n");
                OutputHelp(null);
            }
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: deveck/Deveck.TAM
		public static void Main(string[] args)
		{
			Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
			_log = LogManager.GetCurrentClassLogger();
			
			CommandLineHandler cmdLine = new CommandLineHandler();
			cmdLine.RegisterCallback("console",new Action<CommandLineHandler.CommandOption>(cmdLine_Console));
			cmdLine.Parse(args);
			if(_consoleMode)
			{
				Initialize();
				Thread.Sleep(Timeout.Infinite);
			}
			else
			{
				System.ServiceProcess.ServiceBase[] services_to_run =
					new  ServiceBase[] { new Program() };
				
				System.ServiceProcess.ServiceBase.Run(services_to_run);
			}
		}
コード例 #7
0
ファイル: Program.cs プロジェクト: goupviet/Deveck.TAM
        public static void Main(string[] args)
        {
            Environment.CurrentDirectory = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
            _log = LogManager.GetCurrentClassLogger();

            CommandLineHandler cmdLine = new CommandLineHandler();

            cmdLine.RegisterCallback("console", new Action <CommandLineHandler.CommandOption>(cmdLine_Console));
            cmdLine.Parse(args);
            if (_consoleMode)
            {
                Initialize();
                Thread.Sleep(Timeout.Infinite);
            }
            else
            {
                System.ServiceProcess.ServiceBase[] services_to_run =
                    new  ServiceBase[] { new Program() };

                System.ServiceProcess.ServiceBase.Run(services_to_run);
            }
        }