Home - Forums-.NET - Spices.Net - how to obfuscate values inside of methods

Spices.Net

NET code security, tools to protect, obfuscate, tamper defense, code and data safety, recover, convert, optimize, explore, browse and analyze .Net software.

This forum related to following products: Spices.Net Suite, Spices.Net Obfuscator, Spices.Net Decompiler

how to obfuscate values inside of methods
Link Posted: 10-Apr-2008 06:36
I can't seem to get Spices to obfuscate object names that are only declared and used inside of a method (at least not very well).  For example, this:

       void NoteDeleted(object sender, EventArgs e)
        {
            INoteContainer nc = _p as INoteContainer;
            nc.Notes.Get(e.Data.ID).Text = "";
            OnItemRemoved();
        }


was changed to this:


    private void 21(object, EventArgs args1)
    {
        INoteContainer container = this.0 as INoteContainer;
        container.Notes.Get(args1.Data.ID).Text = "";
        OnItemRemoved();
    }


My question is:  Is there anyway to make the INoteContainer object (named "nc" or "container" in these examples) be named more obscurely?  My method name went from NoteDeleted to 21, why wasn't the INoteContainer named with a numeric name???
Link Posted: 10-Apr-2008 10:28
There are two ways to obfuscate references to INoteContainer:
1. If INoteContainer declaration is in the assemblies contained by spices.project - just mark this interface and its methods(if necessary) by SpecialNameAttribute and specify the name for obfuscation in this attribute (assembly that's providing this attribute and source code you can find in the \SDK\Obfuscation Attributes\ folder of Spices.Net installation).
Spices.Obfuscator will cross-obfuscate all references to this interface declaration in all assemblies of your spices.project.
2. If it is external to assemblies in your spices.project declaration - use Anonymizer.ReferencedMethods option to hide all references to the methods of this interface in your assemblies.