Merge branch 'master' into confuser
This commit is contained in:
commit
9e4fa4511b
|
@ -754,11 +754,11 @@ namespace de4dot.blocks {
|
|||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<CustomAttribute> findAttributes(AssemblyDefinition asm, TypeReference attr) {
|
||||
public static IEnumerable<CustomAttribute> findAttributes(ICustomAttributeProvider custAttrProvider, TypeReference attr) {
|
||||
var list = new List<CustomAttribute>();
|
||||
if (asm == null)
|
||||
if (custAttrProvider == null)
|
||||
return list;
|
||||
foreach (var cattr in asm.CustomAttributes) {
|
||||
foreach (var cattr in custAttrProvider.CustomAttributes) {
|
||||
if (MemberReferenceHelper.compareTypes(attr, cattr.AttributeType))
|
||||
list.Add(cattr);
|
||||
}
|
||||
|
|
|
@ -691,6 +691,11 @@ namespace de4dot.code.deobfuscators {
|
|||
return list.Count == 0 ? null : list[0];
|
||||
}
|
||||
|
||||
protected CustomAttribute getModuleAttribute(TypeReference attr) {
|
||||
var list = new List<CustomAttribute>(DotNetUtils.findAttributes(module, attr));
|
||||
return list.Count == 0 ? null : list[0];
|
||||
}
|
||||
|
||||
protected bool hasMetadataStream(string name) {
|
||||
foreach (var stream in module.MetadataStreams) {
|
||||
if (stream.Name == name)
|
||||
|
|
Loading…
Reference in New Issue
Block a user