aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms
diff options
context:
space:
mode:
authorMichael VanOverbeek <[email protected]>2017-06-30 14:07:54 +0000
committerGitHub <[email protected]>2017-06-30 14:07:54 +0000
commit5dcdd43f68927882a71ed554d051fe5e27c7fdc5 (patch)
tree9fa45024179631c61f6f522aff511f85c209a719 /ShiftOS.WinForms
parentcca7e62962dd1ad85fa5bfd232e3c4aa50aa3292 (diff)
parentf3df7ec6b988424445a85624528e3068a92130be (diff)
downloadshiftos_thereturn-5dcdd43f68927882a71ed554d051fe5e27c7fdc5.tar.gz
shiftos_thereturn-5dcdd43f68927882a71ed554d051fe5e27c7fdc5.tar.bz2
shiftos_thereturn-5dcdd43f68927882a71ed554d051fe5e27c7fdc5.zip
Merge pull request #135 from IBMPCDOS5/master
Added Shifticide Virus
Diffstat (limited to 'ShiftOS.WinForms')
-rw-r--r--ShiftOS.WinForms/ShiftOS.WinForms.csproj1
-rw-r--r--ShiftOS.WinForms/Viruses/Shifticide.cs32
2 files changed, 33 insertions, 0 deletions
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 @@
<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" />
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");
+ }
+ }
+}