473,397 Members | 2,028 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

Obfuscation, Dofuscator attribute not being honored

tlhintoq
3,525 Expert 2GB
Something that seems reasonably straightforward is causing me to pull my hair out.

I have a rather simple project that performs file backups at regular timed intervals.
There are check boxes for Monday, Tuesday etc.
There are properties that correspond: bool RunOnMonday, etc.
Checking the checkbox changes the property
Changing the property check/unchecks the checkbox.
The settings are saved in the registry and when read back at program launch they set the properties.

All this works great when the application in not obfuscated.
The obfuscated version can save settings, but not load them.
It turns out that the property is NOT obfuscating the 'get' method, but is dropping the set method entirely



Am I just stupid? Doesn't this attribute read like it is supposed to keep the entire property from being obfuscated? Exclude true, apply to members true.
Expand|Select|Wrap|Line Numbers
  1. [Category("CustomValues"),
  2. Obfuscation(Exclude = true, StripAfterObfuscation = false, ApplyToMembers = true)]
  3. public bool RunOnMonday
  4. {
  5.     set
  6.     {
  7.        chkMonday.Checked = value;
  8.     }
  9.     get
  10.     {
  11.          return chkMonday.Checked;
  12.     }
  13. }
The fact that the get method is not obfuscated and the set method *is*, is what is really driving me bonkers.

In the Dofuscator project the "Honor Obfuscation Attributes" property is set to true.

If I uncomment the attribute for the entire assembly it gets honored, meaning the entire assembly is NOT obfuscated and the application runs fine. But then all my code is visible to the world.

I should be able to just keep the one property unobfuscated for both the get and set methods and can't seem to figure out how.

Does anyone else have some experience with Dotfuscator or obfuscation in general that can lend me a hand?
Jan 31 '10 #1

✓ answered by johnbr

Hi,

The default obfuscation attribute configuration will apply to the Renaming action. The set method is getting pruned by the "Removal" transform. The Removal transform removes any methods, fields, etc that are never called directly. In order to preserve the set method, try adding an obfuscation attribute for a removal include trigger:

[Obfuscation(Feature = "trigger", ApplyToMembers = true, Exclude = false)]

Please let me know if this helps...

3 3960
johnbr
1
Hi,

The default obfuscation attribute configuration will apply to the Renaming action. The set method is getting pruned by the "Removal" transform. The Removal transform removes any methods, fields, etc that are never called directly. In order to preserve the set method, try adding an obfuscation attribute for a removal include trigger:

[Obfuscation(Feature = "trigger", ApplyToMembers = true, Exclude = false)]

Please let me know if this helps...
Feb 1 '10 #2
tlhintoq
3,525 Expert 2GB
I'll be back in the office Wednesday and will give it a try. Thanks!
Feb 1 '10 #3
tlhintoq
3,525 Expert 2GB
[Obfuscation(Feature = "trigger", ApplyToMembers = true, Exclude = false)]
Does indeed keep the get and set methods intact in the properties. The full use for others looks like this:
Expand|Select|Wrap|Line Numbers
  1. [Obfuscation(Feature = "trigger", ApplyToMembers = true, Exclude = false)]
  2. public bool DeleteWhenDone
  3. {
  4.     get { return chkDeleteAfterCopy.Checked; }
  5.     set { chkDeleteAfterCopy.Checked = value; }
  6. }
So John, let me ask... Where did you come up with this? I have searched, googled and read all the docs I could lay my hand on from Dotfuscator and MSDN and have not found a good explanation of the obfuscation attributes beyond stuff like.

Obfuscation attribute... Use this attribute to set various obfuscation flags as needed.
No kidding. But I haven't found a good list or explanation of what the various attributes are and their meanings.

Even in this example 'Exclude = false' would make someone think the property this attribute is for is NOT going to be excluded from obfuscation when in practice it seems that it DOES exclude from obfuscation.

It seems my understanding of this is what has been obfuscated. <laugh>
Feb 3 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

159
by: petantik | last post by:
Are there any commercial, or otherwise obfuscators for python source code or byte code and what are their relative advantages or disadvantages. I wonder because there are some byte code protection...
13
by: vincent | last post by:
I made the suggestion "Need built in obfuscation support in C# compiler" to Microsoft. Anyone here agree with me? If yes, please cast your vote on this suggestion to raise its priority.
3
by: ..:: Kevin ::.. | last post by:
Is it possible to perform obfuscation on code automatically as part of a build in Visual Studio 2003? For example, instead of building code in release mode, is it possible to create a custom...
10
by: John T. | last post by:
Hi all Figure this scenario: - My Company develops an assembly (a controls DLL) - Since an obfuscation software is too expensive, my Company engages a consultant and delegates him the...
32
by: GK | last post by:
Hello, Can anybody suggest a best code obfuscation tool based on their exeperience ? (e.g.: testing effort after obfuscation is 0) thanks, GK
6
by: Summercool | last post by:
I just found that for a table, the margin for <trand <tdare not honored, but the padding is... is this a widely known fact? why make this an exception for margin, i wonder. margin not...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.