LIEF: Library to Instrument Executable Formats Version 0.16.0
Loading...
Searching...
No Matches
LIEF::MemoryStream Class Reference

#include <MemoryStream.hpp>

Inheritance diagram for LIEF::MemoryStream:
Collaboration diagram for LIEF::MemoryStream:

Public Member Functions

 MemoryStream ()=delete
 
 MemoryStream (uintptr_t base_address)
 
 MemoryStream (uintptr_t base_address, uint64_t size)
 
 MemoryStream (const MemoryStream &)=delete
 
MemoryStreamoperator= (const MemoryStream &)=delete
 
 MemoryStream (MemoryStream &&) noexcept=default
 
MemoryStreamoperator= (MemoryStream &&) noexcept=default
 
uintptr_t base_address () const
 
const uint8_t * p () const override
 
const uint8_t * start () const override
 
const uint8_t * end () const override
 
void binary (Binary &bin)
 
Binarybinary ()
 
uint64_t size () const override
 
 ~MemoryStream () override=default
 
virtual uint8_t * p ()
 
virtual uint8_t * end ()
 
virtual uint8_t * start ()
 
- Public Member Functions inherited from LIEF::BinaryStream
 BinaryStream (STREAM_TYPE type)
 
virtual ~BinaryStream ()=default
 
STREAM_TYPE type () const
 
result< uint64_t > read_uleb128 () const
 
result< uint64_t > read_sleb128 () const
 
result< int64_t > read_dwarf_encoded (uint8_t encoding) const
 
result< std::string > read_string (size_t maxsize=~static_cast< size_t >(0)) const
 
result< std::string > peek_string (size_t maxsize=~static_cast< size_t >(0)) const
 
result< std::string > peek_string_at (size_t offset, size_t maxsize=~static_cast< size_t >(0)) const
 
result< std::u16string > read_u16string () const
 
result< std::u16string > peek_u16string () const
 
result< std::string > read_mutf8 (size_t maxsize=~static_cast< size_t >(0)) const
 
result< std::u16string > read_u16string (size_t length) const
 
result< std::u16string > peek_u16string (size_t length) const
 
result< std::u16string > peek_u16string_at (size_t offset, size_t length) const
 
virtual ok_error_t peek_data (std::vector< uint8_t > &container, uint64_t offset, uint64_t size, uint64_t virtual_address=0)
 
virtual ok_error_t read_data (std::vector< uint8_t > &container, uint64_t size)
 
template<class T >
ok_error_t read_objects (std::vector< T > &container, uint64_t count)
 
template<class T >
ok_error_t peek_objects (std::vector< T > &container, uint64_t count)
 
template<class T >
ok_error_t peek_objects_at (uint64_t offset, std::vector< T > &container, uint64_t count)
 
void setpos (size_t pos) const
 
void increment_pos (size_t value) const
 
void decrement_pos (size_t value) const
 
size_t pos () const
 
 operator bool () const
 
template<class T >
const T * read_array (size_t size) const
 
template<class T >
result< T > peek () const
 
template<class T >
result< T > peek (size_t offset) const
 
template<class T >
const T * peek_array (size_t size) const
 
template<class T >
const T * peek_array (size_t offset, size_t size) const
 
template<class T >
result< T > read () const
 
template<typename T >
bool can_read () const
 
template<typename T >
bool can_read (size_t offset) const
 
bool can_read (int64_t offset, int64_t size) const
 
size_t align (size_t align_on) const
 
void set_endian_swap (bool swap)
 
bool should_swap () const
 

Static Public Member Functions

static bool classof (const BinaryStream &stream)
 
- Static Public Member Functions inherited from LIEF::BinaryStream
template<class T >
static bool is_all_zero (const T &buffer)
 

Additional Inherited Members

- Public Types inherited from LIEF::BinaryStream
enum class  STREAM_TYPE {
  UNKNOWN = 0 , VECTOR , MEMORY , SPAN ,
  FILE , ELF_DATA_HANDLER
}
 

Constructor & Destructor Documentation

◆ MemoryStream() [1/5]

LIEF::MemoryStream::MemoryStream ( )
delete

◆ MemoryStream() [2/5]

LIEF::MemoryStream::MemoryStream ( uintptr_t base_address)

◆ MemoryStream() [3/5]

LIEF::MemoryStream::MemoryStream ( uintptr_t base_address,
uint64_t size )
inline

◆ MemoryStream() [4/5]

LIEF::MemoryStream::MemoryStream ( const MemoryStream & )
delete

◆ MemoryStream() [5/5]

LIEF::MemoryStream::MemoryStream ( MemoryStream && )
defaultnoexcept

◆ ~MemoryStream()

LIEF::MemoryStream::~MemoryStream ( )
overridedefault

Member Function Documentation

◆ base_address()

uintptr_t LIEF::MemoryStream::base_address ( ) const
inline

◆ binary() [1/2]

Binary * LIEF::MemoryStream::binary ( )
inline

◆ binary() [2/2]

void LIEF::MemoryStream::binary ( Binary & bin)
inline

◆ classof()

static bool LIEF::MemoryStream::classof ( const BinaryStream & stream)
inlinestatic

◆ end() [1/2]

virtual uint8_t * LIEF::BinaryStream::end ( )
inlinevirtual

Reimplemented from LIEF::BinaryStream.

◆ end() [2/2]

const uint8_t * LIEF::MemoryStream::end ( ) const
inlineoverridevirtual

Reimplemented from LIEF::BinaryStream.

◆ operator=() [1/2]

MemoryStream & LIEF::MemoryStream::operator= ( const MemoryStream & )
delete

◆ operator=() [2/2]

MemoryStream & LIEF::MemoryStream::operator= ( MemoryStream && )
defaultnoexcept

◆ p() [1/2]

virtual uint8_t * LIEF::BinaryStream::p ( )
inlinevirtual

Reimplemented from LIEF::BinaryStream.

◆ p() [2/2]

const uint8_t * LIEF::MemoryStream::p ( ) const
inlineoverridevirtual

Reimplemented from LIEF::BinaryStream.

◆ size()

uint64_t LIEF::MemoryStream::size ( ) const
inlineoverridevirtual

Implements LIEF::BinaryStream.

◆ start() [1/2]

virtual uint8_t * LIEF::BinaryStream::start ( )
inlinevirtual

Reimplemented from LIEF::BinaryStream.

◆ start() [2/2]

const uint8_t * LIEF::MemoryStream::start ( ) const
inlineoverridevirtual

Reimplemented from LIEF::BinaryStream.


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