public static bool ReceiveTransmission(Windows.MainWindow window, IntPtr remoteWindow, System.Diagnostics.Process remoteProcess, Windows.COPYDATASTRUCT cds) { Session session = Sessions.FirstOrDefault(q => q.RemoteWindow == remoteWindow && q.Process.Id == remoteProcess.Id); if (session == null) { session = new Session(remoteWindow, remoteProcess); Sessions.Add(session); } switch ((long)cds.dwData) { case 10: if (!App.Settings.HasPasswordMasterKey) { return(false); } session.ReceivePublicKeyTransmission(cds); session.TransmitPublicKey(window, false); session.TransmitEncryptedMasterKey(window); return(true); case 11: session.ReceiveEncryptedMasterKeyTransmission(cds); return(true); case 12: session.ReceivePublicKeyTransmission(cds); return(true); } return(false); }
private void ApplicationStart(object sender, StartupEventArgs e) { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; CommandLine = e.Args; if (!TransmitCommandLine()) { ReloadGameConfiguration(); if (GameConfiguration != null || System.IO.File.Exists(ISExecutable)) { HasInnerSpace = true; } var mainWindow = new Windows.MainWindow(); //Re-enable normal shutdown mode. Current.ShutdownMode = ShutdownMode.OnMainWindowClose; Current.MainWindow = mainWindow; mainWindow.Show(); ProcessCommandLine(CommandLine); } }
private void ApplicationStart(object sender, StartupEventArgs e) { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; // add in tls2 and tls3 as options as they are not included as the default, and are not the system default for some dumbass reason. TLS 1.3 is not a recognised enum in this version of .net, so use the hex code. ServicePointManager.SecurityProtocol |= (SecurityProtocolType.Tls12 | (SecurityProtocolType)0x00003000); // remove SSL3, TLS1.0 and TLS 1.1 as options ServicePointManager.SecurityProtocol &= ~(SecurityProtocolType.Ssl3 | SecurityProtocolType.Tls | SecurityProtocolType.Tls11); // Allow a 100 continuation ServicePointManager.Expect100Continue = true; CommandLine = e.Args; if (!TransmitCommandLine()) { ReloadGameConfiguration(); if (GameConfiguration != null || System.IO.File.Exists(ISExecutable)) { HasInnerSpace = true; } var mainWindow = new Windows.MainWindow(); //Re-enable normal shutdown mode. Current.ShutdownMode = ShutdownMode.OnMainWindowClose; Current.MainWindow = mainWindow; mainWindow.Show(); ProcessCommandLine(CommandLine); } }
private void ApplicationStart(object sender, StartupEventArgs e) { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; // Allows the operating system to choose the best protocol to use, and to block protocols that are not secure. Unless your app has a specific reason not to, you should use this value. ServicePointManager.SecurityProtocol = SecurityProtocolType.SystemDefault; CommandLine = e.Args; if (!TransmitCommandLine()) { ReloadGameConfiguration(); if (GameConfiguration != null || System.IO.File.Exists(ISExecutable)) { HasInnerSpace = true; } var mainWindow = new Windows.MainWindow(); //Re-enable normal shutdown mode. Current.ShutdownMode = ShutdownMode.OnMainWindowClose; Current.MainWindow = mainWindow; mainWindow.Show(); ProcessCommandLine(CommandLine); } }
public void TransmitEncryptedMasterKey(Windows.MainWindow localWindow) { Windows.COPYDATASTRUCT cds = GetEncryptedMasterKeyTransmission(); HwndSource source = PresentationSource.FromVisual(localWindow) as HwndSource; Windows.MainWindow.SendMessage(this.RemoteWindow, Windows.MainWindow.WM_COPYDATA, source.Handle, ref cds); Marshal.FreeHGlobal(cds.lpData); }
/// <summary> /// Request Master Key from Master Instance /// </summary> /// <param name="window"></param> /// <param name="remoteWindow"></param> /// <param name="remoteProcess"></param> public static void RequestMasterKey(Windows.MainWindow window, IntPtr remoteWindow, System.Diagnostics.Process remoteProcess) { Session session = Sessions.FirstOrDefault(q => q.RemoteWindow == remoteWindow && q.Process.Id == remoteProcess.Id); if (session == null) { session = new Session(remoteWindow, remoteProcess); Sessions.Add(session); } session.TransmitPublicKey(window, true); }
private void ApplicationStart(object sender, StartupEventArgs e) { AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; CommandLine = e.Args; if (!TransmitCommandLine()) { ReloadGameConfiguration(); var mainWindow = new Windows.MainWindow(); //Re-enable normal shutdown mode. Current.ShutdownMode = ShutdownMode.OnMainWindowClose; Current.MainWindow = mainWindow; mainWindow.Show(); ProcessCommandLine(CommandLine); } }