LIEF: Library to Instrument Executable Formats Version 0.15.1
|
Class which represents an abstracted section. More...
#include <Section.hpp>
Public Member Functions | |
Section ()=default | |
Section (std::string name) | |
~Section () override=default | |
Section & | operator= (const Section &)=default |
Section (const Section &)=default | |
virtual std::string | name () const |
section's name | |
virtual const std::string & | fullname () const |
Return the complete section's name which might trailing (0 ) bytes. | |
virtual span< const uint8_t > | content () const |
section's content | |
virtual void | size (uint64_t size) |
Change the section size. | |
virtual uint64_t | size () const |
section's size (size in the binary, not the virtual size) | |
virtual uint64_t | offset () const |
Offset in the binary. | |
virtual uint64_t | virtual_address () const |
Address where the section should be mapped. | |
virtual void | virtual_address (uint64_t virtual_address) |
virtual void | name (std::string name) |
Change the section's name. | |
virtual void | content (const std::vector< uint8_t > &) |
Change section content. | |
virtual void | offset (uint64_t offset) |
double | entropy () const |
Section's entropy. | |
size_t | search (uint64_t integer, size_t pos, size_t size) const |
size_t | search (const std::vector< uint8_t > &pattern, size_t pos=0) const |
size_t | search (const std::string &pattern, size_t pos=0) const |
size_t | search (uint64_t integer, size_t pos=0) const |
std::vector< size_t > | search_all (uint64_t v, size_t size) const |
std::vector< size_t > | search_all (uint64_t v) const |
std::vector< size_t > | search_all (const std::string &v) const |
void | accept (Visitor &visitor) const override |
Method so that the visitor can visit us. | |
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 Attributes | |
static constexpr size_t | npos = -1 |
Additional Inherited Members | |
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>>> |
Class which represents an abstracted section.
|
default |
|
inline |
|
overridedefault |
|
default |
|
overridevirtual |
Method so that the visitor
can visit us.
Implements LIEF::Object.
|
inlinevirtual |
section's content
Reimplemented in LIEF::ELF::Section, LIEF::MachO::Section, and LIEF::PE::Section.
|
inlinevirtual |
Change section content.
Reimplemented in LIEF::ELF::Section, LIEF::MachO::Section, and LIEF::PE::Section.
double LIEF::Section::entropy | ( | ) | const |
Section's entropy.
|
inlinevirtual |
Return the complete section's name which might trailing (0
) bytes.
|
inlinevirtual |
section's name
|
inlinevirtual |
Change the section's name.
Reimplemented in LIEF::PE::Section.
|
inlinevirtual |
Offset in the binary.
Reimplemented in LIEF::ELF::Section.
|
inlinevirtual |
Reimplemented in LIEF::ELF::Section.
size_t LIEF::Section::search | ( | const std::string & | pattern, |
size_t | pos = 0 ) const |
size_t LIEF::Section::search | ( | const std::vector< uint8_t > & | pattern, |
size_t | pos = 0 ) const |
size_t LIEF::Section::search | ( | uint64_t | integer, |
size_t | pos, | ||
size_t | size ) const |
size_t LIEF::Section::search | ( | uint64_t | integer, |
size_t | pos = 0 ) const |
std::vector< size_t > LIEF::Section::search_all | ( | const std::string & | v | ) | const |
std::vector< size_t > LIEF::Section::search_all | ( | uint64_t | v | ) | const |
std::vector< size_t > LIEF::Section::search_all | ( | uint64_t | v, |
size_t | size ) const |
|
inlinevirtual |
section's size (size in the binary, not the virtual size)
Reimplemented in LIEF::ELF::Section.
|
inlinevirtual |
Change the section size.
Reimplemented in LIEF::ELF::Section.
|
inlinevirtual |
Address where the section should be mapped.
|
inlinevirtual |
|
staticconstexpr |