Extract icon and bitmap from Borland C++/Delphi .exe

just write whatever you want
Post Reply
dcsoft
Posts: 380
Joined: Sat Dec 11, 2004 2:11 am
Location: San Francisco Bay Area, CA USA
Contact:

Extract icon and bitmap from Borland C++/Delphi .exe

Post by dcsoft »

Hello, since there are so many Borland users here, does anyone know how to use the Borland tools to extract an icon and/or bitmap from a .exe compiled with Borland C++ or Delphi? Apparently the Borland tools don't place bitmaps and icons in the standard Windows resources. However, I can load the .exe into Notepad and see strings like "TBitmap", "TIcon", "TBitmapImage", "TIconImage", etc.

I have successfully written a utility to extract JPEG images from the .exe by searching for "TJPEGImage", reading the 4 byte size, then writing that many bytes to the disk file. But the TBitmap, TIcon, etc. don't seem to follow this format. Perhaps they point to the offset where the actual graphic bits are stored?

Microsoft Visual C++ lets you open the .exe as "Resources" and it will show you all the resources, including icons, bitmaps, strings, etc. in it. I've downloaded the Borland C++ 6.0 eval. Does it have this capability?

Thanks,
David
madshi
Site Admin
Posts: 10764
Joined: Sun Mar 21, 2004 5:25 pm

Post by madshi »

You can use the freeware tool "Resource Hacker" to browse the resource section of an exe. I think the TIcon and TBitmap contents are stored in the resource section, too, but not as icons/bitmaps, but instead as part of the DFMs, which you'll find in the resource section under "RCData".
dcsoft
Posts: 380
Joined: Sat Dec 11, 2004 2:11 am
Location: San Francisco Bay Area, CA USA
Contact:

Post by dcsoft »

madshi wrote:You can use the freeware tool "Resource Hacker" to browse the resource section of an exe. I think the TIcon and TBitmap contents are stored in the resource section, too, but not as icons/bitmaps, but instead as part of the DFMs, which you'll find in the resource section under "RCData".
Thanks Madshi, this is a great tool. It decompiled the .exe to show me the bitmap I wanted was in a TImageList. I looked for the "BM" to indicate the start of the bitmap. Unfortunately Resource Hacker doesn't export sections of the decompiled output to a file. But I did so with Visual C++. Between the two, I was able to figure out what the image was!

Cheers,
David
Post Reply