Make sure MD header version isn't 1.1 (reset it to 2.0 if so)
This commit is contained in:
parent
a7fdbd4206
commit
ba54b607eb
|
@ -194,6 +194,7 @@ namespace de4dot.code.deobfuscators {
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreBaseType();
|
restoreBaseType();
|
||||||
|
fixMDHeaderVersion();
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool isTypeWithInvalidBaseType(TypeDef moduleType, TypeDef type) {
|
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() {
|
void removeTypesWithInvalidBaseTypes() {
|
||||||
var moduleType = DotNetUtils.getModuleType(module);
|
var moduleType = DotNetUtils.getModuleType(module);
|
||||||
foreach (var type in module.GetTypes()) {
|
foreach (var type in module.GetTypes()) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user