public void doIt(Stream memStream, bool doRename) { //if (options.DetectObfuscators) // detectObfuscators(); //else if (options.OneFileAtATime) // deobfuscateOneAtATime(); //else // deobfuscateAll(); var loader = new DotNetFileLoader(new DotNetFileLoader.Options { ModuleContext = options.ModuleContext, PossibleFiles = options.Files, SearchDirs = options.SearchDirs, CreateDeobfuscators = () => createDeobfuscators(), DefaultStringDecrypterType = options.DefaultStringDecrypterType, DefaultStringDecrypterMethods = options.DefaultStringDecrypterMethods, AssemblyClientFactory = options.AssemblyClientFactory, DeobfuscatorContext = deobfuscatorContext, ControlFlowDeobfuscation = options.ControlFlowDeobfuscation, KeepObfuscatorTypes = options.KeepObfuscatorTypes, MetaDataFlags = options.MetaDataFlags, RenamerFlags = options.RenamerFlags }); foreach (var file in loader.load()) { file.deobfuscateBegin(); file.deobfuscate(); file.deobfuscateEnd(); if(doRename) rename(new List<IObfuscatedFile> { file }); file.save(memStream); } }
IEnumerable <IObfuscatedFile> loadAllFiles(bool onlyScan = false) { var loader = new DotNetFileLoader(new DotNetFileLoader.Options { PossibleFiles = options.Files, SearchDirs = options.SearchDirs, CreateDeobfuscators = () => createDeobfuscators(), DefaultStringDecrypterType = options.DefaultStringDecrypterType, DefaultStringDecrypterMethods = options.DefaultStringDecrypterMethods, AssemblyClientFactory = options.AssemblyClientFactory, DeobfuscatorContext = deobfuscatorContext, ControlFlowDeobfuscation = options.ControlFlowDeobfuscation, KeepObfuscatorTypes = options.KeepObfuscatorTypes, CreateDestinationDir = !onlyScan, }); bool ignoreNativeCodeFiles = !onlyScan; foreach (var file in loader.load()) { if (ignoreNativeCodeFiles) { if ((file.ModuleDefinition.Attributes & ModuleAttributes.ILOnly) == 0) { Log.w("Ignoring assembly with native code {0}", file.Filename); removeModule(file.ModuleDefinition); continue; } } yield return(file); } }
IEnumerable <IObfuscatedFile> loadAllFiles(bool onlyScan) { var loader = new DotNetFileLoader(new DotNetFileLoader.Options { PossibleFiles = options.Files, SearchDirs = options.SearchDirs, CreateDeobfuscators = () => createDeobfuscators(), DefaultStringDecrypterType = options.DefaultStringDecrypterType, DefaultStringDecrypterMethods = options.DefaultStringDecrypterMethods, AssemblyClientFactory = options.AssemblyClientFactory, DeobfuscatorContext = deobfuscatorContext, ControlFlowDeobfuscation = options.ControlFlowDeobfuscation, KeepObfuscatorTypes = options.KeepObfuscatorTypes, CreateDestinationDir = !onlyScan, }); foreach (var file in loader.load()) { yield return(file); } }
public void doIt(Stream memStream, bool doRename) { //if (options.DetectObfuscators) // detectObfuscators(); //else if (options.OneFileAtATime) // deobfuscateOneAtATime(); //else // deobfuscateAll(); var loader = new DotNetFileLoader(new DotNetFileLoader.Options { ModuleContext = options.ModuleContext, PossibleFiles = options.Files, SearchDirs = options.SearchDirs, CreateDeobfuscators = () => createDeobfuscators(), DefaultStringDecrypterType = options.DefaultStringDecrypterType, DefaultStringDecrypterMethods = options.DefaultStringDecrypterMethods, AssemblyClientFactory = options.AssemblyClientFactory, DeobfuscatorContext = deobfuscatorContext, ControlFlowDeobfuscation = options.ControlFlowDeobfuscation, KeepObfuscatorTypes = options.KeepObfuscatorTypes, MetaDataFlags = options.MetaDataFlags, RenamerFlags = options.RenamerFlags }); foreach (var file in loader.load()) { file.deobfuscateBegin(); file.deobfuscate(); file.deobfuscateEnd(); if (doRename) { rename(new List <IObfuscatedFile> { file }); } file.save(memStream); } }
IEnumerable<IObfuscatedFile> LoadAllFiles(bool onlyScan) { var loader = new DotNetFileLoader(new DotNetFileLoader.Options { ModuleContext = options.ModuleContext, PossibleFiles = options.Files, SearchDirs = options.SearchDirs, CreateDeobfuscators = () => CreateDeobfuscators(), DefaultStringDecrypterType = options.DefaultStringDecrypterType, DefaultStringDecrypterMethods = options.DefaultStringDecrypterMethods, AssemblyClientFactory = options.AssemblyClientFactory, DeobfuscatorContext = deobfuscatorContext, ControlFlowDeobfuscation = options.ControlFlowDeobfuscation, KeepObfuscatorTypes = options.KeepObfuscatorTypes, MetaDataFlags = options.MetaDataFlags, RenamerFlags = options.RenamerFlags, CreateDestinationDir = !onlyScan, }); foreach (var file in loader.Load()) yield return file; }
IEnumerable<IObfuscatedFile> loadAllFiles(bool onlyScan = false) { var loader = new DotNetFileLoader(new DotNetFileLoader.Options { PossibleFiles = options.Files, SearchDirs = options.SearchDirs, CreateDeobfuscators = () => createDeobfuscators(), DefaultStringDecrypterType = options.DefaultStringDecrypterType, DefaultStringDecrypterMethods = options.DefaultStringDecrypterMethods, AssemblyClientFactory = options.AssemblyClientFactory, ControlFlowDeobfuscation = options.ControlFlowDeobfuscation, KeepObfuscatorTypes = options.KeepObfuscatorTypes, CreateDestinationDir = !onlyScan, }); bool ignoreNativeCodeFiles = !onlyScan; foreach (var file in loader.load()) { if (ignoreNativeCodeFiles) { if ((file.ModuleDefinition.Attributes & ModuleAttributes.ILOnly) == 0) { Log.w("Ignoring assembly with native code {0}", file.Filename); removeModule(file.ModuleDefinition); continue; } } yield return file; } }
IEnumerable<IObfuscatedFile> loadAllFiles() { var loader = new DotNetFileLoader(new DotNetFileLoader.Options { PossibleFiles = options.Files, SearchDirs = options.SearchDirs, CreateDeobfuscators = () => createDeobfuscators(), DefaultStringDecrypterType = options.DefaultStringDecrypterType, DefaultStringDecrypterMethods = options.DefaultStringDecrypterMethods, AssemblyClientFactory = options.AssemblyClientFactory, RenameSymbols = options.RenameSymbols, ControlFlowDeobfuscation = options.ControlFlowDeobfuscation, KeepObfuscatorTypes = options.KeepObfuscatorTypes, }); return loader.load(); }