LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::PE::ResourceDirectory Class Reference

#include <ResourceDirectory.hpp>

Inheritance diagram for LIEF::PE::ResourceDirectory:
Collaboration diagram for LIEF::PE::ResourceDirectory:

Public Member Functions

 ResourceDirectory ()
 ResourceDirectory (uint32_t id)
 ResourceDirectory (const details::pe_resource_directory_table &header)
 ResourceDirectory (const ResourceDirectory &other)=default
ResourceDirectoryoperator= (const ResourceDirectory &other)=default
void swap (ResourceDirectory &other) noexcept
 ~ResourceDirectory () override=default
std::unique_ptr< ResourceNodeclone () const override
uint32_t characteristics () const
 Resource characteristics. This field is reserved for future use. It is currently set to zero.
uint32_t time_date_stamp () const
 The time that the resource data was created by the resource compiler.
uint16_t major_version () const
 The major version number, set by the user.
uint16_t minor_version () const
 The minor version number, set by the user.
uint16_t numberof_name_entries () const
 The number of directory entries immediately following the table that use strings to identify Type, Name, or Language entries (depending on the level of the table).
uint16_t numberof_id_entries () const
 The number of directory entries immediately following the Name entries that use numeric IDs for Type, Name, or Language entries.
void characteristics (uint32_t characteristics)
void time_date_stamp (uint32_t time_date_stamp)
void major_version (uint16_t major_version)
void minor_version (uint16_t minor_version)
void numberof_name_entries (uint16_t numberof_name_entries)
void numberof_id_entries (uint16_t numberof_id_entries)
void accept (Visitor &visitor) const override
Public Member Functions inherited from LIEF::PE::ResourceNode
 ResourceNode (const ResourceNode &other)
ResourceNodeoperator= (const ResourceNode &other)
 ResourceNode (ResourceNode &&other)=default
ResourceNodeoperator= (ResourceNode &&other)=default
void swap (ResourceNode &other)
 ~ResourceNode () override
uint32_t id () const
 Integer that identifies the Type, Name, or Language ID of the entry depending on its depth in the tree.
const std::u16string & name () const
 Name of the entry (if any).
std::string utf8_name () const
 UTF-8 representation of the name().
it_childs childs ()
 Iterator on node's children.
it_const_childs childs () const
bool has_name () const
 True if the entry uses a name as ID
uint32_t depth () const
 Current depth of the Node in the resource tree.
bool is_directory () const
 True if the current entry is a ResourceDirectory.
bool is_data () const
 True if the current entry is a ResourceData.
void id (uint32_t id)
void name (const std::string &name)
void name (std::u16string name)
ResourceNodeadd_child (std::unique_ptr< ResourceNode > child)
 Add a new child to the current node, taking the ownership of the provided unique_ptr.
ResourceNodeadd_child (const ResourceNode &child)
 Add a new child to the current node.
void delete_child (uint32_t id)
 Delete the node with the given id.
void delete_child (const ResourceNode &node)
 Delete the given node from the node's children.
void accept (Visitor &visitor) const override
template<class T>
const Tcast () const
template<class T>
Tcast ()
std::string to_string () const
void push_child (std::unique_ptr< ResourceNode > node)
Public Member Functions inherited from LIEF::Object
 Object ()
 Object (const Object &other)
Objectoperator= (const Object &other)
 Object (Object &&other) noexcept=default
Objectoperator= (Object &&other) noexcept=default
template<class T>
output_t< T > as ()
template<class T>
output_const_t< T > as () const
virtual bool operator== (const Object &other) const
virtual bool operator!= (const Object &other) const
virtual ~Object ()

Static Public Member Functions

static bool classof (const ResourceNode *node)
Static Public Member Functions inherited from LIEF::PE::ResourceNode
static std::unique_ptr< ResourceNodeparse (BinaryStream &stream, uint64_t rva)
 Parse the resource tree from the provided BinaryStream stream and with the original RVA provided in the second parameter.
static std::unique_ptr< ResourceNodeparse (const uint8_t *buffer, size_t size, uint64_t rva)
 Parse the resource tree from the provided buffer referenced by a pointer and the size. The second parameter is the RVA where the resource is (or was) located.
static std::unique_ptr< ResourceNodeparse (const std::vector< uint8_t > &buffer, uint64_t rva)
 See doc from other parse functions.
static std::unique_ptr< ResourceNodeparse (span< const uint8_t > buffer, uint64_t rva)
 See doc from other parse functions.
