Windows PE binary resource loader (exe/dll/ocx)

Post those lines of code you feel like sharing or find what you require for your project here; or simply use them as tutorials.
Post Reply
bitplane
Admin
Posts: 3204
Joined: Mon Mar 28, 2005 3:45 am
Location: England
Contact:

Windows PE binary resource loader (exe/dll/ocx)

Post by bitplane »

This archive loader can be used to read resources from Windows PE and PE32+ binaries. This is useful for extracting icons and other data from exe and DLL files in a cross platform way, or perhaps it isn't. I don't really have a use for it, but it was fun to write!

doc: http://svn.bitplane.net/misc/trunk/irr/ ... readme.txt

code: http://svn.bitplane.net/misc/trunk/irr/ ... ders/RSRC/

example of use

Code: Select all

/*

  The following code shows how to load a bitmap from one of the standard 
  executables that comes with Windows XP/2k/Vista and display it in the GUI.

*/

  // create an instance of the loader and add it to the filesystem
  io::CArchiveLoaderRes* resLoader = new io::CArchiveLoaderRes(fs);
  fs->addArchiveLoader(resLoader);

  // We created it with new, so we must drop() when finished with it.
  resLoader->drop(); 

  // Now we can add an executable to the filesystem as an archive.
  // By default we ignore the paths which may ge
  fs->addFileArchive("c:\\windows\\system32\\inetcpl.cpl"); 

  // now let's extract a bitmap and add it to the GUI
  guienv->addImage(driver->getTexture("4474.bmp"), core::vector2di(0,0));
Enjoy! :D
Submit bugs/patches to the tracker!
Need help right now? Visit the chat room
MasterM
Posts: 128
Joined: Sat Oct 20, 2007 2:38 am
Location: netherlands antilles, Curacao

Post by MasterM »

This is going straight to my code library...
and its well commented also :D
C++ is not the Magdalena...it takes patience...shes like the well aged prostitute, it takes years to learn her tricks! she is cruel...laughs at you when you are naked...
Life of a programmer == Const abuse
Yoran
Site Admin
Posts: 96
Joined: Fri Oct 07, 2005 8:55 am
Location: The Netherlands
Contact:

Post by Yoran »

Very nice code bitplane, haven't thought of a use as of yet :)
Midnight
Posts: 1772
Joined: Fri Jul 02, 2004 2:37 pm
Location: Wonderland

Post by Midnight »

Very nice bits. I find educational value in this.
Post Reply