Red Gate forums :: View topic - Obfuscating enum names when enum is .ToString()'d
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 5
SmartAssembly 5 forum

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

Search in SmartAssembly 5 forum
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.
Jump to:  
Author Message
CodeGuru



Joined: 22 Nov 2010
Posts: 8

PostPosted: Mon Nov 22, 2010 5:34 pm    Post subject: Obfuscating enum names when enum is .ToString()'d Reply with quote

Say for instance I have

Code:

Class Drawing
{
  enum Color
  {
    red,
    blue,
  }
}


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

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

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
Back to top
View user's profile Send private message
nick.maidment



Joined: 29 Jan 2010
Posts: 74

PostPosted: Tue Nov 23, 2010 6:24 pm    Post subject: Reply with quote

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 Smile
Back to top
View user's profile Send private message
CodeGuru



Joined: 22 Nov 2010
Posts: 8

PostPosted: Tue Nov 23, 2010 6:27 pm    Post subject: Reply with quote

I did, hence my ninja edit. I'll provide a sample after lunch.
Back to top
View user's profile Send private message
Display posts from previous:   
This topic is locked: you cannot edit posts or make replies. All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group