From 65d20ae4aa3bee740797b7939977e24fd9076b77 Mon Sep 17 00:00:00 2001 From: Carver Harrison Date: Fri, 22 Jul 2016 20:07:46 -0700 Subject: SUPPORTS BASH `bash` --- source/WindowsFormsApplication1/Apps/Terminal.cs | 66 ++++++++-------------- .../WindowsFormsApplication1/Resources/Credits.txt | 3 +- 2 files changed, 27 insertions(+), 42 deletions(-) (limited to 'source/WindowsFormsApplication1') diff --git a/source/WindowsFormsApplication1/Apps/Terminal.cs b/source/WindowsFormsApplication1/Apps/Terminal.cs index 6d4880c..7c0c78b 100644 --- a/source/WindowsFormsApplication1/Apps/Terminal.cs +++ b/source/WindowsFormsApplication1/Apps/Terminal.cs @@ -1561,6 +1561,15 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o } } + public void cmd_bash(String[] args) + { + Process p = new Process(); + p.StartInfo.FileName = "powershell"; + p.StartInfo.Arguments = "C:\\ShiftOS\\bin\\bash.exe"; + p.StartInfo.WorkingDirectory = current_dir; + p.Start(); + } + public void cmd_default(String[] args) { if (API.OpenProgram(args[0]) == false) @@ -1615,48 +1624,13 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o } if (done == false) { - // This runs LUA and EXE Applications + // This runs EXE Applications like Core Utils // Created By Carver Harrison (@carverh) - if (File.Exists("C:\\ShiftOS\\LuaApps\\" + args[0] + ".lua")) - { - string lp = "C:\\ShiftOS\\LuaApps\\" + args[0] + ".lua"; - WriteLine(lp); - var l = new LuaInterpreter(lp); - } - else if (File.Exists("C:\\ShiftOS\\bin\\" + args[0] + ".exe")) - { - bool isFirstArg = true; - string exeArgs = ""; - foreach (string arg in args) - { - if (!isFirstArg) - { - exeArgs = exeArgs + " " + arg; - } - else - { - isFirstArg = false; - } - } - string lp = "C:\\ShiftOS\\bin\\" + args[0] + ".exe"; - Process p = new Process(); - p.StartInfo.Arguments = exeArgs; - p.StartInfo.UseShellExecute = false; - p.StartInfo.RedirectStandardOutput = true; - p.StartInfo.FileName = lp; - p.StartInfo.CreateNoWindow = true; - p.StartInfo.ErrorDialog = false; - p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; - p.StartInfo.WorkingDirectory = current_dir; - p.Start(); - - WriteLine(p.StandardOutput.ReadToEnd()); - p.WaitForExit(); - } - else - { - wrongcommand(); - } + wrongcommand(); + } + else + { + wrongcommand(); } } } @@ -1685,6 +1659,16 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o #endregion + #region RunEXE By Carver Harrison + /// + /// RunExe 1.1 + /// This will run .exe files inside of /bin + /// Created By Carver Harrison (@carverh) + /// + /// string[] args + + #endregion + private void StartChoice1EndStory() { var t = new System.Windows.Forms.Timer(); diff --git a/source/WindowsFormsApplication1/Resources/Credits.txt b/source/WindowsFormsApplication1/Resources/Credits.txt index 2bc1e2a..3a75728 100644 --- a/source/WindowsFormsApplication1/Resources/Credits.txt +++ b/source/WindowsFormsApplication1/Resources/Credits.txt @@ -3,9 +3,10 @@ ShiftOS #VER# == Developers == Michael VanOverbeek Philip Adams +Carver Harrison +William GabrielTK PCSource -Carver Harrison AShifter -- cgit v1.2.3 From 0a87d135d62576f1575a66f5f5707e2bbf8e2906 Mon Sep 17 00:00:00 2001 From: Carver Harrison Date: Fri, 22 Jul 2016 20:32:14 -0700 Subject: Removed Bash :( --- source/WindowsFormsApplication1/Apps/Terminal.cs | 59 ++++++++++++++++++------ 1 file changed, 44 insertions(+), 15 deletions(-) (limited to 'source/WindowsFormsApplication1') diff --git a/source/WindowsFormsApplication1/Apps/Terminal.cs b/source/WindowsFormsApplication1/Apps/Terminal.cs index 7c0c78b..5681487 100644 --- a/source/WindowsFormsApplication1/Apps/Terminal.cs +++ b/source/WindowsFormsApplication1/Apps/Terminal.cs @@ -1561,15 +1561,6 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o } } - public void cmd_bash(String[] args) - { - Process p = new Process(); - p.StartInfo.FileName = "powershell"; - p.StartInfo.Arguments = "C:\\ShiftOS\\bin\\bash.exe"; - p.StartInfo.WorkingDirectory = current_dir; - p.Start(); - } - public void cmd_default(String[] args) { if (API.OpenProgram(args[0]) == false) @@ -1626,11 +1617,14 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o { // This runs EXE Applications like Core Utils // Created By Carver Harrison (@carverh) - wrongcommand(); - } - else - { - wrongcommand(); + if (File.Exists("C:\\ShiftOS\\bin\\" + args[0] + ".exe")) + { + runExe(args); + } + else + { + wrongcommand(); + } } } } @@ -1666,7 +1660,42 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o /// Created By Carver Harrison (@carverh) /// /// string[] args - + public void runExe(string[] args) + { + bool isFirstArg = true; + string exeArgs = ""; + foreach (string arg in args) + { + if (!isFirstArg) + { + exeArgs = exeArgs + " " + arg; + } + else + { + isFirstArg = false; + } + } + string lp = "C:\\ShiftOS\\bin\\" + args[0] + ".exe"; + Process p = new Process(); + p.StartInfo.Arguments = exeArgs; + p.StartInfo.UseShellExecute = false; + p.StartInfo.RedirectStandardOutput = true; + p.StartInfo.RedirectStandardInput = true; + p.StartInfo.FileName = lp; + p.StartInfo.CreateNoWindow = true; + p.StartInfo.ErrorDialog = false; + p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; + p.StartInfo.WorkingDirectory = current_dir; + this.Invoke(new Action(() => + { + p.Start(); + StreamWriter sw = p.StandardInput; + while (!p.HasExited) + { + txtterm.Text += p.StandardOutput.Read(); + } + })); + } #endregion private void StartChoice1EndStory() -- cgit v1.2.3 From a948ceb36cdf3600d810b0c03253d69f448f51eb Mon Sep 17 00:00:00 2001 From: Carver Harrison Date: Fri, 22 Jul 2016 20:44:20 -0700 Subject: Fixed GNU/ShiftTerm Liek da naem --- source/WindowsFormsApplication1/Apps/Terminal.cs | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'source/WindowsFormsApplication1') diff --git a/source/WindowsFormsApplication1/Apps/Terminal.cs b/source/WindowsFormsApplication1/Apps/Terminal.cs index 5681487..4fb6899 100644 --- a/source/WindowsFormsApplication1/Apps/Terminal.cs +++ b/source/WindowsFormsApplication1/Apps/Terminal.cs @@ -1686,15 +1686,9 @@ HIJACKER is a utility that allows you to hijack any system and install ShiftOS o p.StartInfo.ErrorDialog = false; p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden; p.StartInfo.WorkingDirectory = current_dir; - this.Invoke(new Action(() => - { - p.Start(); - StreamWriter sw = p.StandardInput; - while (!p.HasExited) - { - txtterm.Text += p.StandardOutput.Read(); - } - })); + p.Start(); + WriteLine(p.StandardOutput.ReadToEnd()); + p.WaitForExit(); } #endregion -- cgit v1.2.3