Don't create dest dirs if we're just detecting obfuscators
This commit is contained in:
parent
2ddf6b00de
commit
e3b767adcc
|
@ -78,7 +78,7 @@ namespace de4dot {
|
||||||
}
|
}
|
||||||
|
|
||||||
void detectObfuscators() {
|
void detectObfuscators() {
|
||||||
foreach (var file in loadAllFiles()) {
|
foreach (var file in loadAllFiles(true)) {
|
||||||
removeModule(file.ModuleDefinition);
|
removeModule(file.ModuleDefinition);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -114,7 +114,7 @@ namespace de4dot {
|
||||||
saveAllFiles(allFiles);
|
saveAllFiles(allFiles);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<IObfuscatedFile> loadAllFiles() {
|
IEnumerable<IObfuscatedFile> loadAllFiles(bool onlyScan = false) {
|
||||||
var loader = new DotNetFileLoader(new DotNetFileLoader.Options {
|
var loader = new DotNetFileLoader(new DotNetFileLoader.Options {
|
||||||
PossibleFiles = options.Files,
|
PossibleFiles = options.Files,
|
||||||
SearchDirs = options.SearchDirs,
|
SearchDirs = options.SearchDirs,
|
||||||
|
@ -125,6 +125,7 @@ namespace de4dot {
|
||||||
RenameSymbols = options.RenameSymbols,
|
RenameSymbols = options.RenameSymbols,
|
||||||
ControlFlowDeobfuscation = options.ControlFlowDeobfuscation,
|
ControlFlowDeobfuscation = options.ControlFlowDeobfuscation,
|
||||||
KeepObfuscatorTypes = options.KeepObfuscatorTypes,
|
KeepObfuscatorTypes = options.KeepObfuscatorTypes,
|
||||||
|
CreateDestinationDir = !onlyScan,
|
||||||
});
|
});
|
||||||
return loader.load();
|
return loader.load();
|
||||||
}
|
}
|
||||||
|
@ -144,6 +145,7 @@ namespace de4dot {
|
||||||
public bool RenameSymbols { get; set; }
|
public bool RenameSymbols { get; set; }
|
||||||
public bool ControlFlowDeobfuscation { get; set; }
|
public bool ControlFlowDeobfuscation { get; set; }
|
||||||
public bool KeepObfuscatorTypes { get; set; }
|
public bool KeepObfuscatorTypes { get; set; }
|
||||||
|
public bool CreateDestinationDir { get; set; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public DotNetFileLoader(Options options) {
|
public DotNetFileLoader(Options options) {
|
||||||
|
@ -203,7 +205,8 @@ namespace de4dot {
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Log.n("Detected {0} ({1})", deob.Name, file.Filename);
|
Log.n("Detected {0} ({1})", deob.Name, file.Filename);
|
||||||
createDirectories(Path.GetDirectoryName(file.NewFilename));
|
if (options.CreateDestinationDir)
|
||||||
|
createDirectories(Path.GetDirectoryName(file.NewFilename));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user