LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
LIEF::ELF::GnuHash Class Reference

Class which provides a view over the GNU Hash implementation. Most of the fields are read-only since the values are re-computed by the LIEF::ELF::Builder. More...

#include <GnuHash.hpp>

Inheritance diagram for LIEF::ELF::GnuHash:
Collaboration diagram for LIEF::ELF::GnuHash:

Public Member Functions

 GnuHash ()=default
 
 GnuHash (uint32_t symbol_idx, uint32_t shift2, std::vector< uint64_t > bloom_filters, std::vector< uint32_t > buckets, std::vector< uint32_t > hash_values={})
 
GnuHashoperator= (const GnuHash &copy)=default
 
 GnuHash (const GnuHash &copy)=default
 
 GnuHash (GnuHash &&)=default
 
GnuHashoperator= (GnuHash &&)=default
 
 ~GnuHash () override=default
 
uint32_t nb_buckets () const
 Return the number of buckets.
 
uint32_t symbol_index () const
 Index of the first symbol in the dynamic symbols table which accessible with the hash table.
 
uint32_t shift2 () const
 Shift count used in the bloom filter.
 
uint32_t maskwords () const
 Number of bloom filters used. It must be a power of 2.
 
const std::vector< uint64_t > & bloom_filters () const
 Bloom filters.
 
const std::vector< uint32_t > & buckets () const
 Hash buckets.
 
const std::vector< uint32_t > & hash_values () const
 Hash values.
 
bool check_bloom_filter (uint32_t hash) const
 Check if the given hash passes the bloom filter.
 
bool check_bucket (uint32_t hash) const
 Check if the given hash passes the bucket filter.
 
bool check (const std::string &symbol_name) const
 Check if the symbol probably exists. If the returned value is false you can assume at 100% that the symbol with the given name doesn't exist. If true, you can't do any assumption.
 
bool check (uint32_t hash) const
 Check if the symbol associated with the given hash probably exists. If the returned value is false you can assume at 100% that the symbol doesn't exists. If true you can't do any assumption.
 
void accept (Visitor &visitor) const override
 
- Public Member Functions inherited from LIEF::Object
 Object ()
 
 Object (const Object &other)
 
Objectoperator= (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 ()
 

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>>>
 

Detailed Description

Class which provides a view over the GNU Hash implementation. Most of the fields are read-only since the values are re-computed by the LIEF::ELF::Builder.

Constructor & Destructor Documentation

◆ GnuHash() [1/4]

LIEF::ELF::GnuHash::GnuHash ( )
default

◆ GnuHash() [2/4]

LIEF::ELF::GnuHash::GnuHash ( uint32_t symbol_idx,
uint32_t shift2,
std::vector< uint64_t > bloom_filters,
std::vector< uint32_t > buckets,
std::vector< uint32_t > hash_values = {} )

◆ GnuHash() [3/4]

LIEF::ELF::GnuHash::GnuHash ( const GnuHash & copy)
default

◆ GnuHash() [4/4]

LIEF::ELF::GnuHash::GnuHash ( GnuHash && )
default

◆ ~GnuHash()

LIEF::ELF::GnuHash::~GnuHash ( )
overridedefault

Member Function Documentation

◆ accept()

void LIEF::ELF::GnuHash::accept ( Visitor & visitor) const
overridevirtual

Implements LIEF::Object.

◆ bloom_filters()

const std::vector< uint64_t > & LIEF::ELF::GnuHash::bloom_filters ( ) const
inline

Bloom filters.

◆ buckets()

const std::vector< uint32_t > & LIEF::ELF::GnuHash::buckets ( ) const
inline

Hash buckets.

◆ check() [1/2]

bool LIEF::ELF::GnuHash::check ( const std::string & symbol_name) const

Check if the symbol probably exists. If the returned value is false you can assume at 100% that the symbol with the given name doesn't exist. If true, you can't do any assumption.

◆ check() [2/2]

bool LIEF::ELF::GnuHash::check ( uint32_t hash) const

Check if the symbol associated with the given hash probably exists. If the returned value is false you can assume at 100% that the symbol doesn't exists. If true you can't do any assumption.

◆ check_bloom_filter()

bool LIEF::ELF::GnuHash::check_bloom_filter ( uint32_t hash) const

Check if the given hash passes the bloom filter.

◆ check_bucket()

bool LIEF::ELF::GnuHash::check_bucket ( uint32_t hash) const
inline

Check if the given hash passes the bucket filter.

References LIEF::hash().

◆ hash_values()

const std::vector< uint32_t > & LIEF::ELF::GnuHash::hash_values ( ) const
inline

Hash values.

◆ maskwords()

uint32_t LIEF::ELF::GnuHash::maskwords ( ) const
inline

Number of bloom filters used. It must be a power of 2.

◆ nb_buckets()

uint32_t LIEF::ELF::GnuHash::nb_buckets ( ) const
inline

Return the number of buckets.

See also
GnuHash::buckets

◆ operator=() [1/2]

GnuHash & LIEF::ELF::GnuHash::operator= ( const GnuHash & copy)
default

◆ operator=() [2/2]

GnuHash & LIEF::ELF::GnuHash::operator= ( GnuHash && )
default

◆ shift2()

uint32_t LIEF::ELF::GnuHash::shift2 ( ) const
inline

Shift count used in the bloom filter.

◆ symbol_index()

uint32_t LIEF::ELF::GnuHash::symbol_index ( ) const
inline

Index of the first symbol in the dynamic symbols table which accessible with the hash table.


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