aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.Frontend/Hacking
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-07-27 17:27:31 -0700
committerwilliam341 <[email protected]>2017-07-27 17:27:31 -0700
commit2d5b566da493c8669d05df2e8004f7ba6a2d29d5 (patch)
treeb06f1e9918a929db0c1d457eb9eb73e859115553 /ShiftOS.Frontend/Hacking
parente5aec8a0531fe78dcc881a11b589b5a19338e503 (diff)
downloadshiftos_thereturn-2d5b566da493c8669d05df2e8004f7ba6a2d29d5.tar.gz
shiftos_thereturn-2d5b566da493c8669d05df2e8004f7ba6a2d29d5.tar.bz2
shiftos_thereturn-2d5b566da493c8669d05df2e8004f7ba6a2d29d5.zip
hacking p2
Diffstat (limited to 'ShiftOS.Frontend/Hacking')
-rw-r--r--ShiftOS.Frontend/Hacking/HackableProvider.cs5
-rw-r--r--ShiftOS.Frontend/Hacking/HackerTestCommands.cs45
2 files changed, 50 insertions, 0 deletions
diff --git a/ShiftOS.Frontend/Hacking/HackableProvider.cs b/ShiftOS.Frontend/Hacking/HackableProvider.cs
index 6198b0c..5419030 100644
--- a/ShiftOS.Frontend/Hacking/HackableProvider.cs
+++ b/ShiftOS.Frontend/Hacking/HackableProvider.cs
@@ -26,6 +26,11 @@ namespace ShiftOS.Frontend
return JsonConvert.DeserializeObject<Payload[]>(Properties.Resources.Payloads);
}
+ public Port[] GetPorts()
+ {
+ return JsonConvert.DeserializeObject<Port[]>(Properties.Resources.Ports);
+ }
+
public byte[] GetLootFromResource(string resId)
{
return new byte[] { 0xDE, 0xAD, 0xBE, 0xEF }; //nyi
diff --git a/ShiftOS.Frontend/Hacking/HackerTestCommands.cs b/ShiftOS.Frontend/Hacking/HackerTestCommands.cs
index 675356a..a72f267 100644
--- a/ShiftOS.Frontend/Hacking/HackerTestCommands.cs
+++ b/ShiftOS.Frontend/Hacking/HackerTestCommands.cs
@@ -19,6 +19,33 @@ namespace ShiftOS.Frontend
}
}
+ [Command("lsexploits")]
+ public static void ListAllExploits()
+ {
+ foreach (var exploit in Hacking.AvailableExploits)
+ {
+ Console.WriteLine(exploit.ID + ": " + exploit.FriendlyName);
+ }
+ }
+
+ [Command("lspayloads")]
+ public static void ListAllPayloads()
+ {
+ foreach (var exploit in Hacking.AvailablePayloads)
+ {
+ Console.WriteLine(exploit.ID + ": " + exploit.FriendlyName);
+ }
+ }
+
+ [Command("lsports")]
+ public static void ListAllPorts()
+ {
+ foreach (var exploit in Hacking.AvailablePorts)
+ {
+ Console.WriteLine(exploit.ID + ": " + exploit.FriendlyName);
+ }
+ }
+
[Command("describebackable")]
[RequiresArgument("id")]
public static void DescribeHackable(Dictionary<string, object> args)
@@ -41,6 +68,24 @@ namespace ShiftOS.Frontend
Console.WriteLine(hackable.WelcomeMessage);
}
+ [Command("describeport")]
+ [RequiresArgument("id")]
+ public static void DescribePort(Dictionary<string, object> args)
+ {
+ string id = args["id"].ToString();
+ var port = Hacking.AvailablePorts.FirstOrDefault(x => x.ID == id);
+ if (port == null)
+ {
+ Console.WriteLine("Port not found.");
+ return;
+ }
+ Console.WriteLine(port.FriendlyName);
+ Console.WriteLine("------------------------");
+ Console.WriteLine();
+ Console.WriteLine("Port: " + port.Value.ToString());
+ Console.WriteLine("Name: " + port.Name);
+ }
+
[Command("inithack")]
[RequiresArgument("id")]
public static void InitHack(Dictionary<string, object> args)