Show message if more than one obfuscator is detected
This commit is contained in:
parent
fe6020a16c
commit
294ae6bc5e
|
@ -287,18 +287,30 @@ namespace de4dot.code {
|
||||||
}
|
}
|
||||||
|
|
||||||
IDeobfuscator detectObfuscator2(IEnumerable<IDeobfuscator> deobfuscators) {
|
IDeobfuscator detectObfuscator2(IEnumerable<IDeobfuscator> deobfuscators) {
|
||||||
|
var allDetected = new List<IDeobfuscator>();
|
||||||
IDeobfuscator detected = null;
|
IDeobfuscator detected = null;
|
||||||
int detectVal = 0;
|
int detectVal = 0;
|
||||||
foreach (var deob in deobfuscators) {
|
foreach (var deob in deobfuscators) {
|
||||||
this.deob = deob; // So we can call deob.CanInlineMethods in deobfuscate()
|
this.deob = deob; // So we can call deob.CanInlineMethods in deobfuscate()
|
||||||
int val = deob.detect();
|
int val = deob.detect();
|
||||||
Log.v("{0,3}: {1}", val, deob.TypeLong);
|
Log.v("{0,3}: {1}", val, deob.TypeLong);
|
||||||
|
if (val > 0 && deob.Type != "un")
|
||||||
|
allDetected.Add(deob);
|
||||||
if (val > detectVal) {
|
if (val > detectVal) {
|
||||||
detectVal = val;
|
detectVal = val;
|
||||||
detected = deob;
|
detected = deob;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.deob = null;
|
this.deob = null;
|
||||||
|
|
||||||
|
if (allDetected.Count > 1) {
|
||||||
|
Log.n("More than one obfuscator detected:");
|
||||||
|
Log.indent();
|
||||||
|
foreach (var deob in allDetected)
|
||||||
|
Log.n("{0} (use: -p {1})", deob.Name, deob.Type);
|
||||||
|
Log.deIndent();
|
||||||
|
}
|
||||||
|
|
||||||
return detected;
|
return detected;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user