Make sure enum instance field has proper flags set (make peverify happy)

This commit is contained in:
de4dot 2012-02-25 05:15:42 +01:00
parent fb832ca3de
commit 5288b4b3d2
2 changed files with 14 additions and 0 deletions

View File

@ -209,6 +209,19 @@ namespace de4dot.code.deobfuscators {
}
}
protected void fixEnumTypes() {
foreach (var type in module.GetTypes()) {
if (!type.IsEnum)
continue;
foreach (var field in type.Fields) {
if (field.IsStatic)
continue;
field.IsRuntimeSpecialName = true;
field.IsSpecialName = true;
}
}
}
public virtual IEnumerable<string> getStringDecrypterMethods() {
return new List<string>();
}

View File

@ -113,6 +113,7 @@ namespace de4dot.code.deobfuscators.Skater_NET {
public override void deobfuscateEnd() {
if (Operations.DecryptStrings != OpDecryptString.None && stringDecrypter.CanRemoveType)
addTypeToBeRemoved(stringDecrypter.Type, "String decrypter type");
fixEnumTypes();
base.deobfuscateEnd();
}