LIEF: Library to Instrument Executable Formats Version 0.16.6
|
Loading...
Searching...
No Matches
Go to the documentation of this file.
16#ifndef LIEF_PE_RESOURCE_NODE_H
17#define LIEF_PE_RESOURCE_NODE_H
44 using childs_t = std::vector<std::unique_ptr<ResourceNode>>;
45 using it_childs = ref_iterator<childs_t&, ResourceNode*>;
46 using it_const_childs = const_ref_iterator<const childs_t&, ResourceNode*>;
61 void swap(ResourceNode& other);
65 virtual std::unique_ptr<ResourceNode>
clone()
const = 0;
72 const std::u16string&
name()
const {
88 return static_cast<bool>(id() & 0x80000000);
90 uint32_t
depth()
const {
104 return type_ == TYPE::DIRECTORY;
115 return type_ == TYPE::DATA;
118 void id(uint32_t
id) {
121 void name(
const std::string& name);
123 void name(std::u16string name) {
124 name_ = std::move(name);
126 ResourceNode&
add_child(
const ResourceDirectory& child);
129 ResourceNode&
add_child(
const ResourceData& child);
139 void accept(Visitor& visitor)
const override;
145 ResourceNode(TYPE type);
146 childs_t::iterator insert_child(std::unique_ptr<ResourceNode> child);
147 TYPE type_ = TYPE::UNKNOWN;
149 std::u16string name_;
Class that is used to rebuild a raw PE binary from a PE::Binary object.
Definition PE/Builder.hpp:45
Main interface to parse PE binaries. In particular the static functions: Parser::parse should be used...
Definition PE/Parser.hpp:47
Class which represents a Data Node in the PE resources tree.
Definition ResourceData.hpp:32
Definition ResourceDirectory.hpp:33
Class which represents a Node in the resource tree.
Definition ResourceNode.hpp:38
bool is_directory() const
True if the current entry is a ResourceDirectory.
Definition ResourceNode.hpp:103
void delete_child(uint32_t id)
Delete the node with the given id
ResourceNode & add_child(const ResourceDirectory &child)
Add a ResourceDirectory to the current node.
it_const_childs childs() const
Definition ResourceNode.hpp:82
ResourceNode & operator=(const ResourceNode &other)
const std::u16string & name() const
Name of the entry.
Definition ResourceNode.hpp:74
bool is_data() const
True if the current entry is a ResourceData.
Definition ResourceNode.hpp:114
uint32_t depth() const
Current depth of the Node in the resource tree.
Definition ResourceNode.hpp:92
ResourceNode(ResourceNode &&other)
bool has_name() const
True if the entry uses a name as ID
Definition ResourceNode.hpp:87
void delete_child(const ResourceNode &node)
Delete the given node from the node's children.
ResourceNode(const ResourceNode &other)
virtual std::unique_ptr< ResourceNode > clone() const =0
uint32_t id() const
Integer that identifies the Type, Name, or Language ID of the entry depending on its depth in the tre...
Definition ResourceNode.hpp:69
it_childs childs()
Iterator on node's children.
Definition ResourceNode.hpp:79
void swap(ResourceNode &other)
void name(std::u16string name)
Definition ResourceNode.hpp:123
void accept(Visitor &visitor) const override
ResourceNode & add_child(const ResourceData &child)
Add a ResourceData to the current node.
void name(const std::string &name)
void id(uint32_t id)
Definition ResourceNode.hpp:118
friend std::ostream & operator<<(std::ostream &os, const ResourceNode &node)
ResourceNode & operator=(ResourceNode &&other)
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
@ DATA
Definition PE/enums.hpp:670
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41