LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
ELF
SysvHash.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
*
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
6
*
7
* http://www.apache.org/licenses/LICENSE-2.0
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
#ifndef LIEF_ELF_SYSV_HASH_H
16
#define LIEF_ELF_SYSV_HASH_H
17
18
#include <cstdint>
19
#include <ostream>
20
#include <vector>
21
22
#include "
LIEF/Object.hpp
"
23
#include "
LIEF/visibility.h
"
24
25
26
namespace
LIEF::ELF
{
27
28
class
Parser
;
29
class
Builder
;
30
class
Binary
;
31
38
class
LIEF_API
SysvHash
:
public
Object
{
39
40
friend
class
Parser
;
41
friend
class
Builder
;
42
friend
class
Binary
;
43
44
public
:
45
SysvHash
() =
default
;
46
SysvHash
&
operator=
(
const
SysvHash
& copy) =
default
;
47
SysvHash
(
const
SysvHash
& copy) =
default
;
48
49
SysvHash
&
operator=
(
SysvHash
&&) =
default
;
50
SysvHash
(
SysvHash
&&) =
default
;
51
~SysvHash
()
override
=
default
;
52
54
uint32_t
nbucket
()
const
{
55
return
buckets_.size();
56
}
57
59
uint32_t
nchain
()
const
{
60
return
chains_.size();
61
}
62
64
const
std::vector<uint32_t>&
buckets
() const
LIEF_LIFETIMEBOUND
{
65
return
buckets_;
66
}
67
69
const
std::vector<uint32_t>&
chains
() const
LIEF_LIFETIMEBOUND
{
70
return
chains_;
71
}
72
73
void
nchain
(uint32_t nb) {
74
chains_.resize(nb);
75
}
76
77
void
accept
(
Visitor
& visitor)
const override
;
78
79
LIEF_API
friend
std::ostream&
operator<<
(std::ostream& os,
80
const
SysvHash
& sysvhash);
81
82
private
:
83
std::vector<uint32_t> buckets_;
84
std::vector<uint32_t> chains_;
85
};
86
87
}
88
89
90
#endif
Object.hpp
LIEF::ELF::Binary
Class which represents an ELF binary.
Definition
ELF/Binary.hpp:65
LIEF::ELF::Builder
Class which takes an ELF::Binary object and reconstructs a valid binary.
Definition
ELF/Builder.hpp:47
LIEF::ELF::Parser
Class which parses and transforms an ELF file into a ELF::Binary object.
Definition
ELF/Parser.hpp:46
LIEF::ELF::SysvHash::accept
void accept(Visitor &visitor) const override
LIEF::ELF::SysvHash::~SysvHash
~SysvHash() override=default
LIEF::ELF::SysvHash::SysvHash
SysvHash(SysvHash &&)=default
LIEF::ELF::SysvHash::nbucket
uint32_t nbucket() const
Return the number of buckets used.
Definition
SysvHash.hpp:54
LIEF::ELF::SysvHash::operator=
SysvHash & operator=(const SysvHash ©)=default
LIEF::ELF::SysvHash::Builder
friend class Builder
Definition
SysvHash.hpp:41
LIEF::ELF::SysvHash::nchain
void nchain(uint32_t nb)
Definition
SysvHash.hpp:73
LIEF::ELF::SysvHash::SysvHash
SysvHash(const SysvHash ©)=default
LIEF::ELF::SysvHash::nchain
uint32_t nchain() const
Return the number of chain used.
Definition
SysvHash.hpp:59
LIEF::ELF::SysvHash::chains
const std::vector< uint32_t > & chains() const
Chains values.
Definition
SysvHash.hpp:69
LIEF::ELF::SysvHash::Binary
friend class Binary
Definition
SysvHash.hpp:42
LIEF::ELF::SysvHash::SysvHash
SysvHash()=default
LIEF::ELF::SysvHash::Parser
friend class Parser
Definition
SysvHash.hpp:40
LIEF::ELF::SysvHash::operator<<
friend std::ostream & operator<<(std::ostream &os, const SysvHash &sysvhash)
LIEF::ELF::SysvHash::operator=
SysvHash & operator=(SysvHash &&)=default
LIEF::ELF::SysvHash::buckets
const std::vector< uint32_t > & buckets() const
Buckets values.
Definition
SysvHash.hpp:64
LIEF::Object
Definition
Object.hpp:24
LIEF::Visitor
Definition
Visitor.hpp:211
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
LIEF::ELF
Namespace related to the LIEF's ELF module.
Definition
Abstract/Header.hpp:27
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:44
Generated by
1.19.0