Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.CodeDom.Compiler;
- using System.ComponentModel;
- using System.Diagnostics;
- using System.Management;
- using System.Net;
- using System.Runtime.CompilerServices;
- using System.Security.Cryptography;
- using System.Text;
- using System.Threading;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Controls.Primitives;
- using System.Windows.Input;
- using System.Windows.Markup;
- using HelperMethods;
- using Newtonsoft.Json;
- using Seafko.Properties;
- namespace Seafko
- {
- // Token: 0x0200000D RID: 13
- public partial class ActivateProduct : Window, IComponentConnector
- {
- // Token: 0x06000064 RID: 100 RVA: 0x0000B218 File Offset: 0x00009418
- private void ActivateBtn_OnClick(object sender, RoutedEventArgs e)
- {
- if (!string.IsNullOrEmpty(this.ActivationKey.Text))
- {
- this.ActivateBtn.IsEnabled = false;
- this.LoadingGif.Visibility = Visibility.Visible;
- if (!statics.CheckForInternetConnection())
- {
- MessageBox.Show("No internet connection available.", "Key Manager", MessageBoxButton.OK, MessageBoxImage.Hand);
- return;
- }
- string ActivationKeyText = this.ActivationKey.Text;
- new Thread(delegate()
- {
- string getPKey = new LocalData().GetPKey;
- using (WebClient webClient = new WebClient())
- {
- string machineId = this.GetMachineId() + "|" + Guid.NewGuid().ToString();
- ActivateProduct.SignKey signKey = new ActivateProduct.SignKey();
- signKey.Key = ActivationKeyText;
- signKey.MachineId = machineId;
- signKey.IsComunityEdtioinInformations = 4;
- string str = Convert.ToBase64String(Encoding.UTF8.GetBytes(JsonConvert.SerializeObject(signKey)));
- string text = webClient.DownloadString("http://18.130.174.29/ActivtionServers/ActivationServer.php?KeyData=" + str);
- if (!string.IsNullOrEmpty(text) && text != "false")
- {
- try
- {
- string @string = Encoding.UTF8.GetString(Convert.FromBase64String(text));
- SignedKey signedKey = JsonConvert.DeserializeObject<SignedKey>(@string);
- if (!(signedKey.MachineId == signKey.MachineId))
- {
- MessageBox.Show("Invlaid key id", "Key Manager", MessageBoxButton.OK, MessageBoxImage.Hand);
- }
- else if (this.VerifyData(signKey.MachineId, signedKey.Signature, getPKey))
- {
- this.Dispatcher.Invoke(delegate()
- {
- MessageBox.Show("Thank you , now you are well armed , Happy Hunting.", "Saefko Attack Systems", MessageBoxButton.OK, MessageBoxImage.Asterisk);
- this.Hide();
- Settings.Default.LoveIsAllOver = true;
- Settings.Default.ActivationKeyText = signKey.Key;
- Settings.Default.Save();
- MainWindow mainWindow = new MainWindow();
- mainWindow.Show();
- if (this.CommunityEdition != null)
- {
- this.CommunityEdition.Close();
- }
- this.Close();
- });
- }
- else
- {
- MessageBox.Show("Invlaid key", "Key Manager", MessageBoxButton.OK, MessageBoxImage.Hand);
- }
- goto IL_1A5;
- }
- catch (Exception)
- {
- MessageBox.Show("Problem while validating key.", "Key Manager", MessageBoxButton.OK, MessageBoxImage.Hand);
- goto IL_1A5;
- }
- }
- MessageBox.Show("Invlaid key server rejected it.", "Key Manager", MessageBoxButton.OK, MessageBoxImage.Hand);
- IL_1A5:
- this.Dispatcher.Invoke(delegate()
- {
- this.LoadingGif.Visibility = Visibility.Collapsed;
- this.ActivateBtn.IsEnabled = true;
- });
- }
- }).Start();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement