Hi,

I',m making a change to ResEdit so it will extract all resources
from binary files, not just dialogs.

I thought before I put the changes in ResEdit and probably screw
it up I would write a sample program to test the routines.

I think the only resources I have not done so far is RCDATA and Font.

ExtractRsrc will also display Cursors, Icons, Grp Cursors, Grp Icons,
and Bitmaps images.

You can right click on the image to save it or close it.

Let me know how it works and if it runs clean I will put the routines
in ResEdit.

I fixed the Version resource bug that Pone had,
plus I added some used friendly features and
check guards.

Now you can open a file as hex, update it and
save it to it's orignal format.

Fixed a bug if the an image color count is 256.

Now checking for MENUEX type menus.

Fixed some misc bugs for some wierd types of resources.
Plus the program now checks for compressed files.

Fixed Silas first bug, still need his VB pgm to
test his second bug.

You can now extract message tables if they are not Unicode,
I need a pgm with a Unicode message table to test with.

You can now extract message tables if they are non Unicode
or Unicode.

You can now extract, display, and save
gif, jpg, wmf, and emf type resources from PE and res files.

You can now extract, display, and save animated
Icons and Cursors.

Fixed Silas VB PE bug and any other file
that has strange alignments for image groups.

Fixed the bug if you are extracting resources
from non english PE files.
Plus you can now extract, display, and save
AVI resources.

Fixed the bug for saving some types of images.

There is a Images.exe included in the zip
that has several types of images.
I'm including the source with this zip.

Thanks,

Ewayne

Previous downloads (398)
Posted on 2002-11-19 16:42:54 by Ewayne
Hi Ewayne,

Great idea !!

Works on WinME. (FYI-there was one time when I clicked on an icon and it displayed properly in the right window..then instead of right-clicking, I chose 'Save' from the file menu and the 'Save File' requester appeared with my icon showing on top of it. I could not duplicate this again after I saw it happen...I'll try later when I'm not so tired and sleepy and brain-dead!!)
Posted on 2002-11-20 07:57:01 by gscundiff
The version section generated a fault when exploring the left pane of an exe file.

It dropped down to a "01", when I click it, is when I got the fault.

Regards, P1

Here's the .rc file, if it might help.

#include "\masm32\include\resource.h"

1 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "Main.ICO"

// Do NOT use dashes in FileName!
FontFile BINFILE SOMEFONT.TTF


// Version stamp for this .EXE

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEFLAGS (VS_FF_PRERELEASE | VS_FF_DEBUG)
FILEOS VOS__WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x0409, 1252
END
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904E4"
BEGIN
VALUE "CompanyName", "My Corporation\0"
VALUE "FileDescription", "Font File Installer.\0"
VALUE "FileVersion", "1.0.0.0\0"
VALUE "InternalName", "MY-Font.EXE\0"
VALUE "LegalCopyright", "Copyright ? Me 2002, All Rights Reserved.\0"
VALUE "LegalTrademarks", "None.\0"
VALUE "OriginalFilename", "My-Font.EXE\0"
VALUE "ProductName", "Font File Installer.\0"
VALUE "ProductVersion", "1.0.0.0\0"
END
END
END
Posted on 2002-11-20 08:42:58 by Pone
To gscundiff:

I did not put any whistles, bells or make sure the
user did the right thing type stuff in the sample
program.

You are suppose to use the right mouse button to
save an image.:)

Probably what happened is when you display an Icon,
Cursor, or Bitmap there is no text in the edit
window so the SaveFile dialog will not open, but
if you display a Group Icon or Group Cursor there
will be text in the edit window so the SaveFile
dialog will open and I think the image is topmost
so the image will appear on top of the dialog box
and the only thing it would save is the text in
the edit window.

If anyone thinks the sample program would be worth
having as a tool I will change the program to be
more user friendly.

Thanks,

Ewayne
Posted on 2002-11-20 08:47:50 by Ewayne
To Pone:

Thanks for the feedback.

I could only find two programs with Versions in
them to test on.

I was afraid that there would be some programs
out there with Versions that it might not work
with.

I would like to meet the person(s) that designed
the Version and it's assocated structures and
give them a piece of my mind.

They are harder to untangle then dialogs.

It looks like where it got confused is that the
VarFileInfo is before the StringFileInfo and the
documentation that I have says you can not do that.

That's what's nice about some of the MS's docs
they are wrong sometimes and not right sometimes.

I will see if I can fix that.

Ewayne
Posted on 2002-11-20 09:10:02 by Ewayne

That's what's nice about some of the MS's docs they are wrong sometimes and not right sometimes.


:) ;) :grin:
Posted on 2002-11-20 16:41:42 by gscundiff
To Pone and the rest,

I fixed the Version resource bug, you can now
have the VarFileInfo at the beginning or the end.

Question:
I don't know very much about Version resources
(As a matter of fact there is a lot I don't know about).

Anyhow can you have more then one VarFileInfo and
StringFileInfo groups?

Does the \0" mean zero termination?

I made some other changes to ExtractRsrc:

Made it more user friendly.

Now you can open a file as hex, update it and
save it to it's orignal format.

You can go to the first post on this thread for
the update.

Thanks,

Ewayne
Posted on 2002-11-21 09:35:05 by Ewayne
Thanks, P1
Posted on 2002-11-21 11:53:08 by Pone
Hi,

roticv pointed out a bug if an image color count
is 256.

I fixed that.

You can go to the first post on this thread for
the update.

Thanks,

Ewayne
Posted on 2002-11-22 11:49:08 by Ewayne
If i am not wrong, /0 means null terminated in c and c++.

Ewayne, now your program display the verison information prefectly. I tested out on a couple of the M$ dlls, and the infomation should be correct.
Posted on 2002-11-24 07:54:21 by roticv
oh ya...

Just a minor bug, the dialog ID of the dumped resource is wrong. It should not be 0, should be the ID.
Posted on 2002-11-24 09:13:11 by roticv
To roticv:

The ID's for the dialogs used to be there and one
of the changes I made removed them, but they are
back again.

Plus fixed a bug when displaying the text about
certain types of group Icons.

You can go to the first post on this thread for
the update.

Thanks,

Ewayne
Posted on 2002-11-24 13:15:19 by Ewayne
Hi,

I forgot to check for MENUEX type menus.

You can go to the first post on this thread for
the update.

Thanks,

Ewayne
Posted on 2002-11-25 22:39:51 by Ewayne
Hi,

I fixed some misc bugs for some wierd types of resources.
Plus the program now checks for compressed files.

I think I'm about ready to put the routines in ResEdit for AsmEdit.

You can go to the first post on this thread for
the update.

Thanks,

Ewayne
Posted on 2002-11-29 00:19:59 by Ewayne
Hi Ewayne,

If any bug is found, I will keep you informed. Currently I found no bugs :grin:. Oh ya... I was hoping to see support for messagetable.
Posted on 2002-11-29 07:55:46 by roticv
Hi roticv,

Send me a file with a message table and I will
see what I can do.

Ewayne
Posted on 2002-11-29 10:03:01 by Ewayne
Hi Ewayne,

Have a look at user32.dll and kernel32.dll. Good examples of program that use message table resoruces. :grin:
Posted on 2002-11-29 10:18:17 by roticv
To roticv:

I was afraid you would find one.

Thanks !! :(

Ewayne
Posted on 2002-11-29 10:38:25 by Ewayne
hahah.. I found out that they hd messagetable some time ago while messing with your program :grin: Soon all the resources would be covered.. that would be nice.
Posted on 2002-11-29 10:45:53 by roticv
I've found some bugs... In the interface, if I extract from a file, extract another and cancel to come back to the first, it crashes. Also, I can't extract a vb program I made as it crashes too. I just downloaded it so it must be the updated version I used.

Other than that, it's great!!
Posted on 2002-11-29 11:20:23 by Silas