News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

Resource decompiler

Started by Vortex, December 23, 2004, 07:40:54 PM

Previous topic - Next topic

Vortex

Does anyone knows a command line tool decompiling .res ( resource) files?


dsouza123

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.

pbrennick

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


Vortex

dsouza123 , pbrennick,

Many thanks for the technical information  :U