diff --git a/de4dot.code/deobfuscators/DeobfuscatorBase.cs b/de4dot.code/deobfuscators/DeobfuscatorBase.cs index c53cd3f2..650f17be 100644 --- a/de4dot.code/deobfuscators/DeobfuscatorBase.cs +++ b/de4dot.code/deobfuscators/DeobfuscatorBase.cs @@ -194,6 +194,7 @@ namespace de4dot.code.deobfuscators { } restoreBaseType(); + fixMDHeaderVersion(); } static bool isTypeWithInvalidBaseType(TypeDef moduleType, TypeDef type) { @@ -212,6 +213,13 @@ namespace de4dot.code.deobfuscators { } } + void fixMDHeaderVersion() { + // Version 1.1 supports generics but it's a little different. Most tools + // will have a problem reading the MD tables, so switch to the standard v2.0. + if (module.TablesHeaderVersion == 0x0101) + module.TablesHeaderVersion = 0x0200; + } + void removeTypesWithInvalidBaseTypes() { var moduleType = DotNetUtils.getModuleType(module); foreach (var type in module.GetTypes()) {