private FileSystemPath Deobfuscate(IObfuscatedFile obfuscatedFile, IProgressIndicator progressIndicator)
        {
            try
            {
                progressIndicator.Start(5);
                progressIndicator.TaskName = "Deobfuscating...";
                progressIndicator.CurrentItemText = string.Format("Saving to {0}", obfuscatedFile.NewFilename);

                progressIndicator.Advance(1);
                obfuscatedFile.deobfuscateBegin();

                progressIndicator.Advance(1);
                obfuscatedFile.deobfuscate();

                progressIndicator.Advance(1);
                obfuscatedFile.deobfuscateEnd();

                // turn all flags on
                RenamerFlags flags = RenamerFlags.DontCreateNewParamDefs | RenamerFlags.DontRenameDelegateFields |
                                     RenamerFlags.RenameEvents |
                                     RenamerFlags.RenameFields | RenamerFlags.RenameGenericParams |
                                     RenamerFlags.RenameMethodArgs |
                                     RenamerFlags.RenameMethods | RenamerFlags.RenameNamespaces |
                                     RenamerFlags.RenameProperties |
                                     RenamerFlags.RenameTypes | RenamerFlags.RestoreEvents |
                                     RenamerFlags.RestoreEventsFromNames |
                                     RenamerFlags.RestoreProperties | RenamerFlags.RestorePropertiesFromNames;
                var renamer = new Renamer(obfuscatedFile.DeobfuscatorContext, new[] { obfuscatedFile }, flags);
                progressIndicator.Advance(1);
                renamer.rename();

                progressIndicator.Advance(1);
                obfuscatedFile.save();
            }
            finally
            {
                progressIndicator.Stop();
            }

            return new FileSystemPath(obfuscatedFile.NewFilename);
        }
Ejemplo n.º 2
0
 void rename(IEnumerable<IObfuscatedFile> theFiles)
 {
     if (!options.RenameSymbols)
         return;
     var renamer = new Renamer(deobfuscatorContext, theFiles, options.RenamerFlags);
     renamer.rename();
 }
Ejemplo n.º 3
0
 void rename(IEnumerable<IObfuscatedFile> theFiles)
 {
     if (!options.RenameSymbols)
         return;
     var renamer = new Renamer(theFiles) {
         RestorePropertiesFromNames = options.RestorePropsEvents,
         RestoreEventsFromNames = options.RestorePropsEvents,
     };
     renamer.rename();
 }