WPF and obfuscators

Source: Internet
Author: User

So far, obfuscation remains. NetProgramAnd obfuscatorsWPFWhat is application support? Let's explain it through an example today.

First, create a simple user interface as shown in:

On the pageCodeSet some binding attributes:

In the background code, first define a race enumeration to facilitate use in the list:

Below is the formWindow1Class defines the following attributes:

The code function at the Red Circle is to load all the values of the racial enumeration to the racial list attribute, so that enumeration can be used in a uniform and elegant manner in the front and back of the background. This is a good trick.

Next, you can hard encode the values of some attributes in the constructor, and then use yourself as your ownDatacontext:

Er...Do not make any noise when playing World of Warcraft.....

Now compile and run the program, and we can see that the data is well reflected on the interface:

OK , next we will start with dotfuscator Professional Edition 4.3 evaluation as an example.

OpenDotfuscatorDirectly create a project, load the program we compiled, and then directly confuse and output the program after running the output:

Well, no data is displayed. Why?

In my understanding, obfuscators cannot be parsed or modified yet. XAML File, resulting in confusion between the background code and the foreground XAML The interface description does not match, for example," {Binding Race } And so on.

The following shows some obfuscation ing results:

The items in the gray background color indicate that they have been removed from the program, and other items have corresponding names after obfuscation.

To make the obfuscated program work normally, we mustXAMLCompromise.

The first thing you may think of is to restore the interface-related attributes that have been deleted above, but I tried it and that doesn't work.

As long asWindow1Class obfuscation, the problem is basically solved:

Looking at the obfuscation results, we can probably guessDotfuscatorIs to automatically add the public attributes of the classes that prohibit obfuscation to the exclude obfuscation column, and these attributes are not removed this time:

However, I still cannot explain why the program still cannot work normally when only obfuscation properties are prohibited and classes are not allowed.

There is another problem, that is, the List displays the names of the enumerated values after obfuscation, which is well handled, as long as all fields of the enumerated values are prohibited:

Now the program has completely recovered to normal, but this is not much different from the unobfuscated program.ReflectorObfuscated programs parsed:

conclusion: obfuscation technology is already quite complete, WPF it brings new challenges, we can only expect the vendors to follow up as soon as possible, so that WPF programs can also be fully protected, laying the foundation for their future wide application.

PDF download: http://www.box.net/shared/abeeolbk72

Source codeDownload: http://www.box.net/shared/uqadhnhsua

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.