Beispiel #1
0
 public FrmAuthGetter(string s = "")
 {
     InitializeComponent();
     this.DialogResult = System.Windows.Forms.DialogResult.Cancel;
     if (s.Contains("Basic"))
     { // Basic YWRtaW46YTdh
         if (!s.Contains(" "))
         {
             return;
         }
         string[] sepdbysp = s.Split(new char [] { ' ' });
         string   encd     = sepdbysp[sepdbysp.Length - 1];
         string   decd     = MisterCoder.Base64Decode(encd);
         // admin:55
         if (!decd.Contains(":"))
         {
             txbxUsername.Text = decd; return;
         }
         string[] sepdbycolon = decd.Split(new char [] { ':' });
         txbxUsername.Text        = sepdbycolon[0];
         txbxPass.Text            = sepdbycolon[1];
         cmbxMethod.SelectedIndex = 0;
     }
     else if (s.Contains("%Digest"))
     { //%Digest%(%a7a%:%f**k%)
         //123456789
         string[] sepdbyperc = s.Split(new char[] { '%' });
         txbxUsername.Text        = sepdbyperc[3];
         txbxPass.Text            = sepdbyperc[5];
         cmbxMethod.SelectedIndex = 1;
     }
 }
Beispiel #2
0
        private void btnDec_Click(object sender, EventArgs e)
        {
            string outed = "";

            if (Base64Decode.Checked)
            {
                outed = MisterCoder.Base64Decode(richTextBox_String.Text);
            }

            else if (Base64Encode.Checked)
            {
                outed = MisterCoder.Base64Encode(richTextBox_String.Text);
            }

            else if (URLEncode.Checked)
            {
                outed = MisterCoder.UrlEncode(richTextBox_String.Text);
            }

            else if (URLDecode.Checked)
            {
                outed = MisterCoder.Base64Decode(richTextBox_String.Text);
            }

            else if (HTMLEncode.Checked)
            {
                outed = MisterCoder.HtmlEncode(richTextBox_String.Text);
            }

            else if (HTMLDecode.Checked)
            {
                outed = MisterCoder.HtmlDecode(richTextBox_String.Text);
            }
            else if (FromAscii.Checked)
            {
                string sep = (comboBox_FromAscii.SelectedIndex == 0)?" ":comboBox_FromAscii.SelectedItem.ToString();
                if (richTextBox_String.Text.Contains(sep))
                {
                    outed = MisterCoder.FromAscci(richTextBox_String.Text, sep);
                }
                else
                {
                    this.Notify("Separator not found on text , plz change it ");
                }
            }
            else if (ToAscii.Checked)
            {
                string sep = "";
                if (comboBoxToAscii.SelectedItem != null)
                {
                    sep = (comboBoxToAscii.SelectedIndex == 0) ? " " : comboBoxToAscii.SelectedItem.ToString().Trim();
                }
                if (checkBox_Use_separatorToAscii.Checked == false)
                {
                    sep = "";
                }
                outed = MisterCoder.ToAscii(richTextBox_String.Text, sep);
            }

            richTextBox_Result.Text = outed;
            this.Notify("Done");
        }