LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Static Public Member Functions | List of all members
LIEF::BinaryStream Class Referenceabstract

Class that is used to a read stream of data from different sources. More...

#include <BinaryStream.hpp>

Inheritance diagram for LIEF::BinaryStream:
Inheritance graph
[legend]

Public Types

enum class  STREAM_TYPE {
  UNKNOWN = 0 , VECTOR , MEMORY , SPAN ,
  FILE , ELF_DATA_HANDLER
}
 

Public Member Functions

virtual uint64_t size () const =0
 
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)
 
virtual ok_error_t read_data (std::vector< uint8_t > &container, uint64_t size)
 
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
 
size_t align (size_t align_on) const
 
template<class T >
std::enable_if< std::is_integral< T >::value, result< T > >::type peek_conv () const
 
template<class T >
std::enable_if<!std::is_integral< T >::value, result< T > >::type peek_conv () const
 
template<class T >
result< T > peek_conv (size_t offset) const
 
template<class T >
result< T > read_conv () const
 
template<typename T >
std::unique_ptr< T[]> read_conv_array (size_t size) const
 
template<typename T >
std::unique_ptr< T[]> peek_conv_array (size_t offset, size_t size) const
 
void set_endian_swap (bool swap)
 
bool should_swap () const
 
virtual const uint8_t * p () const
 
virtual uint8_t * start ()
 
virtual uint8_t * p ()
 
virtual uint8_t * end ()
 
virtual const uint8_t * start () const
 
virtual const uint8_t * end () const
 

Static Public Member Functions

template<typename T >
static T swap_endian (T u)
 
template<class T >
static bool is_all_zero (const T &buffer)
 

Detailed Description

Class that is used to a read stream of data from different sources.


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