LIEF: Library to Instrument Executable Formats Version 0.15.1
|
The Resource Manager provides an enhanced API to manipulate the resource tree. More...
#include <ResourcesManager.hpp>
Public Member Functions | |
ResourcesManager ()=delete | |
ResourcesManager (ResourceNode &rsrc) | |
ResourcesManager (const ResourcesManager &)=default | |
ResourcesManager & | operator= (const ResourcesManager &)=default |
ResourcesManager (ResourcesManager &&)=default | |
ResourcesManager & | operator= (ResourcesManager &&)=default |
~ResourcesManager () override=default | |
ResourceNode * | get_node_type (TYPE type) |
Return the ResourceNode associated with the given KIND or a nullptr if not found;. | |
const ResourceNode * | get_node_type (TYPE type) const |
std::vector< TYPE > | get_types () const |
List of TYPE present in the resources. | |
bool | has_type (TYPE type) const |
true if the resource has the given LIEF::PE::KIND | |
bool | has_manifest () const |
true if resources contain the Manifest element | |
std::string | manifest () const |
Return the manifest as a std::string or an empty string if not found or corrupted. | |
void | manifest (const std::string &manifest) |
Update the manifest with the given string. | |
bool | has_version () const |
true if resources contain a LIEF::PE::ResourceVersion | |
result< ResourceVersion > | version () const |
Return the ResourceVersion if any. | |
bool | has_icons () const |
true if resources contain a LIEF::PE::ResourceIcon | |
it_const_icons | icons () const |
Return the list of the icons present in the resources. | |
void | add_icon (const ResourceIcon &icon) |
Add an icon to the resources. | |
void | change_icon (const ResourceIcon &original, const ResourceIcon &newone) |
bool | has_dialogs () const |
true if resources contain dialogs | |
it_const_dialogs | dialogs () const |
Return the list of the dialogs present in the resource. | |
bool | has_string_table () const |
true if the resources contain a LIEF::PE::ResourceStringTable | |
it_const_strings_table | string_table () const |
Return the list of the string table in the resource. | |
bool | has_html () const |
true if the resources contain html | |
std::vector< std::string > | html () const |
Return the list of the html resources. | |
bool | has_accelerator () const |
true if the resources contain LIEF::PE::ResourceAccelerator | |
it_const_accelerators | accelerator () const |
Return the list of the accelerator in the resource. | |
std::string | print (uint32_t depth=0) const |
Print the resource tree to the given depth. | |
void | accept (Visitor &visitor) const override |
Public Member Functions inherited from LIEF::Object | |
Object () | |
Object (const Object &other) | |
Object & | operator= (const Object &other) |
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 constexpr uint32_t | lang_from_id (size_t id) |
static constexpr uint32_t | sublang_from_id (size_t id) |
The Resource Manager provides an enhanced API to manipulate the resource tree.
using LIEF::PE::ResourcesManager::accelerators_t = std::vector<ResourceAccelerator> |
using LIEF::PE::ResourcesManager::dialogs_t = std::vector<ResourceDialog> |
using LIEF::PE::ResourcesManager::icons_t = std::vector<ResourceIcon> |
using LIEF::PE::ResourcesManager::strings_table_t = std::vector<ResourceStringTable> |
|
strong |
The different types of resources Ref: From https://docs.microsoft.com/en-us/windows/win32/menurc/resource-types.
Enumerator | |
---|---|
CURSOR | |
BITMAP | |
ICON | |
MENU | |
DIALOG | |
STRING | |
FONTDIR | |
FONT | |
ACCELERATOR | |
RCDATA | |
MESSAGETABLE | |
GROUP_CURSOR | |
GROUP_ICON | |
VERSION | |
DLGINCLUDE | |
PLUGPLAY | |
VXD | |
ANICURSOR | |
ANIICON | |
HTML | |
MANIFEST |
|
delete |
|
inline |
|
default |
|
default |
|
overridedefault |
it_const_accelerators LIEF::PE::ResourcesManager::accelerator | ( | ) | const |
Return the list of the accelerator in the resource.
|
overridevirtual |
Implements LIEF::Object.
void LIEF::PE::ResourcesManager::add_icon | ( | const ResourceIcon & | icon | ) |
Add an icon to the resources.
void LIEF::PE::ResourcesManager::change_icon | ( | const ResourceIcon & | original, |
const ResourceIcon & | newone ) |
it_const_dialogs LIEF::PE::ResourcesManager::dialogs | ( | ) | const |
Return the list of the dialogs present in the resource.
ResourceNode * LIEF::PE::ResourcesManager::get_node_type | ( | TYPE | type | ) |
Return the ResourceNode associated with the given KIND or a nullptr if not found;.
const ResourceNode * LIEF::PE::ResourcesManager::get_node_type | ( | TYPE | type | ) | const |
std::vector< TYPE > LIEF::PE::ResourcesManager::get_types | ( | ) | const |
List of TYPE present in the resources.
|
inline |
true
if the resources contain LIEF::PE::ResourceAccelerator
|
inline |
true
if resources contain dialogs
|
inline |
true
if the resources contain html
|
inline |
true
if resources contain a LIEF::PE::ResourceIcon
|
inline |
true
if resources contain the Manifest element
|
inline |
true
if the resources contain a LIEF::PE::ResourceStringTable
|
inline |
true
if the resource has the given LIEF::PE::KIND
|
inline |
true
if resources contain a LIEF::PE::ResourceVersion
std::vector< std::string > LIEF::PE::ResourcesManager::html | ( | ) | const |
Return the list of the html resources.
it_const_icons LIEF::PE::ResourcesManager::icons | ( | ) | const |
Return the list of the icons present in the resources.
|
inlinestaticconstexpr |
std::string LIEF::PE::ResourcesManager::manifest | ( | ) | const |
Return the manifest as a std::string or an empty string if not found or corrupted.
void LIEF::PE::ResourcesManager::manifest | ( | const std::string & | manifest | ) |
Update the manifest with the given string.
|
default |
|
default |
std::string LIEF::PE::ResourcesManager::print | ( | uint32_t | depth = 0 | ) | const |
Print the resource tree to the given depth.
it_const_strings_table LIEF::PE::ResourcesManager::string_table | ( | ) | const |
Return the list of the string table in the resource.
|
inlinestaticconstexpr |
result< ResourceVersion > LIEF::PE::ResourcesManager::version | ( | ) | const |
Return the ResourceVersion if any.