yck1509 / ConfuserEx

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

Mono can't handle OverrideDirectiveReference #566

Open LennardF1989 opened 7 years ago

LennardF1989 commented 7 years ago

Continueing my investigations for issue #204, I found out that Mono currently cannot handle the OverrideDirectiveReference properly. When I purpose exclude this implementation by returning true in ShouldCancelRename, I can succesfully run an aggresively obfuscated program with renPublic enabled on Mac!

I'll try to dig deeper why this is happening, but my time at the moment is limited and someone whoes deeper into the internals of ConfuserEx and how IL works might spot something off in there.

Link: https://github.com/yck1509/ConfuserEx/blob/3c9c29d9daf2f1259edf69054c5693d5d225a980/Confuser.Renamer/References/OverrideDirectiveReference.cs#L33

jsmars commented 7 years ago

I've run into this as well. How do I set the ShouldCancelRename as a workaround until this if fixed?

LennardF1989 commented 7 years ago

@jsmars I have made some changes to the code so I can toggle it on or off using a parameter called renPublicMono. The easiest method however is getting the latest source and changing this line to simply return true: https://github.com/yck1509/ConfuserEx/blob/3c9c29d9daf2f1259edf69054c5693d5d225a980/Confuser.Renamer/References/OverrideDirectiveReference.cs#L69

It will do exactly the same as my toggle, just... always :P Whereas I would only like to toggle it when I make a mac/linux build.

jsmars commented 7 years ago

Thanks, I'll have to do that then. I'll probably try to add a toggle as well since I'd prefer it only on mac/linux builds. I hope this gets fixed soon!