コード例 #1
0
        private void textBox1_KeyDown(object sender, KeyEventArgs e)
        {
            if (e.KeyCode == Keys.Enter)
            {
                //Send command
                //SendKeys.Send();
                //Process[] processes = Process.GetProcessesByName("notepad");
                Process processes;
                try
                {
                    processes = Process.GetProcessById(processid);
                }
                catch
                {
                    Statics.Print("Process not found, Metasploit Framework not found");
                    return;
                }
                //Process game1 = processes[0];
                Process game1 = processes;

                IntPtr p = game1.MainWindowHandle;
                SetForegroundWindow(p);
                //SendKeys.SendWait(textBox1.Text);
                SendKeys.Send(textBoxInput.Text);
                SendKeys.Send("{ENTER}");
                textBoxInput.Text = "";
                //WindowState = FormWindowState.Minimized;
                Show();
                //WindowState = FormWindowState.Normal;
                textBoxInput.Focus();
            }
        }
コード例 #2
0
        public void OpenFile()
        {
            OpenFileDialog openfile = new OpenFileDialog();

            openfile.Filter = "Resource Script(*.rs)|*.rs|Text file(*.txt)|*.txt|All files(*.*)|*.*";
            openfile.Title  = "Select the file you want to edit";

            RecentDialogResult = openfile.ShowDialog();

            if (!RecentDialogResult.Equals(DialogResult.OK))
            {
                return;
            }

            if (richTextBoxCode.Text != LastSavedContent)
            {
                Statics.Print("Last edit not saved, are you sure you want to override?");
                //Insert popup here
            }

            richTextBoxCode.Text = File.ReadAllText(openfile.FileName);

            OpenFilePath = openfile.FileName;


            UpdateTitle();
        }
コード例 #3
0
        private void ScriptEditor_Load(object sender, EventArgs e)
        {
            Statics.Print("Opened script editor");

            LineNumberTextBox.Font = richTextBoxCode.Font;
            richTextBoxCode.Select();
            AddLineNumbers();

            UpdateTitle();

            #region Comment

            /*
             * try
             * {
             *  var PurpleArray = File.ReadAllLines("PurpleWords.txt");
             *  PurpleWords = new string[PurpleArray.Length];
             *  for (int i = 0;i < PurpleArray.Length; i++)
             *  {
             *      PurpleWords[i] = PurpleArray[i];
             *  }
             * }
             * catch
             * {
             *  Console.WriteLine("Missing File 'PurpleWords.txt'");
             * }
             * try
             * {
             *  var GreenArray = File.ReadAllLines("GreenWords.txt");
             *  GreenWords = new string[GreenArray.Length];
             *  for (int i = 0;i < GreenArray.Length; i++)
             *  {
             *      GreenWords[i] = GreenArray[i];
             *  }
             * }
             * catch
             * {
             *  Console.WriteLine("Missing File 'GreenWords.txt'");
             * }
             * try
             * {
             *  var BlueArray = File.ReadAllLines("BlueWords.txt");
             *  BlueWords = new string[BlueArray.Length];
             *  for (int i = 0;i < BlueArray.Length; i++)
             *  {
             *      BlueWords[i] = BlueArray[i];
             *  }
             * }
             * catch
             * {
             *  Console.WriteLine("Missing File 'BlueWords.txt'");
             * }
             * //PurpleWords[0] = "exploit";
             * //PurpleWords[1] = "run";
             * //BlueWords[0] = "use";*/
            #endregion
        }
コード例 #4
0
        public void RegisterEventHandlers()
        {
            IEnumerable <CheckBox> CheckBoxes = flowLayoutPanelSoftware.Controls.OfType <CheckBox>();

            Statics.Print($"Found {CheckBoxes.Count()} checkboxes");
            foreach (CheckBox item in CheckBoxes)
            {
                item.CheckedChanged += new EventHandler(CheckBoxChanged);
            }
        }
コード例 #5
0
        private void buttonDictionary_Click(object sender, EventArgs e)
        {
            openFileDialog1.InitialDirectory = Statics.dictionary_path;
            DialogResult result = openFileDialog1.ShowDialog();

            Statics.Print($"File dialog returned {result.ToString()}");
            if (result == DialogResult.OK)
            {
                Statics.dictionary_path = openFileDialog1.FileName;
                Statics.RefreshDictionary();
            }
        }
コード例 #6
0
        private void textBoxInput_TextChanged(object sender, EventArgs e)
        {
            Statics.Print($"Getting suggestions for {textBoxInput.Text}");

            /*
             * menuStripAutoComplete.Items.Clear();
             *
             * foreach (string item in GetSuggestions(textBoxInput.Text))
             * {
             *  menuStripAutoComplete.Items.Add(item);
             * }
             *
             * menuStripAutoComplete.Show();*/
        }
コード例 #7
0
        public ConsoleWindow(ConsoleStartOptions Options = ConsoleStartOptions.interactive)
        {
            InitializeComponent();

            switch (Options)
            {
            case ConsoleStartOptions.handler:
                handler = true;
                break;

            case ConsoleStartOptions.interactive:
                handler = false;
                break;

            default:
                break;
            }

            Statics.Print($"Console Window mode: {Options.ToString()}");
        }
コード例 #8
0
        private void Options_Load(object sender, EventArgs e)
        {
            //DebugWindow.logwrite("Loaded Options");
            Statics.Print("Loading options");
            textBox1.Text = Statics.lhost;
            textBox2.Text = Statics.lport;
            textBox3.Text = Statics.rhost;
            textBox4.Text = Statics.rport;
            Statics.Print("Options loaded");

            labelValue.Text = trackBarMaxSuggestions.Value.ToString();
            if (Statics.DebugWindowEnabled)
            {
                radioButtonEnableDebug.Checked  = true;
                radioButtonDisableDebug.Checked = false;
            }
            else
            {
                radioButtonEnableDebug.Checked  = true;
                radioButtonDisableDebug.Checked = false;
            }
        }