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>();
|
var list = new List<CustomAttribute>();
|
||||||
if (asm == null)
|
if (custAttrProvider == null)
|
||||||
return list;
|
return list;
|
||||||
foreach (var cattr in asm.CustomAttributes) {
|
foreach (var cattr in custAttrProvider.CustomAttributes) {
|
||||||
if (MemberReferenceHelper.compareTypes(attr, cattr.AttributeType))
|
if (MemberReferenceHelper.compareTypes(attr, cattr.AttributeType))
|
||||||
list.Add(cattr);
|
list.Add(cattr);
|
||||||
}
|
}
|
||||||
|
|
|
@ -691,6 +691,11 @@ namespace de4dot.code.deobfuscators {
|
||||||
return list.Count == 0 ? null : list[0];
|
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) {
|
protected bool hasMetadataStream(string name) {
|
||||||
foreach (var stream in module.MetadataStreams) {
|
foreach (var stream in module.MetadataStreams) {
|
||||||
if (stream.Name == name)
|
if (stream.Name == name)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user