When we use reflector to view the source code
Resource files are in the resources format.
Cannot be used directly in. net
Although the Code is obtained, the image cannot be restored.
Still chores
In fact, it is very easy to get the content in the resource file.
Ms provides resourcereader and resourcewriter as well as resxresourcereader and resxresourcewriter.
We can use these classes to convert resources and resx formats.
Suppose we have a resource file in the resources format.
Write the following code:
Resourcereader RR = new resourcereader (inputresources); <br/> string S = ""; <br/> byte [] B; <br/> RR. getresourcedata ("key", out S, out B); <br/> RR. close ();
Inputresources is the resource file to be read.
The returned S is type, and B is the data in the resource file.
The key can be obtained from the decompiled code.
If we write the obtained data to the resx file
Resxresourcewriter rrw = new resxresourcewriter (outputresx); <br/> rrw. addmetadata ("key", B); <br/> rrw. generate (); <br/> rrw. close ();
Outputresx is a generated resource file in resx format.
Now, you can use the text editor to open the generated outputresx.
You can see the value in it.
In this way, you can recreate a resource file.
Then copy the value to use it.