mirror of
https://git.alee14.me/shiftos-archive/ShiftOS_TheReturn.git
synced 2025-01-22 09:52:15 +00:00
Added Shifticide Virus
Deletes home directory
This commit is contained in:
parent
cca7e62962
commit
f3df7ec6b9
4 changed files with 40 additions and 0 deletions
7
.vs/VSWorkspaceState.json
Normal file
7
.vs/VSWorkspaceState.json
Normal file
|
@ -0,0 +1,7 @@
|
|||
{
|
||||
"ExpandedNodes": [
|
||||
""
|
||||
],
|
||||
"SelectedNode": "\\ShiftOS_TheReturn.sln",
|
||||
"PreviewInSolutionExplorer": false
|
||||
}
|
BIN
.vs/slnx.sqlite
Normal file
BIN
.vs/slnx.sqlite
Normal file
Binary file not shown.
|
@ -478,6 +478,7 @@
|
|||
<Compile Include="Viruses\BeeperVirus.cs" />
|
||||
<Compile Include="Viruses\ConsoleGarble.cs" />
|
||||
<Compile Include="Viruses\CPLeach.cs" />
|
||||
<Compile Include="Viruses\Shifticide.cs" />
|
||||
<Compile Include="Viruses\WindowsEverywhere.cs" />
|
||||
<Compile Include="VirusTestCommands.cs" />
|
||||
<Compile Include="VisualBasicStuff.cs" />
|
||||
|
|
32
ShiftOS.WinForms/Viruses/Shifticide.cs
Normal file
32
ShiftOS.WinForms/Viruses/Shifticide.cs
Normal file
|
@ -0,0 +1,32 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using ShiftOS.Engine;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace ShiftOS.WinForms.Viruses
|
||||
{
|
||||
[Virus("shifticide", "Shifticide", "Extremely deadly virus. This will delete your Home directory, and cannot be recovered.")]
|
||||
public class Shifticide : IVirus
|
||||
{
|
||||
private Timer _virusTimer = null;
|
||||
void IVirus.Disinfect()
|
||||
{
|
||||
_virusTimer.Stop();
|
||||
_virusTimer = null;
|
||||
if (ShiftOS.Objects.ShiftFS.Utils.DirectoryExists("0:/home"))
|
||||
ShiftOS.Objects.ShiftFS.Utils.CreateDirectory("0:/home");
|
||||
|
||||
}
|
||||
|
||||
void IVirus.Infect(int threatlevel)
|
||||
{
|
||||
_virusTimer = new Timer();
|
||||
_virusTimer.Interval = 5000 / threatlevel;
|
||||
if (ShiftOS.Objects.ShiftFS.Utils.DirectoryExists("0:/home"))
|
||||
ShiftOS.Objects.ShiftFS.Utils.Delete("0:/home");
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue