@tra38/

PARANOIA Campaign Generator

C#

A program intended to generate an outline to a PARANOIA campaign.

fork
loading
Files
  • main.cs
  • main.exe
  • program.exe
  • shell_helper.cs
main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
using System;
using System.Text.RegularExpressions;
using System.Text;

class MainClass {
  public static void Setup()
  {
    Console.WriteLine("rm -rf program.exe".Bash());
    
    Console.WriteLine("git clone https://github.com/tra38/PARANOIA_Campaign_Generator".Bash());

    Console.WriteLine("mcs -out:program.exe PARANOIA_Campaign_Generator/*.cs PARANOIA_Campaign_Generator/lib/*.cs".Bash());

    Console.WriteLine("rm -rf PARANOIA_Campaign_Generator/".Bash());
  }

  //https://stackoverflow.com/questions/5510343/escape-command-line-arguments-in-c-sharp
  public static string EscapeInput(string input)
  {
    return Regex.Replace(input, @"(\\*)" + "\"", @"$1$1\" + "\"");
  }

  public static void UrlGenerator(string input)
  {
    var inputWithNewLines = Regex.Replace(input, "\n", "<br>");

    //var escapedInput =  "\"" + Regex.Replace(input, @"(\\+)$", @"$1$1") + "\"";

    var escapedInput = EscapeInput(inputWithNewLines);

    var output = $"echo -n \"{escapedInput}\" | lzma -9 | base64 -w0 | printf \"https://itty.bitty.site/#/%s\n\" \"$(cat -)\"".Bash();

    Console.WriteLine(output);
  }

  public static void Main (string[] args) {
    Setup();

    while (true)
    {
      var generated_mission = "mono program.exe".Bash();

      Console.WriteLine(generated_mission);

      Console.WriteLine("The campaign intro is also avaliable online for you to view, edit, and share. The URL is below:");

      UrlGenerator(generated_mission);

      Console.WriteLine("Press enter to generate a new campaign intro.");

      Console.ReadLine();
    }
  }
}