Exemplo n.º 1
0
        public Form1(string args)
        {
            InitializeComponent();
            singleMachine = false;
            myDelegate    = new UpdateListMessage(add_Message_List);
            sitesT        = new Dictionary <string, string>();

            if (args.Equals("-singleMachine"))
            {
                singleMachine = true;
                puppet        = new PuppetMaster(this, 0, true);
            }
            else
            {
                int iD = Int32.Parse(args);
                if (iD == 0)
                {
                    master = true;
                }
                else
                {
                    master = false;
                }
                puppet = new PuppetMaster(this, iD, false);
            }

            scriptbox.Enabled = false;
            textBox2.Enabled  = false;
            execute.Enabled   = false;
            button2.Enabled   = false;
            InitCheck();
        }
Exemplo n.º 2
0
        public Form1(string args)
        {
            InitializeComponent();
            singleMachine = false;
            myDelegate = new UpdateListMessage(add_Message_List);
            sitesT = new Dictionary<string, string>();

            if (args.Equals("-singleMachine"))
            {
                singleMachine = true;
                puppet = new PuppetMaster(this, 0, true);
            }
            else
            {
                int iD = Int32.Parse(args);
                if (iD == 0)
                {
                    master = true;
                }
                else
                {
                    master = false;
                }
                puppet = new PuppetMaster(this, iD, false);
            }

            scriptbox.Enabled = false;
            textBox2.Enabled = false;
            execute.Enabled = false;
            button2.Enabled = false;
            InitCheck();
        }
Exemplo n.º 3
0
        public void Exit()
        {
            PuppetMaster.GetInstance().Log("Killing " + _url);
            IRemoteCmdInterface remoteObj = (IRemoteCmdInterface)Activator.GetObject(
                typeof(IRemoteCmdInterface),
                _url);

            remoteObj.Crash();
        }
Exemplo n.º 4
0
        private void DumpButtonClick(object sender, EventArgs e)
        {
            if (CheckId())
            {
                string id = this.processIdBox.Text;

                PuppetMaster.DumpProcess(id);
                SetStatus("DUMP " + id);
            }
        }
Exemplo n.º 5
0
 public PuppetMasterUI()
 {
     InitializeComponent();
     pm   = new PuppetMaster();
     logs = "";
     pm.start();
     this.Result.Text           = pm.getLogs();
     this.Result.SelectionStart = this.Result.Text.Length;
     this.Result.ScrollToCaret();
     FormClosing += PuppetMasterUI_FormClosing;
 }
        private void initConsole()
        {
            string serviceName = Constants.PUPPETMASTER_SERVICE_NAME;
            int port = Constants.PUPPETMASTER_PORT_START;

            puppetMaster = new PuppetMaster(serviceName);

            service = new PuppetMasterService(puppetMaster);

            initService(port, serviceName);

            Console.WriteLine("Running service at " + puppetMasterURL);
            Console.WriteLine("Accepting commands here");

            initParser();

            consoleJob();
        }
 static void Main(string[] args)
 {
     PuppetMaster pm = new PuppetMaster();
     pm.Start();
 }
Exemplo n.º 8
0
        static void Main(string[] args)
        {
            // Checking for argument presence
            if(args.Length != 6){
                MessageBox.Show("Error! Required arguments not provided. Exitting.");
                return;
            }

            int portNumber = 0;
            string workerExecutablePath = null;
            string clientExecutablePath = null;

            for (int i = 0; i < args.Length; i += 2)
            {

                if (args[i].Equals("-p"))
                {
                    try
                    {
                        int port = int.Parse(args[i+1]);

                        if (port > 0 && port < 65535)
                        {
                            portNumber = port;
                        }
                        else
                        {
                            MessageBox.Show("Error! Invalid port number provided. Exitting.\n");
                            return;
                        }
                    }
                    catch (Exception e)
                    {
                        MessageBox.Show("Error! Invalid port format provided. Exitting.\n" + e.Message);
                        return;
                    }
                }

                if (args[i].Equals("-w"))
                {
                    workerExecutablePath = args[i+1];
                }

                if (args[i].Equals("-c"))
                {
                    clientExecutablePath = args[i + 1];
                }

            }

            if (portNumber != 0 && workerExecutablePath != null && clientExecutablePath != null)
            {
                TcpChannel receiveChannel = new TcpChannel(Convert.ToInt32(portNumber));
                ChannelServices.RegisterChannel(receiveChannel, false);
                PuppetMaster pm = new PuppetMaster(workerExecutablePath);
                RemotingServices.Marshal(pm, "PM", typeof(PADIMapNoReduce.IPuppetMaster));

                Application.EnableVisualStyles();
                Application.SetCompatibleTextRenderingDefault(false);
                Application.Run(new PuppetMasterForm(portNumber, workerExecutablePath, clientExecutablePath));
            } else
            {
                List<string> missingArguments = new List<string>();

                if (portNumber == 0)
                    missingArguments.Add("Port number");

                if(workerExecutablePath == null)
                    missingArguments.Add("Worker executable path");

                if (clientExecutablePath == null)
                    missingArguments.Add("Client executable path");

                MessageBox.Show("Error! Argument(s) missing: " + string.Join(", ", missingArguments)  + ". Exitting.\n");
                return;
            }
        }