From 37cf129165916101ba665891d157c85ea9c37383 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 2 Aug 2017 10:23:13 -0400 Subject: The first loot! --- ShiftOS.Frontend/Hacking/HackableProvider.cs | 2 +- ShiftOS.Frontend/Hacking/HackerTestCommands.cs | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) (limited to 'ShiftOS.Frontend/Hacking') diff --git a/ShiftOS.Frontend/Hacking/HackableProvider.cs b/ShiftOS.Frontend/Hacking/HackableProvider.cs index 83409c5..d661147 100644 --- a/ShiftOS.Frontend/Hacking/HackableProvider.cs +++ b/ShiftOS.Frontend/Hacking/HackableProvider.cs @@ -13,7 +13,7 @@ namespace ShiftOS.Frontend { public byte[] FindLootBytes(string id) { - foreach(var res in typeof(Properties.Resources).GetProperties(System.Reflection.BindingFlags.NonPublic | System.Reflection.BindingFlags.Static)) + foreach(var res in typeof(Properties.Resources).GetProperties(System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Static)) { if(res.Name == id) { diff --git a/ShiftOS.Frontend/Hacking/HackerTestCommands.cs b/ShiftOS.Frontend/Hacking/HackerTestCommands.cs index 72c648e..77bb378 100644 --- a/ShiftOS.Frontend/Hacking/HackerTestCommands.cs +++ b/ShiftOS.Frontend/Hacking/HackerTestCommands.cs @@ -10,6 +10,22 @@ namespace ShiftOS.Frontend { public static class HackerTestCommands { + [ShellConstraint("shiftos_debug> ")] + [Command("loot")] + [RequiresArgument("id")] + public static void ViewLoot(Dictionary args) + { + string id = args["id"].ToString(); + var loot = Hacking.AvailableLoot.FirstOrDefault(x => x.ID == id); + if(loot == null) + { + Console.WriteLine("Loot ID not found."); + return; + } + Objects.ShiftFS.Utils.WriteAllBytes("0:/" + loot.LootName, Hacking.GetLootBytes(loot.ID)); + FileSkimmerBackend.OpenFile("0:/" + loot.LootName); + } + [ShellConstraint("shiftos_debug> ")] [Command("lsports")] public static void ListAllPorts() -- cgit v1.2.3