Merge remote-tracking branch 'refs/remotes/shiftos-game/master'

This commit is contained in:
AShifter 2017-03-11 09:22:10 -07:00
commit d15965e442
4 changed files with 47 additions and 17 deletions

View file

@ -50,7 +50,7 @@ namespace ShiftOS.WinForms.Applications
"shiftorium", "codepoints", "shiftletters", "shops", "mud", "notification", "namechanger",
"skinning", "skinloader", "calculator", "fileskimmer", "lua", "shiftnet", "terminal", "textpad"};
List<String> contributorsWordlist = new List<string> { "philipadams", "carverh", "computelinux", "lempamo",
"wowmom", "michaeltheshifter", "arencclc", "therandommelon", "pfg", "craftxbox", "ashifter"};
"wowmom", "michaeltheshifter", "arencllc", "therandommelon", "pfg", "craftxbox", "ashifter"};
List<string> osWordlist = new List<string>
{

View file

@ -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);
}
}
}

View file

@ -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;
}

View file

@ -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 += () =>