yck1509 / ConfuserEx

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

Rename all Local Variables and Method Parameters? #298

Closed StrikeKnight closed 9 years ago

StrikeKnight commented 9 years ago

Is there way to rename all local variables and method parameters? But only those, not methods, properties, types, etc... I ask because that seems like an easy setting to apply across the board, with minimal risk of breaking other code. In my testing so far renaming parameters only seems to kick in when also renaming methods. I'm using a setting like this:

    <rule pattern="member-type('method')">
        <protection id="rename"/>
    </rule>

However that ends up causing MissingMethodExceptions at runtime because there are private methods that are renamed but the calls to them aren't. This is likely because of my heavy use of generics, which is likely triggering a separate issue.

Also it seems like they are renamed to things like text and num, instead of more random strings. More complex names, outputted to the symbols.map, would make it that much hard to decipher, right.

Thank you very much for creating ConfuserEx and supporting Mono. It really is the only game in town when it comes to obfuscating Unity based games.

yck1509 commented 9 years ago

Hi, The name of local variables are stored in PDB files, which could be removed by simply deleting the PDB file, while name of method parameters are removed by default.