aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwilliam341 <[email protected]>2017-07-27 16:34:27 -0700
committerwilliam341 <[email protected]>2017-07-27 16:34:27 -0700
commit18079c6f43981f1bf9fc093b3c5b68873fe90348 (patch)
tree7be93f2caeaca5208a02be627cb50d36e718cad1
parent86dde20529e926ee75af2b1e3a574f6729bd8771 (diff)
downloadshiftos_thereturn-18079c6f43981f1bf9fc093b3c5b68873fe90348.tar.gz
shiftos_thereturn-18079c6f43981f1bf9fc093b3c5b68873fe90348.tar.bz2
shiftos_thereturn-18079c6f43981f1bf9fc093b3c5b68873fe90348.zip
hacking p1
-rw-r--r--ShiftOS.Frontend/Hacking/HackableProvider.cs (renamed from ShiftOS.Frontend/HackableProvider.cs)10
-rw-r--r--ShiftOS.Frontend/Hacking/HackerTestCommands.cs (renamed from ShiftOS.Frontend/HackerTestCommands.cs)0
-rw-r--r--ShiftOS.Frontend/Properties/Resources.Designer.cs53
-rw-r--r--ShiftOS.Frontend/Resources/Exploits.txt13
-rw-r--r--ShiftOS.Frontend/Resources/Payloads.txt14
-rw-r--r--ShiftOS.Objects/Hacking/Exploit.cs30
-rw-r--r--ShiftOS.Objects/Hacking/Hackable.cs (renamed from ShiftOS.Objects/Hackable.cs)0
-rw-r--r--ShiftOS.Objects/Hacking/Payload.cs31
-rw-r--r--ShiftOS_TheReturn/GUI/FileSkimmerBackend.cs (renamed from ShiftOS_TheReturn/FileSkimmerBackend.cs)0
-rw-r--r--ShiftOS_TheReturn/GUI/IShiftOSWindow.cs (renamed from ShiftOS_TheReturn/IShiftOSWindow.cs)0
-rw-r--r--ShiftOS_TheReturn/GUI/IStatusIcon.cs (renamed from ShiftOS_TheReturn/IStatusIcon.cs)0
-rw-r--r--ShiftOS_TheReturn/GUI/OutOfBoxExperience.cs (renamed from ShiftOS_TheReturn/OutOfBoxExperience.cs)0
-rw-r--r--ShiftOS_TheReturn/GUI/Skinning.cs (renamed from ShiftOS_TheReturn/Skinning.cs)0
-rw-r--r--ShiftOS_TheReturn/GUI/TutorialManager.cs (renamed from ShiftOS_TheReturn/TutorialManager.cs)0
-rw-r--r--ShiftOS_TheReturn/GUI/WinOpenAttribute.cs (renamed from ShiftOS_TheReturn/WinOpenAttribute.cs)0
-rw-r--r--ShiftOS_TheReturn/Hacking.cs23
16 files changed, 161 insertions, 13 deletions
diff --git a/ShiftOS.Frontend/HackableProvider.cs b/ShiftOS.Frontend/Hacking/HackableProvider.cs
index 1c57f37..6198b0c 100644
--- a/ShiftOS.Frontend/HackableProvider.cs
+++ b/ShiftOS.Frontend/Hacking/HackableProvider.cs
@@ -16,6 +16,16 @@ namespace ShiftOS.Frontend
return JsonConvert.DeserializeObject<Hackable[]>(Properties.Resources.Hackables);
}
+ public Exploit[] GetExploits()
+ {
+ return JsonConvert.DeserializeObject<Exploit[]>(Properties.Resources.Exploits);
+ }
+
+ public Payload[] GetPayloads()
+ {
+ return JsonConvert.DeserializeObject<Payload[]>(Properties.Resources.Payloads);
+ }
+
public byte[] GetLootFromResource(string resId)
{
return new byte[] { 0xDE, 0xAD, 0xBE, 0xEF }; //nyi
diff --git a/ShiftOS.Frontend/HackerTestCommands.cs b/ShiftOS.Frontend/Hacking/HackerTestCommands.cs
index 675356a..675356a 100644
--- a/ShiftOS.Frontend/HackerTestCommands.cs
+++ b/ShiftOS.Frontend/Hacking/HackerTestCommands.cs
diff --git a/ShiftOS.Frontend/Properties/Resources.Designer.cs b/ShiftOS.Frontend/Properties/Resources.Designer.cs
index 3d40c29..e21b46e 100644
--- a/ShiftOS.Frontend/Properties/Resources.Designer.cs
+++ b/ShiftOS.Frontend/Properties/Resources.Designer.cs
@@ -22,7 +22,7 @@ namespace ShiftOS.Frontend.Properties {
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
- internal class Resources {
+ public class Resources {
private static global::System.Resources.ResourceManager resourceMan;
@@ -36,7 +36,7 @@ namespace ShiftOS.Frontend.Properties {
/// Returns the cached ResourceManager instance used by this class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Resources.ResourceManager ResourceManager {
+ public static global::System.Resources.ResourceManager ResourceManager {
get {
if (object.ReferenceEquals(resourceMan, null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("ShiftOS.Frontend.Properties.Resources", typeof(Resources).Assembly);
@@ -51,7 +51,7 @@ namespace ShiftOS.Frontend.Properties {
/// resource lookups using this strongly typed resource class.
/// </summary>
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
- internal static global::System.Globalization.CultureInfo Culture {
+ public static global::System.Globalization.CultureInfo Culture {
get {
return resourceCulture;
}
@@ -63,7 +63,7 @@ namespace ShiftOS.Frontend.Properties {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
- internal static System.Drawing.Bitmap cursor_9x_pointer {
+ public static System.Drawing.Bitmap cursor_9x_pointer {
get {
object obj = ResourceManager.GetObject("cursor_9x_pointer", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
@@ -71,6 +71,15 @@ namespace ShiftOS.Frontend.Properties {
}
/// <summary>
+ /// Looks up a localized string similar to .
+ /// </summary>
+ public static string Exploits {
+ get {
+ return ResourceManager.GetString("Exploits", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to /* ShiftOS hackables data file
/// *
/// * This file contains information about all hackable systems in the game&apos;s campaign.
@@ -93,7 +102,7 @@ namespace ShiftOS.Frontend.Properties {
/// }
///].
/// </summary>
- internal static string Hackables {
+ public static string Hackables {
get {
return ResourceManager.GetString("Hackables", resourceCulture);
}
@@ -102,7 +111,7 @@ namespace ShiftOS.Frontend.Properties {
/// <summary>
/// Looks up a localized resource of type System.Drawing.Bitmap.
/// </summary>
- internal static System.Drawing.Bitmap justthes {
+ public static System.Drawing.Bitmap justthes {
get {
object obj = ResourceManager.GetObject("justthes", resourceCulture);
return ((System.Drawing.Bitmap)(obj));
@@ -114,16 +123,38 @@ namespace ShiftOS.Frontend.Properties {
///
///[].
/// </summary>
- internal static string LootInfo {
+ public static string LootInfo {
get {
return ResourceManager.GetString("LootInfo", resourceCulture);
}
}
/// <summary>
+ /// Looks up a localized string similar to /* ShiftOS Payloads data file
+ /// *
+ /// * This file contains information about all payloads in the game&apos;s campaign.
+ /// *
+ /// */
+ ///
+ ///[
+ /// {
+ /// FriendlyName: &quot;FTP Exploit&quot;,
+ /// PayloadName: &quot;ftpull&quot;
+ /// EffectiveAgainstFirewall: 1,
+ /// EffectiveAgainstPort: &quot;FileServer&quot;,
+ /// }
+ ///].
+ /// </summary>
+ public static string Payloads {
+ get {
+ return ResourceManager.GetString("Payloads", resourceCulture);
+ }
+ }
+
+ /// <summary>
/// Looks up a localized string similar to [].
/// </summary>
- internal static string Shiftorium {
+ public static string Shiftorium {
get {
return ResourceManager.GetString("Shiftorium", resourceCulture);
}
@@ -140,7 +171,7 @@ namespace ShiftOS.Frontend.Properties {
///
///Commands können mit argumenten versehen werden, indem du ein key-value Paar in einem {} Block hinter dem command angibst. Zum Be [rest of string was truncated]&quot;;.
/// </summary>
- internal static string strings_de {
+ public static string strings_de {
get {
return ResourceManager.GetString("strings_de", resourceCulture);
}
@@ -165,7 +196,7 @@ namespace ShiftOS.Frontend.Properties {
/// &quot;{GEN_PASSWORD}&quot;: &quot;Password&quot;,
/// &quot;{GEN_LPROMPT [rest of string was truncated]&quot;;.
/// </summary>
- internal static string strings_en {
+ public static string strings_en {
get {
return ResourceManager.GetString("strings_en", resourceCulture);
}
@@ -189,7 +220,7 @@ namespace ShiftOS.Frontend.Properties {
/// &quot;{GEN_SYSTEMNAME}&quot;: &quot;Nom de système&quot;,
/// &quot;{GEN_PASSWORD}&quot;: &quot;Mot de [rest of string was truncated]&quot;;.
/// </summary>
- internal static string strings_fr {
+ public static string strings_fr {
get {
return ResourceManager.GetString("strings_fr", resourceCulture);
}
diff --git a/ShiftOS.Frontend/Resources/Exploits.txt b/ShiftOS.Frontend/Resources/Exploits.txt
new file mode 100644
index 0000000..0e0dd64
--- /dev/null
+++ b/ShiftOS.Frontend/Resources/Exploits.txt
@@ -0,0 +1,13 @@
+/* ShiftOS Exploits data file
+ *
+ * This file contains information about all exploits in the game's campaign.
+ *
+ */
+
+[
+ {
+ FriendlyName: "FTP Exploit",
+ ExploitName: "ftpwn"
+ EffectiveAgainstPort: "FileServer",
+ }
+] \ No newline at end of file
diff --git a/ShiftOS.Frontend/Resources/Payloads.txt b/ShiftOS.Frontend/Resources/Payloads.txt
new file mode 100644
index 0000000..926a23f
--- /dev/null
+++ b/ShiftOS.Frontend/Resources/Payloads.txt
@@ -0,0 +1,14 @@
+/* ShiftOS Payloads data file
+ *
+ * This file contains information about all payloads in the game's campaign.
+ *
+ */
+
+[
+ {
+ FriendlyName: "FTP Exploit",
+ PayloadName: "ftpull"
+ EffectiveAgainstFirewall: 1,
+ EffectiveAgainstPort: "FileServer",
+ }
+] \ No newline at end of file
diff --git a/ShiftOS.Objects/Hacking/Exploit.cs b/ShiftOS.Objects/Hacking/Exploit.cs
new file mode 100644
index 0000000..7e83c3a
--- /dev/null
+++ b/ShiftOS.Objects/Hacking/Exploit.cs
@@ -0,0 +1,30 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ShiftOS.Objects
+{
+ public class Exploit
+ {
+ public string FriendlyName { get; set; }
+ public string ExploitName { get; set; }
+ public SystemType EffectiveAgainst { get; set; }
+ public string Dependencies { get; set; }
+
+ public string ID
+ {
+ get
+ {
+ return ExploitName.ToLower().Replace(" ", "_");
+ }
+ }
+
+ public override string ToString()
+ {
+ return $"{FriendlyName} ({ExploitName})";
+ }
+ }
+
+}
diff --git a/ShiftOS.Objects/Hackable.cs b/ShiftOS.Objects/Hacking/Hackable.cs
index 4596d2d..4596d2d 100644
--- a/ShiftOS.Objects/Hackable.cs
+++ b/ShiftOS.Objects/Hacking/Hackable.cs
diff --git a/ShiftOS.Objects/Hacking/Payload.cs b/ShiftOS.Objects/Hacking/Payload.cs
new file mode 100644
index 0000000..a3800fa
--- /dev/null
+++ b/ShiftOS.Objects/Hacking/Payload.cs
@@ -0,0 +1,31 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+namespace ShiftOS.Objects
+{
+ public class Payload
+ {
+ public string FriendlyName { get; set; }
+ public string PayloadName { get; set; }
+ public int EffectiveAgainstFirewall { get; set; }
+ public SystemType EffectiveAgainstPort { get; set; }
+ public string Dependencies { get; set; }
+
+ public string ID
+ {
+ get
+ {
+ return PayloadName.ToLower().Replace(" ", "_");
+ }
+ }
+
+ public override string ToString()
+ {
+ return $"{FriendlyName} ({PayloadName})";
+ }
+ }
+
+}
diff --git a/ShiftOS_TheReturn/FileSkimmerBackend.cs b/ShiftOS_TheReturn/GUI/FileSkimmerBackend.cs
index b14733f..b14733f 100644
--- a/ShiftOS_TheReturn/FileSkimmerBackend.cs
+++ b/ShiftOS_TheReturn/GUI/FileSkimmerBackend.cs
diff --git a/ShiftOS_TheReturn/IShiftOSWindow.cs b/ShiftOS_TheReturn/GUI/IShiftOSWindow.cs
index e4a5a21..e4a5a21 100644
--- a/ShiftOS_TheReturn/IShiftOSWindow.cs
+++ b/ShiftOS_TheReturn/GUI/IShiftOSWindow.cs
diff --git a/ShiftOS_TheReturn/IStatusIcon.cs b/ShiftOS_TheReturn/GUI/IStatusIcon.cs
index f32d1c1..f32d1c1 100644
--- a/ShiftOS_TheReturn/IStatusIcon.cs
+++ b/ShiftOS_TheReturn/GUI/IStatusIcon.cs
diff --git a/ShiftOS_TheReturn/OutOfBoxExperience.cs b/ShiftOS_TheReturn/GUI/OutOfBoxExperience.cs
index eb8e61d..eb8e61d 100644
--- a/ShiftOS_TheReturn/OutOfBoxExperience.cs
+++ b/ShiftOS_TheReturn/GUI/OutOfBoxExperience.cs
diff --git a/ShiftOS_TheReturn/Skinning.cs b/ShiftOS_TheReturn/GUI/Skinning.cs
index d8549f6..d8549f6 100644
--- a/ShiftOS_TheReturn/Skinning.cs
+++ b/ShiftOS_TheReturn/GUI/Skinning.cs
diff --git a/ShiftOS_TheReturn/TutorialManager.cs b/ShiftOS_TheReturn/GUI/TutorialManager.cs
index 13df153..13df153 100644
--- a/ShiftOS_TheReturn/TutorialManager.cs
+++ b/ShiftOS_TheReturn/GUI/TutorialManager.cs
diff --git a/ShiftOS_TheReturn/WinOpenAttribute.cs b/ShiftOS_TheReturn/GUI/WinOpenAttribute.cs
index c617360..c617360 100644
--- a/ShiftOS_TheReturn/WinOpenAttribute.cs
+++ b/ShiftOS_TheReturn/GUI/WinOpenAttribute.cs
diff --git a/ShiftOS_TheReturn/Hacking.cs b/ShiftOS_TheReturn/Hacking.cs
index 9ace50e..1e66f26 100644
--- a/ShiftOS_TheReturn/Hacking.cs
+++ b/ShiftOS_TheReturn/Hacking.cs
@@ -10,6 +10,8 @@ namespace ShiftOS.Engine
{
private static List<HackableSystem> _activeConnections = new List<HackableSystem>();
private static List<Objects.Hackable> Hackables = new List<Objects.Hackable>();
+ private static List<Objects.Exploit> Exploits = new List<Objects.Exploit>();
+ private static List<Objects.Payload> Payloads = new List<Objects.Payload>();
private static List<Objects.Loot> Loot = new List<Objects.Loot>();
public static HackableSystem CurrentHackable { get; private set; }
@@ -22,6 +24,21 @@ namespace ShiftOS.Engine
}
}
+ public static Objects.Exploit[] AvailableExploits
+ {
+ get
+ {
+ return Exploits.Where(x => Shiftorium.UpgradeInstalled(x.Dependencies) && !Shiftorium.UpgradeInstalled(x.ID)).ToArray();
+ }
+ }
+
+ public static Objects.Payload[] AvailablePayloads
+ {
+ get
+ {
+ return Payloads.Where(x => Shiftorium.UpgradeInstalled(x.Dependencies) && !Shiftorium.UpgradeInstalled(x.ID)).ToArray();
+ }
+ }
public static HackableSystem[] ActiveConnections
{
@@ -178,10 +195,10 @@ namespace ShiftOS.Engine
public class NaughtyDeveloperException : Exception
{
/// <summary>
- /// Create a new instance of the <see cref="NaughtyDeveloperException"/>, with the specified message, which will cause Visual Studio to call the person who caused the exception a scrotem.
+ /// Create a new instance of the <see cref="NaughtyDeveloperException"/>, with the specified message, which will cause Visual Studio to call the person who caused the exception a scrotum.
/// </summary>
/// <param name="message">The message you want to yell at the user.</param>
- public NaughtyDeveloperException(string message) : base(message + " - FIX IT, YOU SCROTEM")
+ public NaughtyDeveloperException(string message) : base(message + " - FIX IT, YOU SCROTUM")
{
}
@@ -198,6 +215,8 @@ namespace ShiftOS.Engine
public interface IHackableProvider
{
Objects.Hackable[] GetHackables();
+ Objects.Exploit[] GetExploits();
+ Objects.Payload[] GetPayloads();
Objects.LootInfo[] GetLootInfo();
byte[] GetLootFromResource(string resId);
}