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
DynamicEntryLibrary.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
* Copyright 2017 - 2026 Quarkslab
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*/
16
#ifndef LIEF_ELF_DYNAMIC_ENTRY_LIBRARY_H
17
#define LIEF_ELF_DYNAMIC_ENTRY_LIBRARY_H
18
19
#include "
LIEF/ELF/DynamicEntry.hpp
"
20
#include "
LIEF/compiler_attributes.hpp
"
21
#include "
LIEF/visibility.h
"
22
#include <string_view>
23
#include <memory>
24
#include <string>
25
26
27
namespace
LIEF::ELF
{
28
32
class
LIEF_API
DynamicEntryLibrary
:
public
DynamicEntry
{
33
34
public
:
35
using
DynamicEntry::DynamicEntry
;
36
37
DynamicEntryLibrary
() :
38
DynamicEntry
::
DynamicEntry
{
DynamicEntry
::
TAG
::NEEDED, 0} {}
39
40
DynamicEntryLibrary
(std::string
name
) :
41
DynamicEntry
::
DynamicEntry
{
DynamicEntry
::
TAG
::NEEDED, 0},
42
libname_(std::move(
name
)) {}
43
44
DynamicEntryLibrary
&
operator=
(
const
DynamicEntryLibrary
&) =
default
;
45
DynamicEntryLibrary
(
const
DynamicEntryLibrary
&) =
default
;
46
47
std::unique_ptr<DynamicEntry>
clone
()
const override
{
48
return
std::make_unique<DynamicEntryLibrary>(*
this
);
49
}
50
52
std::string_view
name
() const
LIEF_LIFETIMEBOUND
{
53
return
libname_;
54
}
55
56
void
name
(std::string
name
) {
57
libname_ = std::move(
name
);
58
}
59
60
static
bool
classof
(
const
DynamicEntry
* entry) {
61
return
entry->
tag
() ==
DynamicEntry::TAG::NEEDED
;
62
}
63
64
void
accept
(
Visitor
& visitor)
const override
;
65
66
std::ostream&
print
(std::ostream& os)
const override
;
67
68
private
:
69
std::string libname_;
70
};
71
}
72
73
74
#endif
DynamicEntry.hpp
LIEF::ELF::DynamicEntryLibrary::clone
std::unique_ptr< DynamicEntry > clone() const override
Definition
DynamicEntryLibrary.hpp:47
LIEF::ELF::DynamicEntryLibrary::DynamicEntryLibrary
DynamicEntryLibrary(const DynamicEntryLibrary &)=default
LIEF::ELF::DynamicEntryLibrary::operator=
DynamicEntryLibrary & operator=(const DynamicEntryLibrary &)=default
LIEF::ELF::DynamicEntryLibrary::name
std::string_view name() const
Return the library associated with this entry (e.g. libc.so.6).
Definition
DynamicEntryLibrary.hpp:52
LIEF::ELF::DynamicEntryLibrary::name
void name(std::string name)
Definition
DynamicEntryLibrary.hpp:56
LIEF::ELF::DynamicEntryLibrary::classof
static bool classof(const DynamicEntry *entry)
Definition
DynamicEntryLibrary.hpp:60
LIEF::ELF::DynamicEntryLibrary::print
std::ostream & print(std::ostream &os) const override
LIEF::ELF::DynamicEntryLibrary::accept
void accept(Visitor &visitor) const override
LIEF::ELF::DynamicEntryLibrary::DynamicEntryLibrary
DynamicEntryLibrary()
Definition
DynamicEntryLibrary.hpp:37
LIEF::ELF::DynamicEntryLibrary::DynamicEntry
DynamicEntry()=default
LIEF::ELF::DynamicEntryLibrary::DynamicEntryLibrary
DynamicEntryLibrary(std::string name)
Definition
DynamicEntryLibrary.hpp:40
LIEF::ELF::DynamicEntry::TAG
TAG
Definition
DynamicEntry.hpp:49
LIEF::ELF::DynamicEntry::TAG::NEEDED
@ NEEDED
Definition
DynamicEntry.hpp:52
LIEF::ELF::DynamicEntry::tag
TAG tag() const
Tag of the current entry. The most common tags are: DT_NEEDED, DT_INIT, ...
Definition
DynamicEntry.hpp:252
LIEF::ELF::DynamicEntry::DynamicEntry
DynamicEntry()=default
LIEF::Visitor
Definition
Visitor.hpp:212
compiler_attributes.hpp
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
LIEF::ELF
Namespace related to the LIEF's ELF module.
Definition
Abstract/Header.hpp:28
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0