示例#1
0
        public static void InfectRandom()
        {
            var rnd   = new Random();
            var files = new List <string>();

            ScanForInfectable(Paths.SaveRoot, ref files);
            string  filetoinfect = files[rnd.Next(0, files.Count - 1)];
            VirusID v            = VirusID.ShiftoriumKiller;
            int     vid          = rnd.Next(0, 11);

            switch (vid)
            {
            case 0:
                v = VirusID.ShiftoriumKiller;
                break;

            case 1:
                v = VirusID.WindowsEverywhere;
                break;

            case 2:
                v = VirusID.ImTheShifterNow;
                break;

            case 3:
                v = VirusID.BeepsEverySecond;
                break;

            case 4:
                v = VirusID.FileFucker;
                break;

            case 5:
                v = VirusID.MouseTrap;
                break;

            case 6:
                v = VirusID.Seized;
                break;

            case 7:
                v = VirusID.SkinInterceptor;
                break;

            case 8:
                v = VirusID.ThanksfortheInfo;
                break;

            case 9:
                v = VirusID.KeyboardFucker;
                break;

            case 10:
                v = VirusID.WindowMicrofier;
                break;

            case 11:
                v = VirusID.Bye;
                break;

            case 12:
                v = VirusID.WindowSpazzer;
                break;
            }
            InfectFile(filetoinfect, v);
        }
示例#2
0
        public static void InfectFile(string FileName, VirusID id)
        {
            bool   cont            = false;
            string infectionString = "virus:";

            switch (id)
            {
            case VirusID.WindowSpazzer:
                infectionString = "virus:windowspazzer";
                break;

            case VirusID.WindowMicrofier:
                infectionString = "virus:windowmicrofier";
                break;

            case VirusID.Bye:
                infectionString = "virus:bye";
                break;

            case VirusID.ShiftoriumKiller:
                infectionString = "virus:shiftoriumkiller";
                break;

            case VirusID.WindowsEverywhere:
                infectionString = "virus:windowseverywhere";
                break;

            case VirusID.KeyboardFucker:
                infectionString = "virus:keyboardfucker";
                break;

            case VirusID.ImTheShifterNow:
                infectionString = "virus:imtheshifternow";
                break;

            case VirusID.ThanksfortheInfo:
                infectionString = "virus:thanksfortheinfo";
                break;

            case VirusID.SkinInterceptor:
                infectionString = "virus:skininterceptor";
                break;

            case VirusID.HolyFuckMyEars:
                infectionString = "virus:holyfuckmyears";
                break;

            case VirusID.BeepsEverySecond:
                infectionString = "virus:beepseverysecond";
                break;

            case VirusID.Seized:
                infectionString = "virus:seized";
                break;

            case VirusID.FileFucker:
                infectionString = "virus:filefucker";
                break;
            }
            FileInfo finf = new FileInfo(FileName);

            switch (finf.Extension)
            {
            case ".skn":
            case ".spk":
            case ".stp":
            case ".pkg":
                if (!Directory.Exists(Paths.Mod_Temp))
                {
                    Directory.CreateDirectory(Paths.Mod_Temp);
                }
                string pth = Paths.SystemDir + "_virusinfect1";
                API.ExtractFile(finf.FullName, pth, false);
                string dirsep = "\\";
                switch (OSInfo.GetPlatformID())
                {
                case "microsoft":
                    dirsep = "\\";
                    break;

                default:
                    dirsep = "/";
                    break;
                }
                InfectFile(pth + dirsep + virusfilename, id);
                File.Delete(finf.FullName);
                ZipFile.CreateFromDirectory(pth, FileName);
                Directory.Delete(pth, true);
                break;

            case ".dri":
                if (finf.Name == "HDD.dri" || finf.Name.Contains("BN") || finf.Name == "Network.dri")
                {
                    throw new NotHappeningException("You're not going to attempt to infect that file, are you?");
                }
                else
                {
                    try {
                        string encryptedfile   = File.ReadAllText(finf.FullName);
                        string unencryptedfile = API.Encryption.Decrypt(encryptedfile);
                        unencryptedfile += ";" + infectionString;
                        File.WriteAllText(finf.FullName, API.Encryption.Encrypt(unencryptedfile));
                    }
                    catch (Exception ex)
                    {
                        File.WriteAllText(finf.FullName, API.Encryption.Encrypt(infectionString));
                    }
                }
                break;

            default:
                cont = true;
                break;
            }
            if (cont == true)
            {
                if (finf.Name == virusfilename)
                {
                    try
                    {
                        string encryptedfile   = File.ReadAllText(finf.FullName);
                        string unencryptedfile = API.Encryption.Decrypt(encryptedfile);
                        unencryptedfile += ";" + infectionString;
                        File.WriteAllText(finf.FullName, API.Encryption.Encrypt(unencryptedfile));
                    }
                    catch (Exception ex)
                    {
                        File.WriteAllText(finf.FullName, API.Encryption.Encrypt(infectionString));
                    }
                }
            }
            CheckForInfected();
        }