Source code analysis-Analysis Environment preparation

Source: Internet
Author: User
Tags reflector

Since the source code of the CR is not directly disclosed, we need to use some tools to snoop on its secrets.

The following tools are required to analyze the CRCs:

MS robotic studio express 2008r2, this does not need to be explained, install it to get

Reflector & filedisassembler, reflector has two roles: one is to decompile the DLL file of the CR to the C # language, and the other is to directly analyze the content of the CR, these analyses are not easy in. Filedisassembler is a plug-in of reflector to export the decompilation results to a C # project.

Visual C #2008 express or Visual Studio 2010 beta2 (recommended because vs 2010 greatly enhances the multi-thread debugging capability)

The above tools are available for free.

 

Source code and example Program

Microsoft. cr. Core. dll is the object we will study this time. To facilitate analysis and debugging, We need to decompile it with reflector and filedisassembler. Note: The decompiled source code may have some problems. The following describes several important changes:
1. Resource file. Delete the resource1.cs generated by reflector, create a resource file named resource1.resx, and run the Microsoft. cr. core. all strings in resx are copied to resource1.resx, and the original Microsoft. cr. core. resx
2. the initialization sequence of two static variables in Dispatcher. CS is incorrect. Put traceswitchcore statements and initialization statements at the top of the file.

Sample Code. For the sake of uniformity, I choseCode.
Decompress the sample code, use vs to create a ccrdemo project, add the decompressed code to the ccrdemo project, and then add the decompiled source code project to the solution, add a reference to the ccrdemo. If you can compile and run the ccrdemo, it indicates that our analysis environment has been built.

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.