The MASM Forum Archive 2004 to 2012

General Forums => The Campus => Topic started by: Vortex on December 23, 2004, 07:40:54 PM

Title: Resource decompiler
Post by: Vortex on December 23, 2004, 07:40:54 PM
Does anyone knows a command line tool decompiling .res ( resource) files?

Title: Re: Resource decompiler
Post by: dsouza123 on December 26, 2004, 06:11:57 PM
ResHacker has command line options,
the last version, 3.4.0, can work with .res files.

From the GUI using a .res file it can saveout the .rc and .ico files,
there may be some command line options that do the same.
Title: Re: Resource decompiler
Post by: pbrennick on December 27, 2004, 02:19:35 AM
Vortex,
ResHacker.exe is definitely the way to go, I use it at the commandline level all the time.  The help file shows you how to use the commandline options or how to create a script file that will execute multiple commands.  I never bothered with the script file method, maybe I should have.  Anyway the following batch file is one I used to use, it gets all the resources out of a .res file, now I use %file% so I can pass the filename and the batch becomes generic if you know what I mean.  I am showing the old method for the sake of clarity.

QuoteResHacker.exe -extract GeneSys.res, GeneSyS.rc,  Bitmap,,
ResHacker.exe -extract GeneSys.res, temp.rc,  Icon,,
type temp.rc >>GeneSys.rc
ResHacker.exe -extract GeneSys.res, temp.rc,  Dialog,,
type temp.rc >>GeneSys.rc
ResHacker.exe -extract GeneSys.res, temp.rc,  Menu,,
type temp.rc >>GeneSys.rc
ResHacker.exe -extract GeneSys.res, temp.rc,  StringTable,,
type temp.rc >>GeneSys.rc
ResHacker.exe -extract GeneSys.res, temp.rc,  Accelerators,,
type temp.rc >>GeneSys.rc
ResHacker.exe -extract GeneSys.res, temp.rc,  VersionInfo,,
type temp.rc >>GeneSys.rc
del temp.rc

The way I use it now is:

Quote@echo off
set file="GeneSys"

if exist %file%.rc del %file%.rc

ResHacker.exe -extract %file%.res, %file%.rc,  Bitmap,,
ResHacker.exe -extract %file%.res, temp.rc,  Icon,,
type temp.rc >>%file%.rc
ResHacker.exe -extract %file%.res, temp.rc,  Dialog,,
type temp.rc >>%file%.rc
ResHacker.exe -extract %file%.res, temp.rc,  Menu,,
type temp.rc >>%file%.rc
ResHacker.exe -extract %file%.res, temp.rc,  StringTable,,
type temp.rc >>%file%.rc
ResHacker.exe -extract %file%.res, temp.rc,  Accelerators,,
type temp.rc >>%file%.rc
ResHacker.exe -extract %file%.res, temp.rc,  VersionInfo,,
type temp.rc >>%file%.rc
del temp.rc

I save it as extract.bat and a commandline usage: extract GeneSys will extract all the resources from GeneSys.res

Have fun,
Paul

Title: Re: Resource decompiler
Post by: Vortex on December 27, 2004, 10:45:29 AM
dsouza123 , pbrennick,

Many thanks for the technical information  :U