1110 lines
49 KiB
C#
1110 lines
49 KiB
C#
using System;
|
|||
|
|
using System.Collections.Generic;
|
||
|
|
using System.ComponentModel;
|
||
|
|
using System.Diagnostics;
|
||
|
|
using System.Drawing;
|
||
|
|
using System.IO;
|
||
|
|
using System.Linq;
|
||
|
|
using System.Reflection;
|
||
|
|
using System.Runtime.CompilerServices;
|
||
|
|
using System.Security.Cryptography;
|
||
|
|
using System.Text;
|
||
|
|
using System.Threading;
|
||
|
|
using System.Windows.Forms;
|
||
|
|
using DevexpressPatchKeygen.Properties;
|
||
|
|
using dnlib.DotNet;
|
||
|
|
using dnlib.DotNet.Emit;
|
||
|
|
using dnlib.DotNet.Writer;
|
||
|
|
using Microsoft.Win32;
|
||
|
|
|
||
|
|
namespace DevexpressPatchKeygen
|
||
|
|
{
|
||
|
|
public partial class SchemaAdapter : Form
|
||
|
|
{
|
||
|
|
public Func<string, IEnumerable<string>> Selector;
|
||
|
|
public Thread m_Authentication;
|
||
|
|
public int expression = 24;
|
||
|
|
public int repository = 1;
|
||
|
|
public string[] m_Task = new string[]
|
||
|
|
{
|
||
|
|
"2012 A.I.O.",
|
||
|
|
"2013 A.I.O.",
|
||
|
|
"2015 A.I.O.",
|
||
|
|
"2017 ENT.",
|
||
|
|
"2017 PRE.",
|
||
|
|
"2017 PRO.",
|
||
|
|
"2019 COM.",
|
||
|
|
"2019 ENT.",
|
||
|
|
"2019 PRE.",
|
||
|
|
"2019 PRO.",
|
||
|
|
"2022 COM.",
|
||
|
|
"2022 ENT.",
|
||
|
|
"2022 PRE.",
|
||
|
|
"2022 PRO."
|
||
|
|
};
|
||
|
|
public string _Parser = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location) + "\\";
|
||
|
|
public string m_Property = Path.GetPathRoot(Environment.SystemDirectory);
|
||
|
|
public string[] _Error;
|
||
|
|
public List<string> mapping = new List<string>();
|
||
|
|
public int m_Val;
|
||
|
|
public bool m_Process = true;
|
||
|
|
public string publisher = "<RSAKeyValue><Modulus>yNuZy4wH5P3B8z6JizxE8jCOcVi56/1pUEogqmBKb/oHzZoDknOZNS2Eezg90LjJPxht3wCzqWaL4EnpLa2KQmJYRUyxb3HawCFlmBmGIq0gUuYs98j9qsD2HgxgzWT5tV0A5w==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
|
||
|
|
public string instance = "<RSAKeyValue><Modulus>uWen+I3q039Djs70jBiFJqHuqn02tPY5RCvxTccDoV7iks+8RNVIFKLejgILEHao9wt03cD60duR0kKZu0TbUK1nVlMxlijZseWMJonrfdYj+Xt37jl4OSuz17XM/WtZFMWM9Q==</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>";
|
||
|
|
public string _Proxy = "<RSAKeyValue><Modulus>uWen+I3q039Djs70jBiFJqHuqn02tPY5RCvxTccDoV7iks+8RNVIFKLejgILEHao9wt03cD60duR0kKZu0TbUK1nVlMxlijZseWMJonrfdYj+Xt37jl4OSuz17XM/WtZFMWM9Q==</Modulus><Exponent>AQAB</Exponent><P>yX1YZkcaTah6AylJHfsc+H2rVLNlRmBfxnhL/oM8tq0oxHx7inLBK/74r52XEK1NiWc=</P><Q>65BS/JKjKZb2KJzemmibE1++BkoVYrgsUFmqZTIj9ywuJfFlSSv/oTL3//6A/SlXUUM=</Q><DP>Bq18zIb2vDQlNw2bOr8jyqh/kSMQ7DAtfGpoOlsnG/bJLxnhDkmXVVnx7AARDaBwvWk=</DP><DQ>vVRYfsxU+55r5qR+fdhJm769+kwc+CVS6JnIzGEKayVFShXE9JS6dxOCJGynu9I4bgU=</DQ><InverseQ>Y4cNBnsbzJ4q/ktV5SklAUadZLaVxTiaeMAJAR3hYazfj3nmt3iXspieD9KJzkQPr+Q=</InverseQ><D>N6hwemNQLXG0/DgQncX2ouRV24R/Wc/Y3Sg75ldqNZVgeyY1pIxKeTdzjDn8zFJy4sZgeL0iw+91lsHpFH5Mr8nwTdoU+/y+xipe2Kb5SipI7dlLSU5TC7Av0W/dJAx3OA1kuQ==</D></RSAKeyValue>";
|
||
|
|
public static Random _Visitor = new Random();
|
||
|
|
public IDisposable _Importer;
|
||
|
|
public GroupBox m_Container;
|
||
|
|
public Label order;
|
||
|
|
public ProgressBar @params;
|
||
|
|
public ComboBox m_Interceptor;
|
||
|
|
public Label _Request;
|
||
|
|
public Button m_Getter;
|
||
|
|
public TextBox exporter;
|
||
|
|
public Label _Candidate;
|
||
|
|
public Button m_Decorator;
|
||
|
|
public Label _Facade;
|
||
|
|
public NumericUpDown attribute;
|
||
|
|
public NumericUpDown initializer;
|
||
|
|
public LinkLabel _Tokenizer;
|
||
|
|
public Button _Descriptor;
|
||
|
|
public CheckBox listener;
|
||
|
|
public LinkLabel _Helper;
|
||
|
|
public CheckBox registry;
|
||
|
|
public CheckBox annotation;
|
||
|
|
|
||
|
|
// Constructor to initialize the authentication process
|
||
|
|
internal SchemaAdapter()
|
||
|
|
{
|
||
|
|
InitAuthentication();
|
||
|
|
}
|
||
|
|
|
||
|
|
// Initialize UI components (e.g., buttons, checkboxes, labels)
|
||
|
|
private void InitAuthentication()
|
||
|
|
{
|
||
|
|
this.m_Container = new GroupBox();
|
||
|
|
this.registry = new CheckBox();
|
||
|
|
this._Helper = new LinkLabel();
|
||
|
|
this.order = new Label();
|
||
|
|
this.@params = new ProgressBar();
|
||
|
|
this.m_Interceptor = new ComboBox();
|
||
|
|
this._Request = new Label();
|
||
|
|
this.m_Getter = new Button();
|
||
|
|
this.exporter = new TextBox();
|
||
|
|
this._Candidate = new Label();
|
||
|
|
this.m_Decorator = new Button();
|
||
|
|
this._Facade = new Label();
|
||
|
|
this.attribute = new NumericUpDown();
|
||
|
|
this.initializer = new NumericUpDown();
|
||
|
|
this._Tokenizer = new LinkLabel();
|
||
|
|
this._Descriptor = new Button();
|
||
|
|
this.listener = new CheckBox();
|
||
|
|
this.annotation = new CheckBox();
|
||
|
|
this.m_Container.SuspendLayout();
|
||
|
|
((ISupportInitialize)this.attribute).BeginInit();
|
||
|
|
((ISupportInitialize)this.initializer).BeginInit();
|
||
|
|
base.SuspendLayout();
|
||
|
|
this.m_Container.Controls.Add(this.registry);
|
||
|
|
this.m_Container.Controls.Add(this._Helper);
|
||
|
|
this.m_Container.Controls.Add(this.order);
|
||
|
|
this.m_Container.Controls.Add(this.@params);
|
||
|
|
this.m_Container.Controls.Add(this.m_Interceptor);
|
||
|
|
this.m_Container.Controls.Add(this._Request);
|
||
|
|
this.m_Container.Controls.Add(this.m_Getter);
|
||
|
|
this.m_Container.Controls.Add(this.exporter);
|
||
|
|
this.m_Container.Controls.Add(this._Candidate);
|
||
|
|
this.m_Container.Controls.Add(this.m_Decorator);
|
||
|
|
this.m_Container.Controls.Add(this._Facade);
|
||
|
|
this.m_Container.Controls.Add(this.attribute);
|
||
|
|
this.m_Container.Controls.Add(this.initializer);
|
||
|
|
this.m_Container.Controls.Add(this._Tokenizer);
|
||
|
|
this.m_Container.Controls.Add(this._Descriptor);
|
||
|
|
this.m_Container.Controls.Add(this.listener);
|
||
|
|
this.m_Container.Controls.Add(this.annotation);
|
||
|
|
this.m_Container.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold);
|
||
|
|
this.m_Container.ForeColor = Color.DarkMagenta;
|
||
|
|
this.m_Container.Location = new Point(6, 3);
|
||
|
|
this.m_Container.Name = "gDevExpress";
|
||
|
|
this.m_Container.Size = new Size(383, 135);
|
||
|
|
this.m_Container.TabIndex = 44;
|
||
|
|
this.m_Container.TabStop = false;
|
||
|
|
this.m_Container.Text = "Patch / Keygen...";
|
||
|
|
this.registry.AutoSize = true;
|
||
|
|
this.registry.Cursor = Cursors.Hand;
|
||
|
|
this.registry.ForeColor = Color.ForestGreen;
|
||
|
|
this.registry.Location = new Point(9, 47);
|
||
|
|
this.registry.Name = "cELK";
|
||
|
|
this.registry.Size = new Size(135, 17);
|
||
|
|
this.registry.TabIndex = 106;
|
||
|
|
this.registry.Text = "Export License Key";
|
||
|
|
this.registry.UseVisualStyleBackColor = true;
|
||
|
|
this._Helper.ActiveLinkColor = Color.Brown;
|
||
|
|
this._Helper.AutoSize = true;
|
||
|
|
this._Helper.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.Point, 0);
|
||
|
|
this._Helper.LinkColor = Color.Navy;
|
||
|
|
this._Helper.Location = new Point(9, 21);
|
||
|
|
this._Helper.Name = "linkDEV";
|
||
|
|
this._Helper.Size = new Size(86, 13);
|
||
|
|
this._Helper.TabIndex = 105;
|
||
|
|
this._Helper.TabStop = true;
|
||
|
|
this._Helper.Text = "D.E. Version :";
|
||
|
|
this._Helper.LinkClicked += this.CheckAuthentication;
|
||
|
|
this.order.AutoEllipsis = true;
|
||
|
|
this.order.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.Point, 0);
|
||
|
|
this.order.ForeColor = Color.Magenta;
|
||
|
|
this.order.Location = new Point(286, 93);
|
||
|
|
this.order.Name = "lpb";
|
||
|
|
this.order.Size = new Size(88, 13);
|
||
|
|
this.order.TabIndex = 104;
|
||
|
|
this.order.Text = "Calculation...";
|
||
|
|
this.order.TextAlign = ContentAlignment.MiddleCenter;
|
||
|
|
this.order.Visible = false;
|
||
|
|
this.@params.Location = new Point(286, 106);
|
||
|
|
this.@params.Name = "progressBar1";
|
||
|
|
this.@params.Size = new Size(88, 18);
|
||
|
|
this.@params.Style = ProgressBarStyle.Marquee;
|
||
|
|
this.@params.TabIndex = 103;
|
||
|
|
this.@params.Visible = false;
|
||
|
|
this.m_Interceptor.BackColor = SystemColors.Info;
|
||
|
|
this.m_Interceptor.DropDownHeight = 100;
|
||
|
|
this.m_Interceptor.ForeColor = Color.DarkRed;
|
||
|
|
this.m_Interceptor.FormattingEnabled = true;
|
||
|
|
this.m_Interceptor.IntegralHeight = false;
|
||
|
|
this.m_Interceptor.ItemHeight = 13;
|
||
|
|
this.m_Interceptor.Location = new Point(286, 17);
|
||
|
|
this.m_Interceptor.Name = "comboLicense";
|
||
|
|
this.m_Interceptor.Size = new Size(88, 21);
|
||
|
|
this.m_Interceptor.Sorted = true;
|
||
|
|
this.m_Interceptor.TabIndex = 101;
|
||
|
|
this.m_Interceptor.Text = "Select...";
|
||
|
|
this.m_Interceptor.KeyPress += this.FindAuthentication;
|
||
|
|
this._Request.AutoSize = true;
|
||
|
|
this._Request.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.Point, 0);
|
||
|
|
this._Request.ForeColor = Color.Navy;
|
||
|
|
this._Request.Location = new Point(213, 21);
|
||
|
|
this._Request.Name = "label6";
|
||
|
|
this._Request.Size = new Size(67, 13);
|
||
|
|
this._Request.TabIndex = 102;
|
||
|
|
this._Request.Text = "V.Studio : ";
|
||
|
|
this.m_Getter.ForeColor = Color.Firebrick;
|
||
|
|
this.m_Getter.Location = new Point(109, 69);
|
||
|
|
this.m_Getter.Name = "regLic";
|
||
|
|
this.m_Getter.Size = new Size(165, 23);
|
||
|
|
this.m_Getter.TabIndex = 100;
|
||
|
|
this.m_Getter.Text = "Regenerate License Only";
|
||
|
|
this.m_Getter.UseVisualStyleBackColor = true;
|
||
|
|
this.m_Getter.Click += this.CancelAuthentication;
|
||
|
|
this.exporter.BackColor = SystemColors.Info;
|
||
|
|
this.exporter.ForeColor = Color.DarkRed;
|
||
|
|
this.exporter.Location = new Point(146, 105);
|
||
|
|
this.exporter.MaxLength = 30;
|
||
|
|
this.exporter.Name = "tname";
|
||
|
|
this.exporter.Size = new Size(112, 20);
|
||
|
|
this.exporter.TabIndex = 99;
|
||
|
|
this.exporter.Text = "PulsarTeam";
|
||
|
|
this.exporter.TextAlign = HorizontalAlignment.Center;
|
||
|
|
this._Candidate.AutoSize = true;
|
||
|
|
this._Candidate.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.Point, 0);
|
||
|
|
this._Candidate.ForeColor = Color.Navy;
|
||
|
|
this._Candidate.Location = new Point(93, 109);
|
||
|
|
this._Candidate.Name = "label3";
|
||
|
|
this._Candidate.Size = new Size(47, 13);
|
||
|
|
this._Candidate.TabIndex = 98;
|
||
|
|
this._Candidate.Text = "Name :";
|
||
|
|
this.m_Decorator.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
|
||
|
|
this.m_Decorator.ForeColor = Color.DarkGoldenrod;
|
||
|
|
this.m_Decorator.Location = new Point(9, 69);
|
||
|
|
this.m_Decorator.Name = "Restore";
|
||
|
|
this.m_Decorator.Size = new Size(88, 23);
|
||
|
|
this.m_Decorator.TabIndex = 97;
|
||
|
|
this.m_Decorator.Text = "Restore";
|
||
|
|
this.m_Decorator.UseVisualStyleBackColor = true;
|
||
|
|
this.m_Decorator.Click += this.ValidateAuthentication;
|
||
|
|
this._Facade.AutoSize = true;
|
||
|
|
this._Facade.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold | FontStyle.Italic, GraphicsUnit.Point, 0);
|
||
|
|
this._Facade.ForeColor = Color.Navy;
|
||
|
|
this._Facade.Location = new Point(145, 21);
|
||
|
|
this._Facade.Name = "label2";
|
||
|
|
this._Facade.Size = new Size(11, 13);
|
||
|
|
this._Facade.TabIndex = 96;
|
||
|
|
this._Facade.Text = ".";
|
||
|
|
this.attribute.ForeColor = Color.DarkRed;
|
||
|
|
this.attribute.Location = new Point(98, 17);
|
||
|
|
NumericUpDown numericUpDown = this.attribute;
|
||
|
|
int[] array = new int[4];
|
||
|
|
array[0] = 99;
|
||
|
|
numericUpDown.Maximum = new decimal(array);
|
||
|
|
NumericUpDown numericUpDown2 = this.attribute;
|
||
|
|
int[] array2 = new int[4];
|
||
|
|
array2[0] = 19;
|
||
|
|
numericUpDown2.Minimum = new decimal(array2);
|
||
|
|
this.attribute.Name = "HV";
|
||
|
|
this.attribute.Size = new Size(41, 20);
|
||
|
|
this.attribute.TabIndex = 95;
|
||
|
|
this.attribute.TextAlign = HorizontalAlignment.Center;
|
||
|
|
NumericUpDown numericUpDown3 = this.attribute;
|
||
|
|
int[] array3 = new int[4];
|
||
|
|
array3[0] = 24;
|
||
|
|
numericUpDown3.Value = new decimal(array3);
|
||
|
|
this.attribute.ValueChanged += this.ConcatAuthentication;
|
||
|
|
this.initializer.ForeColor = Color.DarkRed;
|
||
|
|
this.initializer.Location = new Point(162, 17);
|
||
|
|
NumericUpDown numericUpDown4 = this.initializer;
|
||
|
|
int[] array4 = new int[4];
|
||
|
|
array4[0] = 9;
|
||
|
|
numericUpDown4.Maximum = new decimal(array4);
|
||
|
|
this.initializer.Name = "LV";
|
||
|
|
this.initializer.Size = new Size(41, 20);
|
||
|
|
this.initializer.TabIndex = 94;
|
||
|
|
this.initializer.TextAlign = HorizontalAlignment.Center;
|
||
|
|
NumericUpDown numericUpDown5 = this.initializer;
|
||
|
|
int[] array5 = new int[4];
|
||
|
|
array5[0] = 1;
|
||
|
|
numericUpDown5.Value = new decimal(array5);
|
||
|
|
this.initializer.ValueChanged += this.ExcludeAuthentication;
|
||
|
|
this._Tokenizer.AutoSize = true;
|
||
|
|
this._Tokenizer.Font = new Font("Microsoft Sans Serif", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
|
||
|
|
this._Tokenizer.ForeColor = Color.BlueViolet;
|
||
|
|
this._Tokenizer.LinkColor = Color.OrangeRed;
|
||
|
|
this._Tokenizer.Location = new Point(297, 109);
|
||
|
|
this._Tokenizer.Name = "linkdfox";
|
||
|
|
this._Tokenizer.Size = new Size(77, 13);
|
||
|
|
this._Tokenizer.TabIndex = 75;
|
||
|
|
this._Tokenizer.TabStop = true;
|
||
|
|
this._Tokenizer.Text = "By PulsarTeam";
|
||
|
|
this._Tokenizer.LinkClicked += this.CalcAuthentication;
|
||
|
|
this._Descriptor.ForeColor = Color.DarkBlue;
|
||
|
|
this._Descriptor.Location = new Point(286, 69);
|
||
|
|
this._Descriptor.Name = "Patch";
|
||
|
|
this._Descriptor.Size = new Size(88, 23);
|
||
|
|
this._Descriptor.TabIndex = 0;
|
||
|
|
this._Descriptor.Text = "Patch";
|
||
|
|
this._Descriptor.UseVisualStyleBackColor = true;
|
||
|
|
this._Descriptor.Click += this.VisitAuthentication;
|
||
|
|
this.listener.AutoSize = true;
|
||
|
|
this.listener.Checked = true;
|
||
|
|
this.listener.CheckState = CheckState.Checked;
|
||
|
|
this.listener.Cursor = Cursors.Hand;
|
||
|
|
this.listener.ForeColor = Color.Teal;
|
||
|
|
this.listener.Location = new Point(9, 107);
|
||
|
|
this.listener.Name = "controlloBackup";
|
||
|
|
this.listener.Size = new Size(69, 17);
|
||
|
|
this.listener.TabIndex = 21;
|
||
|
|
this.listener.Text = "Backup";
|
||
|
|
this.listener.UseVisualStyleBackColor = true;
|
||
|
|
this.annotation.AutoSize = true;
|
||
|
|
this.annotation.Checked = true;
|
||
|
|
this.annotation.CheckState = CheckState.Checked;
|
||
|
|
this.annotation.Cursor = Cursors.Hand;
|
||
|
|
this.annotation.ForeColor = Color.ForestGreen;
|
||
|
|
this.annotation.Location = new Point(196, 47);
|
||
|
|
this.annotation.Name = "cRORE";
|
||
|
|
this.annotation.Size = new Size(178, 17);
|
||
|
|
this.annotation.TabIndex = 107;
|
||
|
|
this.annotation.Text = "Remove Old Registry Entry";
|
||
|
|
this.annotation.UseVisualStyleBackColor = true;
|
||
|
|
base.AutoScaleDimensions = new SizeF(6f, 13f);
|
||
|
|
base.AutoScaleMode = AutoScaleMode.Font;
|
||
|
|
base.ClientSize = new Size(395, 142);
|
||
|
|
base.Controls.Add(this.m_Container);
|
||
|
|
base.MaximizeBox = false;
|
||
|
|
this.MaximumSize = new Size(411, 181);
|
||
|
|
this.MinimumSize = new Size(411, 181);
|
||
|
|
base.Name = "DEPK";
|
||
|
|
base.StartPosition = FormStartPosition.CenterScreen;
|
||
|
|
this.Text = "DevExpress - Patch/Keygen v{0}.{1}.{2}.{3}";
|
||
|
|
base.Load += this.QueryAuthentication;
|
||
|
|
base.MouseDoubleClick += this.InvokeAuthentication;
|
||
|
|
this.m_Container.ResumeLayout(false);
|
||
|
|
this.m_Container.PerformLayout();
|
||
|
|
((ISupportInitialize)this.attribute).EndInit();
|
||
|
|
((ISupportInitialize)this.initializer).EndInit();
|
||
|
|
base.ResumeLayout(false);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Method to query authentication status or details
|
||
|
|
private void QueryAuthentication(object sender, EventArgs e)
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
Version version = Assembly.GetExecutingAssembly().GetName().Version;
|
||
|
|
this.Text = string.Format("DevExpress - Patch/Keygen v{0}.{1}.{2}.{3}", new object[]
|
||
|
|
{
|
||
|
|
version.Major,
|
||
|
|
version.Minor,
|
||
|
|
version.Build,
|
||
|
|
version.Revision
|
||
|
|
});
|
||
|
|
for (int i = 0; i <= this.m_Task.Length - 1; i++)
|
||
|
|
{
|
||
|
|
this.m_Interceptor.Items.Add(this.m_Task[i]);
|
||
|
|
}
|
||
|
|
string text = this.SetAuthentication();
|
||
|
|
if (text != null && text != string.Empty)
|
||
|
|
{
|
||
|
|
this._Error = text.Split(new char[]
|
||
|
|
{
|
||
|
|
Path.AltDirectorySeparatorChar,
|
||
|
|
Path.DirectorySeparatorChar
|
||
|
|
});
|
||
|
|
}
|
||
|
|
this.m_Interceptor.SelectedIndex = ((this._Error == null || this._Error.Length < 8) ? this.m_Interceptor.FindStringExact("2022 ENT.") : this.m_Interceptor.FindStringExact(this._Error[3] + " " + this._Error[4].Substring(0, 3).ToUpper() + "."));
|
||
|
|
this.attribute.Value = Settings.Default.dvma;
|
||
|
|
this.initializer.Value = Settings.Default.dvmi;
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
MessageBox.Show("General Error...!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private string SortAuthentication()
|
||
|
|
{
|
||
|
|
return SchemaAdapter._Visitor.Next(1, int.MaxValue).ToString();
|
||
|
|
}
|
||
|
|
|
||
|
|
private string RemoveAuthentication(string string_0, int int_0 = 0)
|
||
|
|
{
|
||
|
|
return new string(Enumerable.Repeat<string>(string_0, (int_0 == 0) ? SchemaAdapter._Visitor.Next(1, 11) : int_0)
|
||
|
|
.Select(s => RegAdapter.Instance.CollectAuthentication(s))
|
||
|
|
.ToArray<char>());
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
// Method to set authentication details
|
||
|
|
private string SetAuthentication()
|
||
|
|
{
|
||
|
|
string result;
|
||
|
|
if (Environment.Is64BitOperatingSystem)
|
||
|
|
{
|
||
|
|
result = (string)Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\10.0\\", "InstallDir", null);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
result = (string)Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\10.0\\", "InstallDir", null);
|
||
|
|
}
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Method to cancel authentication process
|
||
|
|
private void CancelAuthentication(object sender, EventArgs e)
|
||
|
|
{
|
||
|
|
m_Process = true;
|
||
|
|
bool flag = DestroyAuthentication(true);
|
||
|
|
if (m_Process)
|
||
|
|
{
|
||
|
|
MessageBox.Show((!flag) ? "License Registration Error..." : "License Inserted...", "Info...", MessageBoxButtons.OK, flag ? MessageBoxIcon.Asterisk : MessageBoxIcon.Hand);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private void CalcAuthentication(object sender, LinkLabelLinkClickedEventArgs e)
|
||
|
|
{
|
||
|
|
Process.Start("https://www.dfox.it");
|
||
|
|
}
|
||
|
|
|
||
|
|
public void VisitAuthentication(object sender, EventArgs e)
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (this.m_Interceptor.SelectedIndex < 0)
|
||
|
|
{
|
||
|
|
MessageBox.Show("Select an Edition..!", "Info", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
this.m_Process = true;
|
||
|
|
this.CountAuthentication(false);
|
||
|
|
this.m_Authentication = new Thread(new ParameterizedThreadStart(this.PrepareAuthentication));
|
||
|
|
this.m_Authentication.Start(true);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch (ThreadAbortException)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private void PrepareAuthentication(object object_0)
|
||
|
|
{
|
||
|
|
Interpreter interpreter = new Interpreter();
|
||
|
|
interpreter.schemaAdapter = this;
|
||
|
|
interpreter.nofil = true;
|
||
|
|
while (Process.GetProcessesByName("devenv").Length != 0)
|
||
|
|
{
|
||
|
|
if (MessageBox.Show("Close Visual Studio (\"devenv\") Before Proceeding!. Continue?", "Info", MessageBoxButtons.YesNo) == DialogResult.No)
|
||
|
|
{
|
||
|
|
interpreter.nofil = true;
|
||
|
|
base.Invoke(new Collection(this.StartAuthentication), new object[2]);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
interpreter.nofil = false;
|
||
|
|
int.TryParse(this.attribute.Value.ToString(), out this.expression);
|
||
|
|
int.TryParse(this.initializer.Value.ToString(), out this.repository);
|
||
|
|
Version version = new Version(this.expression, this.repository);
|
||
|
|
string text = string.Format("{0}.{1}", version.Major, version.Minor);
|
||
|
|
if ((bool)object_0)
|
||
|
|
{
|
||
|
|
this.DestroyAuthentication(false);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
this.CallAuthentication();
|
||
|
|
}
|
||
|
|
interpreter.cvalue = string.Empty;
|
||
|
|
base.Invoke(new MethodInvoker(interpreter.InstantiateAuthentication));
|
||
|
|
string[] array = interpreter.cvalue.Split(new char[]
|
||
|
|
{
|
||
|
|
' '
|
||
|
|
});
|
||
|
|
interpreter.versione = array[0];
|
||
|
|
interpreter.edition = string.Empty;
|
||
|
|
string a = array[1];
|
||
|
|
if (!(a == "COM."))
|
||
|
|
{
|
||
|
|
if (!(a == "PRO."))
|
||
|
|
{
|
||
|
|
if (!(a == "PRE."))
|
||
|
|
{
|
||
|
|
if (!(a == "ENT."))
|
||
|
|
{
|
||
|
|
interpreter.edition = "";
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
interpreter.edition = "Enterprise";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
interpreter.edition = "Preview";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
interpreter.edition = "Professional";
|
||
|
|
}
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
interpreter.edition = "Community";
|
||
|
|
}
|
||
|
|
try
|
||
|
|
{
|
||
|
|
PrinterParserList printerParserList = new PrinterParserList();
|
||
|
|
printerParserList.locals1 = interpreter;
|
||
|
|
this.m_Val = 0;
|
||
|
|
this.mapping = new List<string>();
|
||
|
|
|
||
|
|
// Ensure that TestAuthentication() returns a string or modify the logic accordingly
|
||
|
|
string testAuth = !string.IsNullOrEmpty(this.TestAuthentication()) ? "some default value" : string.Empty;
|
||
|
|
string text2 = !string.IsNullOrEmpty(testAuth) ? testAuth.Replace("Components\\", "") : string.Format(this.m_Property + "Program Files{0}\\DevExpress {1}\\",
|
||
|
|
(!this.DefineAuthentication()) ? " (x86)" : "", text);
|
||
|
|
|
||
|
|
if (!Directory.Exists(text2))
|
||
|
|
{
|
||
|
|
text2 = !string.IsNullOrEmpty(testAuth) ? testAuth.Replace("Components\\", "") : string.Format(this.m_Property + "Program Files{0}\\DevExpress {1}\\",
|
||
|
|
this.DefineAuthentication() ? " (x86)" : "", text);
|
||
|
|
}
|
||
|
|
|
||
|
|
if (!Directory.Exists(text2) && MessageBox.Show("Installation of DevExpress \"" + text + "\" not found...\nContinue?", "Info", MessageBoxButtons.YesNo) == DialogResult.No)
|
||
|
|
{
|
||
|
|
printerParserList.locals1.nofil = true;
|
||
|
|
base.Invoke(new Collection(this.StartAuthentication), new object[2]);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
printerParserList.dVE = string.Empty;
|
||
|
|
if (this._Error != null && this._Error.Length >= 8 && this._Error[3] == printerParserList.locals1.versione && this._Error[4].ToLower() == printerParserList.locals1.edition.ToLower())
|
||
|
|
{
|
||
|
|
printerParserList.dVE = string.Join("\\", this._Error) + "Extensions\\";
|
||
|
|
}
|
||
|
|
|
||
|
|
else
|
||
|
|
{
|
||
|
|
printerParserList.dVE = string.Format(this.m_Property + "Program Files{0}\\Microsoft Visual Studio\\{1}\\{2}\\Common7\\IDE\\Extensions\\", (!this.DefineAuthentication() || !(printerParserList.locals1.versione != "2022")) ? "" : " (x86)", printerParserList.locals1.versione, printerParserList.locals1.edition);
|
||
|
|
}
|
||
|
|
if (!Directory.Exists(printerParserList.dVE))
|
||
|
|
{
|
||
|
|
base.Invoke(new MethodInvoker(printerParserList.AssetAuthentication));
|
||
|
|
}
|
||
|
|
string text3 = this.m_Property + "Windows\\Microsoft.NET\\assembly\\GAC_MSIL\\";
|
||
|
|
string text4 = this.m_Property + "Windows\\assembly\\";
|
||
|
|
string text5 = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + "\\Microsoft\\VisualStudio\\";
|
||
|
|
string text6 = Environment.GetEnvironmentVariable("USERPROFILE") + "\\.nuget\\packages\\devexpress.data\\";
|
||
|
|
this.ConnectAuthentication(new string[]
|
||
|
|
{
|
||
|
|
text2,
|
||
|
|
printerParserList.dVE,
|
||
|
|
text3,
|
||
|
|
text5,
|
||
|
|
text6,
|
||
|
|
text4
|
||
|
|
}, (bool)object_0);
|
||
|
|
printerParserList.nfl = this.mapping.Count;
|
||
|
|
if (printerParserList.nfl <= 0)
|
||
|
|
{
|
||
|
|
printerParserList.locals1.nofil = true;
|
||
|
|
MessageBox.Show("\"DevExpress file to patch not found...", "Error...", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||
|
|
base.Invoke(new Collection(this.StartAuthentication), new object[2]);
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
base.Invoke(new MethodInvoker(printerParserList.locals1.CustomizeAuthentication));
|
||
|
|
ServiceRepositoryService serviceRepositoryService = new ServiceRepositoryService();
|
||
|
|
serviceRepositoryService.locals2 = printerParserList;
|
||
|
|
serviceRepositoryService.i = 0;
|
||
|
|
while (serviceRepositoryService.i < serviceRepositoryService.locals2.nfl)
|
||
|
|
{
|
||
|
|
base.Invoke(new MethodInvoker(serviceRepositoryService.ListAuthentication));
|
||
|
|
if (File.Exists(this.mapping[serviceRepositoryService.i]))
|
||
|
|
{
|
||
|
|
this.LoginAuthentication(this.mapping[serviceRepositoryService.i], (bool)object_0);
|
||
|
|
}
|
||
|
|
int i = serviceRepositoryService.i;
|
||
|
|
serviceRepositoryService.i = i + 1;
|
||
|
|
}
|
||
|
|
base.Invoke(new MethodInvoker(printerParserList.locals1.PostAuthentication));
|
||
|
|
MessageBox.Show(this.m_Val.ToString() + ") File" + ((this.m_Val > 1) ? "s" : "") + " Patched...\nEnjoy \"PulsaTeam\"", "Info...", MessageBoxButtons.OK, MessageBoxIcon.Asterisk);
|
||
|
|
}
|
||
|
|
catch (IOException)
|
||
|
|
{
|
||
|
|
MessageBox.Show("Error on IO File...", "Error...", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||
|
|
}
|
||
|
|
catch (UnauthorizedAccessException)
|
||
|
|
{
|
||
|
|
MessageBox.Show("Error on Unauthorized Access File...", "Error...", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
if (!interpreter.nofil)
|
||
|
|
{
|
||
|
|
MessageBox.Show("Unknow Error on Access File...", "Error...", MessageBoxButtons.OK, MessageBoxIcon.Hand);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
base.Invoke(new Collection(this.StartAuthentication), new object[2]);
|
||
|
|
}
|
||
|
|
|
||
|
|
private void ConnectAuthentication(string[] string_0, bool bool_0)
|
||
|
|
{
|
||
|
|
RepositoryParserWorker repositoryParserWorker = new RepositoryParserWorker();
|
||
|
|
repositoryParserWorker.dr = string_0;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
repositoryParserWorker.d = 0;
|
||
|
|
while (repositoryParserWorker.d < repositoryParserWorker.dr.Length)
|
||
|
|
{
|
||
|
|
string[] array;
|
||
|
|
if (repositoryParserWorker.d < 5)
|
||
|
|
{
|
||
|
|
array = new string[]
|
||
|
|
{
|
||
|
|
"DevExpress.About.exe",
|
||
|
|
"DevExpress.Data.v*.dll",
|
||
|
|
"DevExpress.Xpf.Core.v*.DesignTools.dll",
|
||
|
|
"DevExpress.DemosUpdater.dll",
|
||
|
|
"DevExpress.ProjectUpgrade.Package*.dll",
|
||
|
|
"CodedUIExtension.Registrar.dll",
|
||
|
|
"DevExpressSharepoint*.wsp",
|
||
|
|
"DevExpress.DeploymentTool.UI.Async*.dll",
|
||
|
|
"DevExpress.Data.Portions.dll",
|
||
|
|
"DevExpress.CodeRush.Platform.dll",
|
||
|
|
"DevExpress.Generator.dll"
|
||
|
|
};
|
||
|
|
}
|
||
|
|
else if (bool_0)
|
||
|
|
{
|
||
|
|
array = new string[]
|
||
|
|
{
|
||
|
|
"DevExpress.Data.v*.ni.dll",
|
||
|
|
"DevExpress.Xpf.Core.v*.DesignTools.ni.dll",
|
||
|
|
"DevExpress.DemosUpdater.ni.dll",
|
||
|
|
"DevExpress.ProjectUpgrade.Package*.ni.dll",
|
||
|
|
"CodedUIExtension.Registrar.ni.dll",
|
||
|
|
"DevExpress.DeploymentTool.UI.Async*.ni.dll",
|
||
|
|
"DevExpress.Data.Portions.ni.dll",
|
||
|
|
"DevExpress.CodeRush.Platform.ni.dll",
|
||
|
|
"DevExpress.Generator.ni.dll"
|
||
|
|
};
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
array = new string[]
|
||
|
|
{
|
||
|
|
"DevExpress.Data.v*.ni.dll.DFX",
|
||
|
|
"DevExpress.Xpf.Core.v*.DesignTools.ni.dll.DFX",
|
||
|
|
"DevExpress.DemosUpdater.ni.dll.DFX",
|
||
|
|
"DevExpress.ProjectUpgrade.Package*.ni.dll.DFX",
|
||
|
|
"CodedUIExtension.Registrar.ni.dll.DFX",
|
||
|
|
"DevExpress.DeploymentTool.UI.Async*.ni.dll.DFX",
|
||
|
|
"DevExpress.Data.Portions.ni.dll.DFX",
|
||
|
|
"DevExpress.CodeRush.Platform.ni.dll.DFX",
|
||
|
|
"DevExpress.Generator.ni.dll.DFX"
|
||
|
|
};
|
||
|
|
}
|
||
|
|
try
|
||
|
|
{
|
||
|
|
IEnumerable<string> source = array;
|
||
|
|
Func<string, IEnumerable<string>> selector;
|
||
|
|
if ((selector = repositoryParserWorker.Selector) == null)
|
||
|
|
{
|
||
|
|
selector = (repositoryParserWorker.Selector = new Func<string, IEnumerable<string>>(repositoryParserWorker.WriteAuthentication));
|
||
|
|
}
|
||
|
|
string[] array2 = source.SelectMany(selector).ToArray<string>();
|
||
|
|
for (int i = 0; i < array2.Length; i++)
|
||
|
|
{
|
||
|
|
if (!array2[i].Trim().EndsWith(".resources.dll"))
|
||
|
|
{
|
||
|
|
this.mapping.Add(array2[i].Trim());
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
}
|
||
|
|
int d = repositoryParserWorker.d;
|
||
|
|
repositoryParserWorker.d = d + 1;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private bool DefineAuthentication()
|
||
|
|
{
|
||
|
|
return Environment.Is64BitOperatingSystem;
|
||
|
|
}
|
||
|
|
|
||
|
|
private bool CallAuthentication()
|
||
|
|
{
|
||
|
|
Guid guid = default(Guid);
|
||
|
|
int.TryParse(this.attribute.Value.ToString(), out this.expression);
|
||
|
|
int.TryParse(this.initializer.Value.ToString(), out this.repository);
|
||
|
|
Version version = new Version(this.expression, this.repository);
|
||
|
|
string name = string.Format("{0}{1}", version.Major, version.Minor);
|
||
|
|
bool result;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
guid = new Guid(58230061U, 54679, 18994, 182, 217, 104, 10, 22, 163, 205, 166);
|
||
|
|
RegistryKey classesRoot = Registry.ClassesRoot;
|
||
|
|
string str = "Licenses\\";
|
||
|
|
Guid guid2 = guid;
|
||
|
|
RegistryKey registryKey = classesRoot.CreateSubKey(str + guid2.ToString());
|
||
|
|
if (!this.annotation.Checked)
|
||
|
|
{
|
||
|
|
registryKey.DeleteValue(name);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
foreach (string name2 in registryKey.GetValueNames())
|
||
|
|
{
|
||
|
|
registryKey.DeleteValue(name2);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
guid = new Guid(1863287401, 5398, 17606, 189, 48, 14, 144, 190, 39, 135, 28);
|
||
|
|
RegistryKey classesRoot2 = Registry.ClassesRoot;
|
||
|
|
string str2 = "Licenses\\";
|
||
|
|
guid2 = guid;
|
||
|
|
registryKey = classesRoot2.CreateSubKey(str2 + guid2.ToString());
|
||
|
|
if (!this.annotation.Checked)
|
||
|
|
{
|
||
|
|
registryKey.DeleteValue(name);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
foreach (string name3 in registryKey.GetValueNames())
|
||
|
|
{
|
||
|
|
registryKey.DeleteValue(name3);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
return true;
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
result = false;
|
||
|
|
}
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
private void FindAuthentication(object sender, KeyPressEventArgs e)
|
||
|
|
{
|
||
|
|
e.Handled = true;
|
||
|
|
}
|
||
|
|
private void CheckAuthentication(object sender, LinkLabelLinkClickedEventArgs e)
|
||
|
|
{
|
||
|
|
this.PopAuthentication();
|
||
|
|
}
|
||
|
|
|
||
|
|
private void LoginAuthentication(string string_0, bool bool_0)
|
||
|
|
{
|
||
|
|
bool flag;
|
||
|
|
if ((flag = string_0.EndsWith("DevExpress.Generator.dll")) && this.FillAuthentication(string_0))
|
||
|
|
{
|
||
|
|
this.m_Val++;
|
||
|
|
}
|
||
|
|
if (string_0.EndsWith("DevExpress.Generator.dll.DFX"))
|
||
|
|
{
|
||
|
|
this.m_Val++;
|
||
|
|
if (File.Exists(string_0.Replace(".DFX", "")))
|
||
|
|
{
|
||
|
|
File.Delete(string_0.Replace(".DFX", ""));
|
||
|
|
}
|
||
|
|
File.Copy(string_0, string_0.Replace(".DFX", ""));
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if (string_0.EndsWith(".ni.dll"))
|
||
|
|
{
|
||
|
|
this.m_Val++;
|
||
|
|
if (File.Exists(string_0 + ".DFX"))
|
||
|
|
{
|
||
|
|
File.Delete(string_0 + ".DFX");
|
||
|
|
}
|
||
|
|
File.Move(string_0, string_0 + ".DFX");
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
if (string_0.EndsWith(".ni.dll.DFX"))
|
||
|
|
{
|
||
|
|
if (!File.Exists(string_0.Replace(".DFX", "")))
|
||
|
|
{
|
||
|
|
this.m_Val++;
|
||
|
|
File.Copy(string_0, string_0.Replace(".DFX", ""));
|
||
|
|
}
|
||
|
|
return;
|
||
|
|
}
|
||
|
|
byte[] bytes = Encoding.Unicode.GetBytes(bool_0 ? this.publisher : this.instance);
|
||
|
|
byte[] bytes2 = Encoding.Unicode.GetBytes(bool_0 ? this.instance : this.publisher);
|
||
|
|
byte[] array = File.ReadAllBytes(string_0);
|
||
|
|
IList<int> list = array.ComputeAuthentication(bytes);
|
||
|
|
if (list.Count <= 0)
|
||
|
|
{
|
||
|
|
bytes2 = Encoding.UTF8.GetBytes(bool_0 ? this.instance : this.publisher);
|
||
|
|
list = array.ComputeAuthentication(Encoding.UTF8.GetBytes(bool_0 ? this.publisher : this.instance));
|
||
|
|
}
|
||
|
|
int num = 0;
|
||
|
|
for (int i = 0; i < list.Count; i++)
|
||
|
|
{
|
||
|
|
if (num == 0 && !flag)
|
||
|
|
{
|
||
|
|
this.m_Val++;
|
||
|
|
}
|
||
|
|
num++;
|
||
|
|
for (int j = 0; j < bytes2.Length; j++)
|
||
|
|
{
|
||
|
|
array[list[i] + j] = bytes2[j];
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (num > 0)
|
||
|
|
{
|
||
|
|
if (bool_0 && this.listener.Checked && !flag)
|
||
|
|
{
|
||
|
|
this.ReadAuthentication(string_0);
|
||
|
|
}
|
||
|
|
File.WriteAllBytes(string_0, array);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
//lol?
|
||
|
|
private bool FillAuthentication(string string_0)
|
||
|
|
{
|
||
|
|
bool result;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
int num = 0;
|
||
|
|
ModuleDefMD moduleDefMD = ModuleDefMD.Load(File.ReadAllBytes(string_0), new ModuleContext());
|
||
|
|
foreach (TypeDef typeDef in moduleDefMD.GetTypes())
|
||
|
|
{
|
||
|
|
if (typeDef.FullName == "DevExpress.Generator")
|
||
|
|
{
|
||
|
|
MethodDef methodDef = typeDef.FindMethod("Execute");
|
||
|
|
int num2 = methodDef.Body.Instructions.Count<Instruction>();
|
||
|
|
if (methodDef != null && num2 >= 1 && methodDef.Body.Instructions[0].OpCode.ToString().Trim() != "ret")
|
||
|
|
{
|
||
|
|
methodDef.Body.Instructions.Insert(0, OpCodes.Ret.ToInstruction());
|
||
|
|
num++;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (num > 0)
|
||
|
|
{
|
||
|
|
if (this.listener.Checked)
|
||
|
|
{
|
||
|
|
this.ReadAuthentication(string_0);
|
||
|
|
}
|
||
|
|
if (moduleDefMD.IsILOnly)
|
||
|
|
{
|
||
|
|
ModuleWriterOptions moduleWriterOptions = new ModuleWriterOptions(moduleDefMD);
|
||
|
|
MetadataOptions metadataOptions = moduleWriterOptions.MetadataOptions;
|
||
|
|
|
||
|
|
// Use the appropriate type for bitwise operations
|
||
|
|
metadataOptions.Flags = (metadataOptions.Flags | (MetadataFlags)32767 | (MetadataFlags)32768);
|
||
|
|
|
||
|
|
// Make sure to use the correct Load overload
|
||
|
|
moduleDefMD.Write(string_0, moduleWriterOptions);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
NativeModuleWriterOptions nativeModuleWriterOptions = new NativeModuleWriterOptions(moduleDefMD, false);
|
||
|
|
|
||
|
|
// Use the appropriate type for bitwise operations
|
||
|
|
nativeModuleWriterOptions.MetadataOptions.Flags |= (MetadataFlags)32768;
|
||
|
|
|
||
|
|
// Make sure to use the correct Load overload
|
||
|
|
moduleDefMD.NativeWrite(string_0, nativeModuleWriterOptions);
|
||
|
|
}
|
||
|
|
result = true;
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
result = false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
result = false;
|
||
|
|
}
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
private void ReadAuthentication(string string_0)
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (File.Exists(string_0 + ".DFX"))
|
||
|
|
{
|
||
|
|
File.Delete(string_0 + ".DFX");
|
||
|
|
}
|
||
|
|
File.Copy(string_0, string_0 + ".DFX");
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
public void StartAuthentication(object sender, EventArgs e)
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.CountAuthentication(true);
|
||
|
|
if (this.m_Authentication != null && this.m_Authentication.IsAlive)
|
||
|
|
{
|
||
|
|
this.m_Authentication.Abort();
|
||
|
|
this.m_Authentication = null;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private void ConcatAuthentication(object sender, EventArgs e)
|
||
|
|
{
|
||
|
|
Settings.Default.dvma = this.attribute.Value;
|
||
|
|
Settings.Default.Save();
|
||
|
|
}
|
||
|
|
private void ExcludeAuthentication(object sender, EventArgs e)
|
||
|
|
{
|
||
|
|
Settings.Default.dvmi = this.initializer.Value;
|
||
|
|
Settings.Default.Save();
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
private void CountAuthentication(bool bool_0)
|
||
|
|
{
|
||
|
|
ExpressionParserWorker expressionParserWorker = new ExpressionParserWorker();
|
||
|
|
expressionParserWorker.schemaAdapter = this;
|
||
|
|
expressionParserWorker.of = bool_0;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
base.Invoke(new MethodInvoker(expressionParserWorker.DisableAuthentication));
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Test if authentication is successful
|
||
|
|
private string TestAuthentication()
|
||
|
|
{
|
||
|
|
string result;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
int.TryParse(this.attribute.Value.ToString(), out this.expression);
|
||
|
|
int.TryParse(this.initializer.Value.ToString(), out this.repository);
|
||
|
|
Version version = new Version(this.expression, this.repository);
|
||
|
|
string str = string.Format("{0}.{1}", version.Major, version.Minor);
|
||
|
|
RegistryKey registryKey = Registry.LocalMachine.OpenSubKey("SOFTWARE\\\\WOW6432Node\\\\DevExpress\\\\Components\\v" + str);
|
||
|
|
if (registryKey != null)
|
||
|
|
{
|
||
|
|
string text = registryKey.GetValue("RootDirectory").ToString();
|
||
|
|
registryKey.Close();
|
||
|
|
result = (Directory.Exists(text) ? text : string.Empty);
|
||
|
|
}
|
||
|
|
else
|
||
|
|
{
|
||
|
|
result = string.Empty;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
result = string.Empty;
|
||
|
|
}
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
private void InvokeAuthentication(object sender, MouseEventArgs e)
|
||
|
|
{
|
||
|
|
this.PopAuthentication();
|
||
|
|
}
|
||
|
|
|
||
|
|
private void PopAuthentication()
|
||
|
|
{
|
||
|
|
if (MessageBox.Show("Reset Settings to Default Values?\nThe application will be Restarted...", "Confirmation!", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)
|
||
|
|
{
|
||
|
|
this.FlushAuthentication();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private void FlushAuthentication()
|
||
|
|
{
|
||
|
|
Settings.Default.Reset();
|
||
|
|
try
|
||
|
|
{
|
||
|
|
Process.Start(Application.ExecutablePath);
|
||
|
|
Process.GetCurrentProcess().Kill();
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
Process.GetCurrentProcess().Kill();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
private bool CloneAuthentication(string string_0, bool bool_0, string string_1)
|
||
|
|
{
|
||
|
|
if (bool_0 && this.TestAuthentication() == string.Empty && MessageBox.Show("Installation of DevExpress not found...\nContinue?", "Info", MessageBoxButtons.YesNo) == DialogResult.No)
|
||
|
|
{
|
||
|
|
this.m_Process = false;
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
bool result;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
int.TryParse(this.attribute.Value.ToString(), out this.expression);
|
||
|
|
int.TryParse(this.initializer.Value.ToString(), out this.repository);
|
||
|
|
Version version = new Version(this.expression, this.repository);
|
||
|
|
string text = string.Format("{0}{1}", version.Major, version.Minor);
|
||
|
|
string s = string.Format("{0},{1},{1},{2},{3},{4},{5}", new object[]
|
||
|
|
{
|
||
|
|
text,
|
||
|
|
long.MaxValue,
|
||
|
|
string_0,
|
||
|
|
this.SortAuthentication(),
|
||
|
|
this.RemoveAuthentication("123456789", 1),
|
||
|
|
this.RemoveAuthentication("123456789", 0)
|
||
|
|
});
|
||
|
|
byte[] bytes = Encoding.UTF8.GetBytes(s);
|
||
|
|
byte[] array = new byte[20 + bytes.Length];
|
||
|
|
Buffer.BlockCopy(bytes, 0, array, 20, bytes.Length);
|
||
|
|
RSACryptoServiceProvider rsacryptoServiceProvider = new RSACryptoServiceProvider();
|
||
|
|
rsacryptoServiceProvider.FromXmlString(this._Proxy);
|
||
|
|
string text2 = Convert.ToBase64String(rsacryptoServiceProvider.SignData(array, CryptoConfig.MapNameToOID("SHA1"))) + Convert.ToBase64String(array);
|
||
|
|
Guid guid = new Guid(58230061U, 54679, 18994, 182, 217, 104, 10, 22, 163, 205, 166);
|
||
|
|
Guid guid2 = new Guid(1863287401, 5398, 17606, 189, 48, 14, 144, 190, 39, 135, 28);
|
||
|
|
Guid guid4;
|
||
|
|
if (this.annotation.Checked)
|
||
|
|
{
|
||
|
|
for (int i = 0; i < 2; i++)
|
||
|
|
{
|
||
|
|
Guid guid3 = (i == 0) ? guid : guid2;
|
||
|
|
string str = "Licenses\\";
|
||
|
|
guid4 = guid3;
|
||
|
|
string name = str + guid4.ToString();
|
||
|
|
RegistryKey registryKey = RegistryKey.OpenBaseKey(RegistryHive.ClassesRoot, RegistryView.Registry64).OpenSubKey(name, true);
|
||
|
|
if (registryKey != null)
|
||
|
|
{
|
||
|
|
foreach (string name2 in registryKey.GetValueNames())
|
||
|
|
{
|
||
|
|
registryKey.DeleteValue(name2);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
if (this.registry.Checked)
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
File.WriteAllText(string_1, text2);
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
}
|
||
|
|
}
|
||
|
|
RegistryKey classesRoot = Registry.ClassesRoot;
|
||
|
|
string str2 = "Licenses\\";
|
||
|
|
guid4 = guid;
|
||
|
|
classesRoot.CreateSubKey(str2 + guid4.ToString()).SetValue(text, text2, RegistryValueKind.String);
|
||
|
|
RegistryKey classesRoot2 = Registry.ClassesRoot;
|
||
|
|
string str3 = "Licenses\\";
|
||
|
|
guid4 = guid2;
|
||
|
|
RegistryKey registryKey2 = classesRoot2.CreateSubKey(str3 + guid4.ToString());
|
||
|
|
registryKey2.SetValue(text, 1309, RegistryValueKind.DWord);
|
||
|
|
registryKey2.Close();
|
||
|
|
result = true;
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
result = false;
|
||
|
|
}
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Destroy or clean up authentication data
|
||
|
|
private bool DestroyAuthentication(bool bool_0)
|
||
|
|
{
|
||
|
|
PolicyRepositoryService policyRepositoryService = new PolicyRepositoryService();
|
||
|
|
policyRepositoryService.schemaAdapter = this;
|
||
|
|
bool result;
|
||
|
|
try
|
||
|
|
{
|
||
|
|
if (this.exporter.Text.Trim() == "" || this.exporter.Text.Trim().Length > 30)
|
||
|
|
{
|
||
|
|
this.exporter.Text = "PulsarTeam";
|
||
|
|
}
|
||
|
|
policyRepositoryService.fn = string.Empty;
|
||
|
|
if (this.registry.Checked)
|
||
|
|
{
|
||
|
|
base.Invoke(new MethodInvoker(policyRepositoryService.ForgotAuthentication));
|
||
|
|
if (!this.m_Process)
|
||
|
|
{
|
||
|
|
base.Invoke(new Collection(this.StartAuthentication), new object[2]);
|
||
|
|
return false;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
result = this.CloneAuthentication(this.exporter.Text.Trim(), bool_0, policyRepositoryService.fn);
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
result = false;
|
||
|
|
}
|
||
|
|
return result;
|
||
|
|
}
|
||
|
|
|
||
|
|
// Validate authentication process
|
||
|
|
private void ValidateAuthentication(object sender, EventArgs e)
|
||
|
|
{
|
||
|
|
try
|
||
|
|
{
|
||
|
|
this.listener.Checked = false;
|
||
|
|
this.m_Process = true;
|
||
|
|
this.CountAuthentication(false);
|
||
|
|
this.m_Authentication = new Thread(new ParameterizedThreadStart(this.PrepareAuthentication));
|
||
|
|
this.m_Authentication.Start(false);
|
||
|
|
}
|
||
|
|
catch (ThreadAbortException)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
catch
|
||
|
|
{
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|