private void ExecuteDeobfuscateCommand()
        {
            if (this.selectedItem == null)
            {
                return;
            }

            string location = GetFilePath();

            if (string.IsNullOrWhiteSpace(location))
            {
                return;
            }

            De4dotWrapper de4Dot = new De4dotWrapper();

            SaveFileDialog saveFileDialog = new SaveFileDialog();

            saveFileDialog.Filter           = "Assembly files (*.exe, *.dll)|*.exe;*.dll";
            saveFileDialog.InitialDirectory = Path.GetDirectoryName(location);
            saveFileDialog.FileName         = Path.GetFileNameWithoutExtension(location) + ".Cleaned" + Path.GetExtension(location);
            if (saveFileDialog.ShowDialog() == true)
            {
                IObfuscatedFile             obfuscationfile = UpdateObfuscationFileWithOptions(de4Dot, location, saveFileDialog.FileName);
                DeobfuscationProgressWindow progressWindow  = new DeobfuscationProgressWindow(obfuscationfile, this.assemblyManagerService)
                {
                    Title  = saveFileDialog.FileName,
                    Width  = 500,
                    Height = 150,
                    WindowStartupLocation = WindowStartupLocation.CenterOwner,
                    Owner = Application.Current.MainWindow
                };
                progressWindow.Start(saveFileDialog.FileName);
            }
        }
        private IObfuscatedFile UpdateObfuscationFileWithOptions(De4dotWrapper de4Dot, string location, string newFile)
        {
            ObfuscatedFile.Options options = new ObfuscatedFile.Options();
            options.ControlFlowDeobfuscation = this.EnableControlFlowDeobfuscation;
            options.NewFilename         = newFile;
            options.KeepObfuscatorTypes = this.KeepObfuscatorClasses;
            options.Filename            = location;
            var            context = new ModuleContext();
            ObfuscatedFile result  = de4Dot.CreateObfuscationFile(options, context);

            return(result);
        }
        private void GenerateMessage()
        {
            string location = GetFilePath();

            if (string.IsNullOrWhiteSpace(location))
            {
                return;
            }

            De4dotWrapper de4Dot = new De4dotWrapper();

            IObfuscatedFile obfuscationfile = de4Dot.SearchDeobfuscator(location);
            string          caption         = "Assembly {0} is obfuscated with {1}. Clean the file ?";

            caption      = string.Format(caption, Path.GetFileName(location), obfuscationfile.Deobfuscator.Name);
            this.Message = caption;
        }
		private void ExecuteDeobfuscateCommand()
		{
			if (this.selectedItem == null)
			{
				return;
			}

			string location = GetFilePath();

			if (string.IsNullOrWhiteSpace(location))
			{
				return;
			}

			De4dotWrapper de4Dot = new De4dotWrapper();

			SaveFileDialog saveFileDialog = new SaveFileDialog();
			saveFileDialog.Filter = "Assembly files (*.exe, *.dll)|*.exe;*.dll";
			saveFileDialog.InitialDirectory = Path.GetDirectoryName(location);
			saveFileDialog.FileName = Path.GetFileNameWithoutExtension(location) + ".Cleaned" + Path.GetExtension(location);
			if (saveFileDialog.ShowDialog() == true)
			{
				IObfuscatedFile obfuscationfile = UpdateObfuscationFileWithOptions(de4Dot, location, saveFileDialog.FileName);
				DeobfuscationProgressWindow progressWindow = new DeobfuscationProgressWindow(obfuscationfile, this.assemblyManagerService)
				{
					Title = saveFileDialog.FileName,
					Width = 500,
					Height = 150,
					WindowStartupLocation = WindowStartupLocation.CenterOwner,
					Owner = Application.Current.MainWindow
				};
				progressWindow.Start(saveFileDialog.FileName);
			}
		}
		private IObfuscatedFile UpdateObfuscationFileWithOptions(De4dotWrapper de4Dot, string location, string newFile)
		{
			ObfuscatedFile.Options options = new ObfuscatedFile.Options();
			options.ControlFlowDeobfuscation = this.EnableControlFlowDeobfuscation;
			options.NewFilename = newFile;
			options.KeepObfuscatorTypes = this.KeepObfuscatorClasses;
			options.Filename = location;
			var context = new ModuleContext();
			ObfuscatedFile result = de4Dot.CreateObfuscationFile(options, context);
			return result;
		}
		private void GenerateMessage()
		{
			string location = GetFilePath();

			if (string.IsNullOrWhiteSpace(location))
			{
				return;
			}

			De4dotWrapper de4Dot = new De4dotWrapper();

			IObfuscatedFile obfuscationfile = de4Dot.SearchDeobfuscator(location);
			string caption = "Assembly {0} is obfuscated with {1}. Clean the file ?";
			caption = string.Format(caption, Path.GetFileName(location), obfuscationfile.Deobfuscator.Name);
			this.Message = caption;
		}