Example #1
0
 /*
  * Open Miniature Notepad Function - a function to open the MiniPad Window
  * --------------------------------------------------------------------------
  * openminipad(
  *      string to pass to mprtb (string),
  *      Enable Modify Script button (bool)
  * )
  * --------------------------------------------------------------------------
  * Two or more instances uses the same code with small change of detail.
  * returns: nothing
  */
 private void openminipad(string writetb = "", bool enaBuild = false)
 {
     using (minipad _minipad = new minipad()) {
         _minipad.btnCompileScript.Enabled = false;
         if (enaBuild)
         {
             _minipad.btnCompileScript.Enabled = true;
         }
         _minipad.mprtb.Text = writetb;
         _minipad.ShowDialog();
         if (_minipad._modifyscript)
         {
             templateData = _minipad._newscript;
             ismodified   = true;
             dbgmsg("Script Modified!");
             startBuild(false, true);
         }
     }
 }
Example #2
0
        private void btnConsole_Click(object sender, EventArgs e)
        {
            string[] con = tbConsole.Text.Split(' ');
            switch ((con[0]).ToLower())
            {
            case "setdrive":
                drpDrives.Items.Add(con[1]);
                drpDrives.SelectedIndex = drpDrives.Items.Count - 1;
                dbgmsg("Override command -- Drive selection set and added -- " + con[1]);
                break;

            case "exit":
                Application.Exit();
                break;

            case "setoverflowcount":
                overflowCount = Convert.ToInt32(con[1]);
                dbgmsg("Overflow loop count changed to " + con[1]);
                break;

            case "setimagelocation":
                imgFileIcon.ImageLocation = con[1];
                dbgmsg("Image location set : " + con[1]);
                break;

            case "cls":
                dbgRtb.Text = "";
                break;

            case "overflowdebugmsg":
                dbgmsg("The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog The quick brown fox jumps over the lazy dog");
                break;

            case "showpayloadfile":
                dbgmsg("payloadFile[0]=" + payloadFile[0]);
                dbgmsg("payloadFile[1]=" + payloadFile[1]);
                break;

            case "checkcomp":     //Check the function documentation of "checkComponent" to know the debug arguments/parameters
                dbgmsg("Testing checkComponent() Function");
                dbgmsg("Test returned a value of: " + checkComponent(con[1], con[2], con[3], con[4], con[5]).ToString());
                break;

            case "teststrformat":
                dbgmsg("strformat:" + String.Format(con[1], con[2]));
                break;

            case "formsetwidth":
                dbgmsg("Form width set to: " + con[1]);
                this.Width = Convert.ToInt32(con[1]);
                break;

            case "cleanup":
                cleanup();
                break;

            case "showallui":
                dbgmsg("showing all ui...");
                about        _a = new about();
                buildPayload _b = new buildPayload();
                minipad      _c = new minipad();
                _a.Show();
                _b.Show();
                _c.Show();
                break;

            case "rtlo":
                dbgmsg(globalClass.rtlo + con[1]);
                break;

            case "getserial":
                dbgmsg("driveserial: " + getSerial(con[1]));
                break;

            case "testnet":
                dbgmsg("result:" + testNet(con[1]));
                break;

            case "rep":
                dbgmsg("result: " + con[1].Replace("\"", "\"\""));
                break;

            default:
                dbgmsg("Bad command! Available commands:\nsetdrive [driveletter]\nsetoverflowcount [integer]\nsetimagelocation [filepath]\nshowpayloadfile\noverflowdebugmsg\ncheckcomp [name] [filename] [size] [link] [desc]\nteststrformat [string] [data]\nformsetwidth [integer]\ncleanup\nshowallui\nrtlo [string]\ngetserial [drive]\ntestnet [address]\nrep [string]\ncls\nexit\n");
                break;
            }
            tbConsole.Text = "";
        }