static std::unique_ptr< ResourceNodeparse (BinaryStream &stream, const Binary &bin)

Additional Inherited Members

Public Types inherited from LIEF::PE::ResourceNode
enum class  TYPE { UNKNOWN = 0 , DATA , DIRECTORY }
 Enum that identifies the type of a node in the resource tree. More...
using childs_t = std::vector<std::unique_ptr<ResourceNode>>
using it_childs = ref_iterator<childs_t&, ResourceNode*>
using it_const_childs = const_ref_iterator<const childs_t&, ResourceNode*>
Public Types inherited from LIEF::Object
template<class T>
using output_t = add_pointer_t<decay_t<T>>
template<class T>
using output_const_t = add_pointer_t<add_const_t<decay_t<T>>>

Constructor & Destructor Documentation

◆ ResourceDirectory() [1/4]

LIEF::PE::ResourceDirectory::ResourceDirectory ( )
inline

◆ ResourceDirectory() [2/4]

LIEF::PE::ResourceDirectory::ResourceDirectory ( uint32_t id)
inline

◆ ResourceDirectory() [3/4]

LIEF::PE::ResourceDirectory::ResourceDirectory ( const details::pe_resource_directory_table & header)

◆ ResourceDirectory() [4/4]

LIEF::PE::ResourceDirectory::ResourceDirectory ( const ResourceDirectory & other)
default

References ResourceDirectory().

◆ ~ResourceDirectory()

LIEF::PE::ResourceDirectory::~ResourceDirectory ( )
overridedefault

Member Function Documentation

◆ accept()

void LIEF::PE::ResourceDirectory::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ characteristics() [1/2]

uint32_t LIEF::PE::ResourceDirectory::characteristics ( ) const
inline

Resource characteristics. This field is reserved for future use. It is currently set to zero.

Referenced by characteristics().

◆ characteristics() [2/2]

void LIEF::PE::ResourceDirectory::characteristics ( uint32_t characteristics)
inline

References characteristics().

◆ classof()

bool LIEF::PE::ResourceDirectory::classof ( const ResourceNode * node)
inlinestatic

◆ clone()

std::unique_ptr< ResourceNode > LIEF::PE::ResourceDirectory::clone ( ) const
inlineoverridevirtual

◆ major_version() [1/2]

uint16_t LIEF::PE::ResourceDirectory::major_version ( ) const
inline

The major version number, set by the user.

Referenced by major_version().

◆ major_version() [2/2]

void LIEF::PE::ResourceDirectory::major_version ( uint16_t major_version)
inline

References major_version().

◆ minor_version() [1/2]

uint16_t LIEF::PE::ResourceDirectory::minor_version ( ) const
inline

The minor version number, set by the user.

Referenced by minor_version().

◆ minor_version() [2/2]

void LIEF::PE::ResourceDirectory::minor_version ( uint16_t minor_version)
inline

References minor_version().

◆ numberof_id_entries() [1/2]

uint16_t LIEF::PE::ResourceDirectory::numberof_id_entries ( ) const
inline

The number of directory entries immediately following the Name entries that use numeric IDs for Type, Name, or Language entries.

Referenced by numberof_id_entries().

◆ numberof_id_entries() [2/2]

void LIEF::PE::ResourceDirectory::numberof_id_entries ( uint16_t numberof_id_entries)
inline

References numberof_id_entries().

◆ numberof_name_entries() [1/2]

uint16_t LIEF::PE::ResourceDirectory::numberof_name_entries ( ) const
inline

The number of directory entries immediately following the table that use strings to identify Type, Name, or Language entries (depending on the level of the table).

Referenced by numberof_name_entries().

◆ numberof_name_entries() [2/2]

void LIEF::PE::ResourceDirectory::numberof_name_entries ( uint16_t numberof_name_entries)
inline

◆ operator=()

ResourceDirectory & LIEF::PE::ResourceDirectory::operator= ( const ResourceDirectory & other)
default

References ResourceDirectory().

◆ swap()

void LIEF::PE::ResourceDirectory::swap ( ResourceDirectory & other)
noexcept

References ResourceDirectory().

◆ time_date_stamp() [1/2]

uint32_t LIEF::PE::ResourceDirectory::time_date_stamp ( ) const
inline

The time that the resource data was created by the resource compiler.

Referenced by time_date_stamp().

◆ time_date_stamp() [2/2]

void LIEF::PE::ResourceDirectory::time_date_stamp ( uint32_t time_date_stamp)
inline

References time_date_stamp().


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