From f3df7ec6b988424445a85624528e3068a92130be Mon Sep 17 00:00:00 2001 From: IBMPCDOS5 Date: Thu, 29 Jun 2017 21:19:21 -0500 Subject: Added Shifticide Virus Deletes home directory --- .vs/VSWorkspaceState.json | 7 +++++++ .vs/slnx.sqlite | Bin 0 -> 4218880 bytes ShiftOS.WinForms/ShiftOS.WinForms.csproj | 1 + ShiftOS.WinForms/Viruses/Shifticide.cs | 32 +++++++++++++++++++++++++++++++ 4 files changed, 40 insertions(+) create mode 100644 .vs/VSWorkspaceState.json create mode 100644 .vs/slnx.sqlite create mode 100644 ShiftOS.WinForms/Viruses/Shifticide.cs diff --git a/.vs/VSWorkspaceState.json b/.vs/VSWorkspaceState.json new file mode 100644 index 0000000..893b457 --- /dev/null +++ b/.vs/VSWorkspaceState.json @@ -0,0 +1,7 @@ +{ + "ExpandedNodes": [ + "" + ], + "SelectedNode": "\\ShiftOS_TheReturn.sln", + "PreviewInSolutionExplorer": false +} \ No newline at end of file diff --git a/.vs/slnx.sqlite b/.vs/slnx.sqlite new file mode 100644 index 0000000..34edb98 Binary files /dev/null and b/.vs/slnx.sqlite differ diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index 65c658f..fc9c861 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -478,6 +478,7 @@ + diff --git a/ShiftOS.WinForms/Viruses/Shifticide.cs b/ShiftOS.WinForms/Viruses/Shifticide.cs new file mode 100644 index 0000000..2efa743 --- /dev/null +++ b/ShiftOS.WinForms/Viruses/Shifticide.cs @@ -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"); + } + } +} -- cgit v1.2.3