My Project  + 80db3
Classes | Public Types | Static Public Member Functions | List of all members
loader::exe_reader Class Reference

Minimal NE/LE/PE parser that can find resources by ID in binary (exe/dll) files. More...

#include "loader/exereader.hpp"

Classes

struct  resource
 Position and size of a resource entry. More...
 

Public Types

enum  resource_id {
  NameVersionInfo = 1, TypeCursor = 1, TypeBitmap = 2, TypeIcon = 3,
  TypeMenu = 4, TypeDialog = 5, TypeString = 6, TypeFontDir = 7,
  TypeFont = 8, TypeAccelerator = 9, TypeData = 10, TypeMessageTable = 11,
  TypeGroupCursor = 12, TypeGroupIcon = 14, TypeVersion = 16, TypeDlgInclude = 17,
  TypePlugPlay = 19, TypeVXD = 20, TypeAniCursor = 21, TypeAniIcon = 22,
  TypeHTML = 23, Default = boost::uint32_t(-1)
}
 
enum  file_version { FileVersionUnknown = boost::uint64_t(-1) }
 

Static Public Member Functions

static resource find_resource (std::istream &is, boost::uint32_t name, boost::uint32_t type=TypeData, boost::uint32_t language=Default)
 Find where a resource with a given ID is stored in a NE or PE binary. More...
 
static boost::uint64_t get_file_version (std::istream &is)
 Get the file version number of a NE, LE or PE binary. More...
 

Detailed Description

Minimal NE/LE/PE parser that can find resources by ID in binary (exe/dll) files.

This implementation is optimized to look for exactly one resource.

Definition at line 40 of file exereader.hpp.

Member Enumeration Documentation

◆ resource_id

Enumerator
NameVersionInfo 
TypeCursor 
TypeBitmap 
TypeIcon 
TypeMenu 
TypeDialog 
TypeString 
TypeFontDir 
TypeFont 
TypeAccelerator 
TypeData 
TypeMessageTable 
TypeGroupCursor 
TypeGroupIcon 
TypeVersion 
TypeDlgInclude 
TypePlugPlay 
TypeVXD 
TypeAniCursor 
TypeAniIcon 
TypeHTML 
Default 

Definition at line 56 of file exereader.hpp.

◆ file_version

Enumerator
FileVersionUnknown 

Definition at line 97 of file exereader.hpp.

Member Function Documentation

◆ find_resource()

exe_reader::resource loader::exe_reader::find_resource ( std::istream &  is,
boost::uint32_t  name,
boost::uint32_t  type = TypeData,
boost::uint32_t  language = Default 
)
static

Find where a resource with a given ID is stored in a NE or PE binary.

Resources are addressed using a (name, type, language) tuple.

Parameters
isa seekable stream of the binary containing the resource
namethe user-defined name of the resource
typethe type of the resource
languagethe localised variant of the resource
Returns
the location of the resource or (0, 0) if the requested resource does not exist.

Definition at line 481 of file exereader.cpp.

◆ get_file_version()

boost::uint64_t loader::exe_reader::get_file_version ( std::istream &  is)
static

Get the file version number of a NE, LE or PE binary.

Parameters
isa seekable stream of the binary file containing the resource
Returns
the file version number or FileVersionUnknown.

Definition at line 498 of file exereader.cpp.


The documentation for this class was generated from the following files: