yck1509 / ConfuserEx

An open-source, free protector for .NET applications
http://yck1509.github.io/ConfuserEx/
Other
3.56k stars 1.61k forks source link

Name protection does not handle interfaces correctly #157

Closed OndrejPetrzilka closed 9 years ago

OndrejPetrzilka commented 9 years ago

Priject A:

interface IMyInterface { void Method(); }

Project B:

class SomeClass { public void Method(); }

class AnotherClass : SomeClass, IMyInterface { }

This is valid in C#, no need to define Method() in AnotherClass. After obfuscating (rename) Project B, it triggers exception: System.TypeLoadException: Method '=vQE2c7I6c5GGgBR7IFPFvx9Jd8=' in type '=MyA7qP3egZSNcyzePBicnJg1aW=' from assembly 'ProjectB.....' does not have an implementation.

it seems that C# notices that Method() with required name and signature is already defined, so interface is 'satisfied'. However ConfuserEx does not notice that and does not take it into account during rename.

This is problem, because in VS, everything looks fine, but after obfuscation, it crashes.

yck1509 commented 9 years ago

Your problem is same as #105, which is already fixed. I just tried the code you provided and it runs without problem. Is there any sample dll/exe that can reproduce the problem?

OndrejPetrzilka commented 9 years ago

I'll build from sources and try again, thanks for help and sorry for duplicate!

OndrejPetrzilka commented 9 years ago

OK this case is fine, other case is problem, do you want me to make a new ticket or write it here?

yck1509 commented 9 years ago

I suppose you could open a new issue.

OndrejPetrzilka commented 9 years ago

Closing as duplicate to #105 Already fixed on trunk