Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
834 views
in Technique[技术] by (71.8m points)

c# - How can I extract images from the .resources file created by a decompile of a .NET assembly?

I am working on recovering the source for an application for a client of mine. I have managed to recover the application code using .NET Reflector. But now I want to neaten the code and recreate the individual forms so will that I have the codebehind, designer and resx files for each form. The problem is that all the images are located in ".resources" files. How do I extract the images from these ".resources" files that were generated by Reflector?

I would prefer to use some tool, rather than having to extract the images programmatically, but I will resort to code if I can't find a suitable application. So here I am hoping that someone has done this before or knows of a viewer (preferably free!) for these resources files that would allow me to extract the images. Otherwise, code is also good; as I could then write my own little application to extract the images.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

You can save the .resources file and then use the resgen tool (part of the VS2010 tools) to convert it back into a .resx file, using a command line like:

resgen foo.resources bar.resx

The .resx can then be added to a C# project. Once you've done this, if you try to open the individual images, VS2010 will offer to extract them into a standalone image file.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...