Click here to Skip to main content
14,573,367 members


Rate this:
4.91 (67 votes)
Please Sign up or sign in to vote.
4.91 (67 votes)
6 Jun 2005
This article explains how to enumerate all the objects in a Portable Executable and manipulate them.



Inspired by the ResourceHacker from Angus Johnson, I decided to make one of my own. ExeScanner, as the name suggests, can scan an executable file and enumerate all the objects in its resource section. The next version will have two main features:

  1. Resource scripting engine which can compile/decompile resources.
  2. Enumerate other sections of an executable file besides the resource section.

What does ExeScanner do?

ExeScanner allows you to view bitmaps, cursors, icons, strings, dialogs, menus and binary resources in any executable file. Any other resources except the first 6 are shown as the binary resources. Each resource type can be imported or exported. Import facility allows modifying the resources within the executable file with an external file, while export facility allows to extract and save the resources as a file. Dialogs and menus are exceptions to the import/export facility (as they require the resource scripting engine which will be a part of ExeScanner 1.1).

ExeScanner Design Overview (Class Hierarchy)

ExeScanner has been designed keeping in mind the future extensions and generalization of the project. With class hierarchy I have tried to incorporate a symmetric behavior in each object although they might be very different.

There are two base classes PEBase and PEResource. Any object in a PE file should always inherit from PEBase. If it's a resource object, it should inherit from PEResource. In fact, PEResource also inherits from PEBase. These base classes have some methods and members which make its representation and manipulation standardized and reduces code by implementing polymorphic behavior.

Let's have a look at a few classes and what they do:

  • PortableExecutable - Encapsulates DOS and Windows header. Also holds ResourceSection.
  • ResourceSection - Encapsulates ResourceSectionHeader and holds ResourceBranch.
  • ResourceBranch - Each branch represents a broad category of resources like BITMAP, ICON, STRING, BINARY etc. Also holds ResourceNode.
  • ResourceNode - ResourceNode can hold exactly one resource of any category, i.e., there can be multiple bitmaps in BITMAP category and thus multiple ResourceNode in ResourceBranch with each ResourceNode holding PEResBitmap.
  • PEResBitmap - Bitmap object.
  • PEResIcon - Icon object.
  • PEResCursor - Cursor object.
  • PEResString - String object.
  • PEResMenu - Menu object.
  • PEResBinary - Binary object.
  • PEResDialog - Dialog object.

Above mentioned seven classes encapsulate the logic to display themselves, import, export, and then when requested, give property info.

  • PEFile - Encapsulates the I/O to the executable file being scanned. Provides the facility to directly read/write by specifying the offset from the beginning.
  • PEListTree - It's a doubly linked list that stores each PE object, primarily used for creating navigation tree.

Hope you enjoy using the application. And would welcome your comments/suggestions on how to make it better.


  • ExeScanner 1.0 - Initial release.


This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


About the Author

Vishalsinh Jhala
Web Developer
United States United States
No Biography provided

Comments and Discussions

Questiondis is excellent but dere's smthing i want 2 know Pin
MathurBharat1117-Dec-08 3:16
MemberMathurBharat1117-Dec-08 3:16 
GeneralExcellent job !!! Pin
CastorTiu18-Oct-06 8:46
MemberCastorTiu18-Oct-06 8:46 
GeneralA bug Pin
H.B.Shen11-Apr-06 3:00
MemberH.B.Shen11-Apr-06 3:00 
QuestionPE Graphical Area Access? Pin
IslamianFalcon24-Nov-05 20:06
MemberIslamianFalcon24-Nov-05 20:06 
GeneralExcellent work Pin
Member 108697012-Sep-05 23:55
MemberMember 108697012-Sep-05 23:55 
GeneralNice Work Pin
BitsAndBytes21-Jun-05 22:21
MemberBitsAndBytes21-Jun-05 22:21 
GeneralNice Pin
ThatsAlok21-Jun-05 18:45
MemberThatsAlok21-Jun-05 18:45 
Generalmfc70.dll Pin
Lee Middle10-Jun-05 15:48
MemberLee Middle10-Jun-05 15:48 
GeneralRe: mfc70.dll Pin
Arie Levy21-Oct-09 0:20
MemberArie Levy21-Oct-09 0:20 
GeneralGreat! Pin
CharlieLei9-Jun-05 15:16
MemberCharlieLei9-Jun-05 15:16 
GeneralPhoto scan Pin
Armen Hakobyan9-Jun-05 1:21
professionalArmen Hakobyan9-Jun-05 1:21 
Questionwhich ceil()? Pin
Huisheng Chen8-Jun-05 16:01
MemberHuisheng Chen8-Jun-05 16:01 
AnswerRe: which ceil()? Pin
Christian Graus8-Jun-05 16:27
mveChristian Graus8-Jun-05 16:27 
AnswerRe: which ceil()? Pin
rkh07916-Jun-05 8:54
Memberrkh07916-Jun-05 8:54 
Generalnice work. Pin
bevpet7-Jun-05 10:19
Memberbevpet7-Jun-05 10:19 
Questionwhy not just use visual studio? Pin
yafan7-Jun-05 3:25
Memberyafan7-Jun-05 3:25 
AnswerRe: why not just use visual studio? Pin
Tom Archer7-Jun-05 16:59
MemberTom Archer7-Jun-05 16:59 
AnswerRe: why not just use visual studio? Pin
Vishalsinh Jhala7-Jun-05 18:29
MemberVishalsinh Jhala7-Jun-05 18:29 
GeneralRe: why not just use visual studio? Pin
TheGreatAndPowerfulOz8-Jun-05 7:23
MemberTheGreatAndPowerfulOz8-Jun-05 7:23 
GeneralRe: why not just use visual studio? Pin
John M. Drescher9-Jun-05 3:34
MemberJohn M. Drescher9-Jun-05 3:34 
GeneralRe: why not just use visual studio? Pin
TheGreatAndPowerfulOz10-Jun-05 6:48
MemberTheGreatAndPowerfulOz10-Jun-05 6:48 
GeneralRe: why not just use visual studio? Pin
Vishalsinh Jhala13-Jun-05 1:50
MemberVishalsinh Jhala13-Jun-05 1:50 
GeneralRe: why not just use visual studio? Pin
TheGreatAndPowerfulOz16-Jun-05 8:35
MemberTheGreatAndPowerfulOz16-Jun-05 8:35 
AnswerRe: why not just use visual studio? Pin
Super Lloyd14-Jun-05 12:58
MemberSuper Lloyd14-Jun-05 12:58 
GeneralRe: why not just use visual studio? Pin
Super Lloyd14-Jun-05 13:00
MemberSuper Lloyd14-Jun-05 13:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Posted 6 Jun 2005


101 bookmarked