Obfuscating enum names when enum is .ToString()'d

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, Alex.Davies, melvyn.harbour

Obfuscating enum names when enum is .ToString()'d

Postby CodeGuru » Mon Nov 22, 2010 5:34 pm

Say for instance I have

Code: Select all
Class Drawing
  enum Color

and I reference it by:
Color myColor = Color.red;

Smart Assembly will not only fail to obfuscate the enum name and its members, but it also does not obfuscate the entire class name. :(

Other obfuscators I have worked with did this by default, and we'd have to manually add exclusions to enums (or their members) if we did not want their name to be obfuscated.

I much prefer this approach as it errors on the secure side, rather than the unsecure side.

If anything, at least give us an option to force obfuscation of objects thats are .ToString()'d.

I wouldn't have noticed this but when I loaded my assembly up in ida (which loads fine btw), I saw a few of my key enum's and class names plain as day. It makes it a lot easier to reverse the code when you have that kind of starting point.

You may wonder why you would want to obfuscate an enum by default when its .ToString()'d, and the reason is, if your enum is a set of flags, you may .ToString("X") to view the hex value of its current state. The current workaround is to ((int)myColor).ToString("X") and SmartAssembly will obfuscate the names and members as expected.

Thanks for your consideration!
Last edited by CodeGuru on Tue Nov 23, 2010 6:26 pm, edited 1 time in total.
Posts: 9
Joined: Mon Nov 22, 2010 5:29 pm

Postby nick.maidment » Tue Nov 23, 2010 6:24 pm

I just sent you an email, Please let me know if you get it.

If you can send us a reproduction of the problem you're seeing and the saproj file you used to protect the assembly, it lets us get to the heart of the issue a lot faster :)
Posts: 74
Joined: Fri Jan 29, 2010 1:55 pm

Postby CodeGuru » Tue Nov 23, 2010 6:27 pm

I did, hence my ninja edit. I'll provide a sample after lunch.
Posts: 9
Joined: Mon Nov 22, 2010 5:29 pm

Return to SmartAssembly 5

Who is online

Users browsing this forum: No registered users and 0 guests