优化ProxyCall的规则,暂时不对mscorlib及GetEnumerator函数混淆
parent
440b0509c2
commit
61370fd939
|
@ -20,11 +20,24 @@ namespace Obfuz.DynamicProxy
|
|||
ITypeDefOrRef declaringType = method.DeclaringType;
|
||||
TypeDef typeDef = declaringType.ResolveTypeDef();
|
||||
// doesn't proxy call if the method is a delegate
|
||||
if (typeDef != null && typeDef.IsDelegate)
|
||||
if (typeDef != null)
|
||||
{
|
||||
// need configurable
|
||||
if (typeDef.Module.IsCoreLibraryModule == true)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (typeDef.IsDelegate)
|
||||
return false;
|
||||
}
|
||||
// doesn't proxy call if the method is a constructor
|
||||
if (method.Name == ".ctor")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
if (method.Name == ".ctor")
|
||||
// special handle
|
||||
// don't proxy call for List<T>.Enumerator GetEnumerator()
|
||||
if (method.Name == "GetEnumerator")
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue