Remove encrypted strings field type

This commit is contained in:
de4dot 2012-02-03 10:13:41 +01:00
parent 33010b65a7
commit 3a49d2a603
2 changed files with 17 additions and 0 deletions

View File

@ -165,6 +165,7 @@ namespace de4dot.code.deobfuscators.Spices_Net {
if (Operations.DecryptStrings != OpDecryptString.None) {
addTypeToBeRemoved(stringDecrypter.Type, "String decrypter type");
addTypeToBeRemoved(stringDecrypter.EncryptedStringsType, "Encrypted strings field type");
stringDecrypter.cleanUp();
}

View File

@ -56,6 +56,22 @@ namespace de4dot.code.deobfuscators.Spices_Net {
}
}
public TypeDefinition EncryptedStringsType {
get {
if (encryptedDataField == null)
return null;
var type = encryptedDataField.FieldType as TypeDefinition;
if (type == null || type.Fields.Count != 1 || type.Fields[0] != encryptedDataField)
return null;
if (type.HasMethods || type.HasEvents || type.HasProperties || type.HasNestedTypes)
return null;
if (type.Interfaces.Count > 0)
return null;
return type;
}
}
public TypeDefinition Type {
get { return decrypterType; }
}