Open rollsch opened 5 years ago
Hello, nice find, thank you for the code. I think from here you can make a PR. ConfuserEx WPF analyzer is pretty self explanatory, however if you got stuck just let me know :))
Can you give some pointers of where the analysers should be put?
Basically the process is as follows: Analyse all WPF to build a list of databindings - Analyser1 Analyse all C# to build a list of dynamic bindings (eg using TypeOf and things like that) - Analyser2
Remove all items found in analyser1,analyser2 from the renaming (can I simply do this from within the analyser itself?)
Where would I inject these new analysers?
If I wanted to go a step further and rename within the BAML and C#, how would this work? The analyser isn't allowed to modify anything yet so it would need to store the results and then intercept during the rewrite process?
Can you explain the class layout to assist? Writing the code is easy but understanding the code structure is where I am falling over. I just hacked everything in to make it work as I couldn't figure out where to put the analysers or the program flow.
right there : https://github.com/XenocodeRCE/neo-ConfuserEx/tree/master/Confuser.Renamer/BAML https://github.com/XenocodeRCE/neo-ConfuserEx/tree/master/Confuser.Renamer/Analyzers
basically debug the project while obfuscating your app, and keep your eyes on the variable values. When it is about to make a mistake, just fix the code. I'm sure it's the matter of less then 2 lines of code.
So you are happy for me to modify the existing analysers and not make new ones?
Is your feature request related to a problem? Please describe. If you have XAML Databinding to public members and use ForceRen (because lets assume your project is not a public library so renaming public methods is acceptable) then this will obviously break databinding.
Describe the solution you'd like I've hacked a solution which extracts all databinding out of the XAML and makes a list of member names. It then adds these names to the list of items to not rename. My solution is very ugly but it works,
This would be great to see added as it allows a high level of obfuscation such as:
But it also doesn't break XAML databinding. I have a very large project and this approach hasn't failed so far.
To do this properly you would rename the XAML however where I hacked my solution in it seemed like quite a bit of work to make it also rename the XAML, instead I just disabled renaming of these members instead.
here is my function which extracts databinding from .cs files
here is my code which extracts a list of databinding elements from BAML