Related information:
. Net reflector an excellent decompilation tool: http://shy-feng.blog007.com/archives/2008916173215.aspx
The following text is from
From: http://blog.tripdev.com /? Tid = 81
Recycltor is not introduced. It is a free decompilation tool under. net. In some cases, the reconfigurator is necessary. When encountering a bug, you can use the reconfigurator to view its internal implementation mechanism to find the real bug. Alternatively, you can use the reflactor to view the private generation and call it with reflection.
All of the above are intended for legitimate purposes, and sometimes it can be used to decompile others' software. I don't care about obfuscated software. Here we will talk about the decompilation of software without obfuscation and encryption. The export in the right-click menu of reflector can be decompiled, as shown in.
Decompilation files are stored in my documents/reflector/disassembler by default. However, this decompilation has some problems and cannot be decompiled for winform resource files. This requires us to find another method.
After my unremitting efforts, I found a plug-in file dessassemble, which can implement this function.
After decompiling, You can edit the file after opening it with visual sutio, but sometimes there are some problems. The following is a summary.
1. There is no compilation problem. An exception occurs when running the "type Initial Value Setting item"
This mainly uses two static variables in the class, and the initialization dependency of a static variable makes a static variable, and the dependent static variables are placed before the dependent variables, for example, the following code will have such a problem.
Code
1 Private Static string settingfilename = path. Combine (settingfolderpath, @ "googlemusicdesktop/config. xml ");
2 public static string settingfolderpath = path. Combine (environment. getfolderpath (environment. specialfolder. Personal), "aaasoft ");
The problem is well solved.
2. Resource files and fragments cannot be found.
In this case, it is generally the same as the name of the resource file. If you keep the name of the resource file and keep the class, re-compiling will solve the problem. Note that you need to re-generate it, otherwise it will not be easy.
3. An error occurred while opening the form.
I have solved this problem through searching. There is an article in the garden, and I will turn it over. Repost
Use reflector and filedisassembler to decompile. Net Windows programs
URL: http://www.cnblogs.com/verygis/archive/2008/12/02/1346072.html
A problem occurs when using filedisassembler to decompile windows application. The resx resource file does not match the CS file. The project compilation does not work. After modifying the resx file to the CS folder
Problem, but you cannot directly modify the control "Visually" in the form design. This is troublesome, but not intuitive. You should modify the source code so that it conforms to the source file layout of vs2008.
The following describes the modification steps:
1. since filedisassembler generates a directory for each namespace and stores the source code of the space, the resource resx file is directly added to the project directory, and all resources should be put back to the source directory. for example
For tryassemb. form1.resx in the project folder, change it to form1.resx and move it to the tryassemb directory.
2. Open the "view designer" on the form and you will find the following error:
The modification method is for all systems. windows. forms. the control in the namespace must be declared in the full namespace, such as the base in the namespace. autoscalemode = autoscalemode. font; it should be changed to base. autoscalemode = system. windows. forms. autoscalemode. font; and textbox textbox1; should also be changed to private system. windows. forms. textbox textbox1; then vs2008 can recognize that this control is to be drawn on the form.
PS. At the beginning, I thought I was about to split form1 into form1.cs and form1.designer. CS like vs. Every time I had to work hard to split it, I finally found that it was not needed at all, ^ _ ^.
I believe that most. Net programmers have experience using recycltor. For whatever purpose, if you want to modify the code after decompiling the hosting program with the recycltor, the list in this article may be a useful reference.
After decompiling the code using the filegenerator plug-in of recycltor, you can obtain the source code including the project file. However, there are various problems in the Code and it is generally not possible to compile the code at a time. The following will discuss these issues in detail:
Enumeration problems
For code readability, it may take some time to check metadata to modify the int value back to the enumerated value. In particular, if you want to use the Form Designer, vs2008 may not understand the int value.
Attribute Problems
For example, after a property called names is decompiled, it may be restored to the set_names (names) and get_names () methods, which may be slow to replace one by one. You can replace it with a regular expression.
The set_xxx (XXX) method can be replaced.
Set _ {[A-Z] *}/(
Is
/1 = (
The get_xxx () method can be replaced.
Get _ {[A-Z] *}/(/)
Is
/1
Then, fix the incorrect methods.
Delegation and callback Functions
It is generally restored to the add_xxx (methodsname) method, and needs to be changed to + = methodsname
Resource problems
Use the resgen.exe tool under the. NET Framework SDK to decompile and embed the *. Resources file into the *. resx file,
Syntax: resgen.exe *. resources *. resx, and then set *. if resx is included in the project, it will automatically file with the same name as the form file *. CS Association. If there is no association, You can first exclude it and then add the big method.
Namespace Problems
If you want to switch to the IDE Form Designer without errors, you also need to add a namespace prefix such as system. Windows. Forms in *. CS.
Form Designer recognition problems
The following code is required:
Componentresourcemanager manager = new componentresourcemanager (typeof (classname ));
Replace
System. componentmodel. componentresourcemanager resources = new system. componentmodel. componentresourcemanager (typeof (classname ));
The Form Designer can be recognized normally.
FM: http://blog.csdn.net/ma_ta/archive/2008/12/11/3497532.aspx