diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs index d11f6f6..700df7e 100644 --- a/ShiftOS.WinForms/Applications/ShiftLetters.cs +++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs @@ -50,7 +50,7 @@ namespace ShiftOS.WinForms.Applications "shiftorium", "codepoints", "shiftletters", "shops", "mud", "notification", "namechanger", "skinning", "skinloader", "calculator", "fileskimmer", "lua", "shiftnet", "terminal", "textpad"}; List contributorsWordlist = new List { "philipadams", "carverh", "computelinux", "lempamo", - "wowmom", "michaeltheshifter", "arencclc", "therandommelon", "pfg", "craftxbox", "ashifter"}; + "wowmom", "michaeltheshifter", "arencllc", "therandommelon", "pfg", "craftxbox", "ashifter"}; List osWordlist = new List { diff --git a/ShiftOS.WinForms/Controls/TerminalBox.cs b/ShiftOS.WinForms/Controls/TerminalBox.cs index 4fcb429..b75d077 100644 --- a/ShiftOS.WinForms/Controls/TerminalBox.cs +++ b/ShiftOS.WinForms/Controls/TerminalBox.cs @@ -61,5 +61,29 @@ namespace ShiftOS.WinForms.Controls { this.AppendText(Localization.Parse(text) + Environment.NewLine); } + + bool quickCopying = false; + + protected override void OnMouseDown(MouseEventArgs e) + { + //if right-clicking, then we initiate a quick-copy. + if (e.Button == MouseButtons.Right) + quickCopying = true; + + //Override the mouse event so that it's a left-click at all times. + base.OnMouseDown(new MouseEventArgs(MouseButtons.Left, e.Clicks, e.X, e.Y, e.Delta)); + } + + protected override void OnMouseUp(MouseEventArgs mevent) + { + if(quickCopying == true) + { + if (!string.IsNullOrWhiteSpace(this.SelectedText)) + { + this.Copy(); + } + } + base.OnMouseUp(mevent); + } } } diff --git a/ShiftOS.WinForms/HackerCommands.cs b/ShiftOS.WinForms/HackerCommands.cs index 7861981..f3f132e 100644 --- a/ShiftOS.WinForms/HackerCommands.cs +++ b/ShiftOS.WinForms/HackerCommands.cs @@ -360,7 +360,7 @@ namespace ShiftOS.WinForms { string usr = args["user"].ToString(); string sys = args["sys"].ToString(); - + bool received = false; ServerMessageReceived msgReceived = null; Console.WriteLine("--hooking system thread..."); @@ -373,30 +373,28 @@ namespace ShiftOS.WinForms var rnd = new Random(); var sw = new Stopwatch(); sw.Start(); - string pass = ""; - for(int i = 0; i < sve.Password.Length; i++) + Thread.Sleep(2000); + if(rnd.Next(0, 100) >= 75) { - char c = '\0'; - while (c != sve.Password[i]) - c = chars[rnd.Next(0, chars.Length)]; - pass += c; - Thread.Sleep(rnd.Next(25,75)); + Console.WriteLine("--operation took too long - failed."); + return; } sw.Stop(); - Console.WriteLine(pass); + Console.WriteLine(sve.Password); Console.WriteLine(); Console.WriteLine("--password breached. Operation took " + sw.ElapsedMilliseconds + " milliseconds."); + received = true; ServerManager.MessageReceived -= msgReceived; } else if(msg.Name == "user_data_not_found") { Console.WriteLine("--access denied."); + received = true; ServerManager.MessageReceived -= msgReceived; } }; Console.WriteLine("--beginning brute-force attack on " + usr + "@" + sys + "..."); - Thread.Sleep(500); ServerManager.MessageReceived += msgReceived; ServerManager.SendMessage("get_user_data", JsonConvert.SerializeObject(new @@ -404,6 +402,7 @@ namespace ShiftOS.WinForms user = usr, sysname = sys })); + Thread.Sleep(500); return true; } @@ -418,7 +417,7 @@ namespace ShiftOS.WinForms string usr = args["user"].ToString(); string sys = args["sys"].ToString(); string pass = args["pass"].ToString(); - + bool received = false; ServerMessageReceived msgReceived = null; Console.WriteLine("--hooking multi-user domain response call..."); @@ -441,18 +440,19 @@ namespace ShiftOS.WinForms { Console.WriteLine("--access denied."); } + received = true; ServerManager.MessageReceived -= msgReceived; } else if (msg.Name == "user_data_not_found") { Console.WriteLine("--access denied."); + received = true; ServerManager.MessageReceived -= msgReceived; } }; Console.WriteLine("--contacting multi-user domain..."); - Thread.Sleep(500); ServerManager.MessageReceived += msgReceived; ServerManager.SendMessage("get_user_data", JsonConvert.SerializeObject(new @@ -460,6 +460,7 @@ namespace ShiftOS.WinForms user = usr, sysname = sys })); + Thread.Sleep(500); return true; } @@ -476,7 +477,7 @@ namespace ShiftOS.WinForms string sys = args["sys"].ToString(); string pass = args["pass"].ToString(); long amount = (long)args["amount"]; - + bool received = false; if(amount < 0) { Console.WriteLine("--invalid codepoint amount - halting..."); @@ -509,12 +510,13 @@ namespace ShiftOS.WinForms { Console.WriteLine("--access denied."); } - + received = true; ServerManager.MessageReceived -= msgReceived; } else if (msg.Name == "user_data_not_found") { Console.WriteLine("--access denied."); + received = true; ServerManager.MessageReceived -= msgReceived; } }; @@ -528,6 +530,8 @@ namespace ShiftOS.WinForms user = usr, sysname = sys })); + Thread.Sleep(500); + return true; } diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs index 8900a69..d30adb4 100644 --- a/ShiftOS.WinForms/WinformsDesktop.cs +++ b/ShiftOS.WinForms/WinformsDesktop.cs @@ -63,8 +63,10 @@ namespace ShiftOS.WinForms NotificationDaemon.NotificationMade += (note) => { //Soon this will pop a balloon note. - btnnotifications.Text = "Notifications (" + NotificationDaemon.GetUnreadCount().ToString() + ")"; - + this.Invoke(new Action(() => + { + btnnotifications.Text = "Notifications (" + NotificationDaemon.GetUnreadCount().ToString() + ")"; + })); }; NotificationDaemon.NotificationRead += () =>