Sponsored by: â Sparkhost - Hosting Without Compromises! â Hybrid Performance Web Hosting â Spark Host Stream Hosting â Hybrid IRC & IRCd Server Shell Accounts
Ripping ICON from PE executable
#1
Posted 07 January 2009 - 01:11 PM
So I started learning PE file structure in hopes that I can extract it using PE editor and hex editor.
IS that possble?
I am asking because I donīt wanna waste my time if this isnīt possible.
I know ICON is in .rsrc section area (optional header) and IMAGE_DIRECTORY_ENTRY_RESOURCE 2.
In PE header there is also tiny area called .rsrc, isnīt value there starting offset of resource area?
PE editor lets me choose to copy ALL data from .rsrc area into file.
There is much cĪ%p in it. but if I am correct icon should be somewhere there, right?
How would I identify icon data from all that area? any clues/hints, GREAT links on this matter?
thanx
#2
Posted 07 January 2009 - 01:41 PM
It also gave "RVA to data" and Size of that icon, also name entries and ID entries.
Anything I can do with that info while pinpointing icon in file?
I tried to calculate end of icon: RVA to data +/- Size but noo.
RVA to data to data IS starting offset?
Should I do this calculation instead: VA (or base image) - RVA to data and after that RVA to data + Size = end of icon?
#3
Posted 07 January 2009 - 03:09 PM
such as:
http://www.wilsonc.d...ourceeditor.htm
might be far more easier than extracting the ICON from the exe by hand, even if it is possible.
Also if you're into programming, you may use the dedicated OS functions for that such as ExtractIcon and ExtractIconEx
http://msdn.microsoft.com/en-us/library/ms648068(VS.85).aspx
Once you have the handle on the icon, there are a few ways to copy the structure on disk.
Quidquid latine dictum sit, altum sonatur.
#4
Posted 07 January 2009 - 03:33 PM
what about a simple PE resource editor
such as:
http://www.wilsonc.d...ourceeditor.htm
might be far more easier than extracting the ICON from the exe by hand, even if it is possible.
Also if you're into programming, you may use the dedicated OS functions for that such as ExtractIcon and ExtractIconEx
http://msdn.microsoft.com/en-us/library/ms648068(VS.85).aspx
Once you have the handle on the icon, there are a few ways to copy the structure on disk.
I tried ExtractIconEx but Iīm not at that level in c++ yet.
And I donīt wanna use editor which automatically rips icon and saves on disk because I want to learn to do it myself. And I suspect that d10resourceeditor does just that.
So that proves itīs possible. good.
#5
Posted 07 January 2009 - 04:27 PM
Quidquid latine dictum sit, altum sonatur.
#7
Posted 09 January 2009 - 02:59 AM
Yep, I found that but before I checked any source/demo..
I managed on my own.
Magic was to add ONLY bitmapheader 1st into a new ,blank, file and then add icon data from .exe, nothing else => bitmap file. in .exe bitmap started in resource directory directly from bitmapinfoheader skipping main header.
Of course there must be that too somewhere.
With this goofing I learned to understand a lot about .exe/dll structure and the stuff which is showing on hex editor view.
#8 Guest_Dennis_*
Posted 09 January 2009 - 11:58 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users












