16#ifndef LIEF_ELF_GNU_HASH_H
17#define LIEF_ELF_GNU_HASH_H
51 symbol_index_{symbol_idx},
53 bloom_filters_{
std::move(bloom_filters)},
54 buckets_{
std::move(buckets)},
55 hash_values_{
std::move(hash_values)} {}
68 return buckets_.size();
85 return bloom_filters_.size();
90 return bloom_filters_;
94 const std::vector<uint32_t>&
buckets()
const {
115 bool check(
const std::string& symbol_name)
const;
129 template<
class ELF_T>
131 uint64_t dynsymcount);
133 template<
class ELF_T>
137 return original_size_;
141 uint32_t symbol_index_ = 0;
142 uint32_t shift2_ = 0;
144 std::vector<uint64_t> bloom_filters_;
145 std::vector<uint32_t> buckets_;
146 std::vector<uint32_t> hash_values_;
149 uint64_t original_size_ = 0;
Class which represents an ELF binary.
Definition ELF/Binary.hpp:59
Class which takes an ELF::Binary object and reconstructs a valid binary.
Definition ELF/Builder.hpp:48
bool check_bucket(uint32_t hash) const
Check if the given hash passes the bucket filter.
Definition GnuHash.hpp:107
static result< uint32_t > nb_symbols(SpanStream &strm)
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={})
Definition GnuHash.hpp:48
GnuHash & operator=(const GnuHash ©)=default
GnuHash & operator=(GnuHash &&)=default
static std::unique_ptr< GnuHash > parse(SpanStream &strm, uint64_t dynsymcount)
bool check(uint32_t hash) const
Check if the symbol associated with the given hash probably exists. If the returned value is false yo...
uint32_t symbol_index() const
Index of the first symbol in the dynamic symbols table which accessible with the hash table.
Definition GnuHash.hpp:73
const std::vector< uint32_t > & hash_values() const
Hash values.
Definition GnuHash.hpp:99
friend class Builder
Definition GnuHash.hpp:43
void accept(Visitor &visitor) const override
uint32_t maskwords() const
Number of bloom filters used. It must be a power of 2.
Definition GnuHash.hpp:84
GnuHash(const GnuHash ©)=default
~GnuHash() override=default
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 s...
friend class Binary
Definition GnuHash.hpp:44
uint64_t original_size() const
Definition GnuHash.hpp:136
friend class Parser
Definition GnuHash.hpp:42
GnuHash(GnuHash &&)=default
uint32_t nb_buckets() const
Return the number of buckets.
Definition GnuHash.hpp:67
const std::vector< uint64_t > & bloom_filters() const
Bloom filters.
Definition GnuHash.hpp:89
bool check_bloom_filter(uint32_t hash) const
Check if the given hash passes the bloom filter.
friend std::ostream & operator<<(std::ostream &os, const GnuHash &gnuhash)
const std::vector< uint32_t > & buckets() const
Hash buckets.
Definition GnuHash.hpp:94
uint32_t shift2() const
Shift count used in the bloom filter.
Definition GnuHash.hpp:78
Class which parses and transforms an ELF file into a ELF::Binary object.
Definition ELF/Parser.hpp:45
Class which represents the ELF segments.
Definition Segment.hpp:48
Definition SpanStream.hpp:32
Definition Visitor.hpp:212
Wrapper that contains an Object (T) or an error.
Definition errors.hpp:77
Namespace related to the LIEF's ELF module.
Definition Abstract/Header.hpp:28
LIEF namespace.
Definition Abstract/Binary.hpp:40
Hash::value_type hash(const Object &v)
#define LIEF_API
Definition visibility.h:43
#define LIEF_LOCAL
Definition visibility.h:44