LIEF: Library to Instrument Executable Formats Version
Loading...
Searching...
No Matches
DynamicEntry.hpp
1/* Copyright 2017 - 2023 R. Thomas
2 * Copyright 2017 - 2023 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_H
17#define LIEF_ELF_DYNAMIC_ENTRY_H
18
19#include <string>
20#include <vector>
21#include <ostream>
22
23#include "LIEF/visibility.h"
24#include "LIEF/Object.hpp"
25
26#include "LIEF/ELF/enums.hpp"
27
28namespace LIEF {
29namespace ELF {
30namespace details {
31struct Elf64_Dyn;
32struct Elf32_Dyn;
33}
34
37class LIEF_API DynamicEntry : public Object {
38 public:
39
40 DynamicEntry(const details::Elf64_Dyn& header);
41 DynamicEntry(const details::Elf32_Dyn& header);
43 DynamicEntry(DYNAMIC_TAGS tag, uint64_t value);
44
45 DynamicEntry& operator=(const DynamicEntry&);
47 ~DynamicEntry() override;
48
52
57 uint64_t value() const;
58
59 void tag(DYNAMIC_TAGS tag);
60 void value(uint64_t value);
61
62 void accept(Visitor& visitor) const override;
63
64 virtual std::ostream& print(std::ostream& os) const;
65
66
67 LIEF_API friend std::ostream& operator<<(std::ostream& os, const DynamicEntry& entry);
68
69 protected:
70 DYNAMIC_TAGS tag_;
71 uint64_t value_;
72};
73}
74}
75#endif
Class which represents an entry in the dynamic table These entries are located in the ....
Definition DynamicEntry.hpp:37
uint64_t value() const
Return the entry's value.
DYNAMIC_TAGS tag() const
Tag of the current entry. The most common tags are: DT_NEEDED, DT_INIT, ...
Definition Object.hpp:25
Definition Visitor.hpp:219
DYNAMIC_TAGS
Definition ELF/enums.hpp:680
LIEF namespace.
Definition Abstract/Binary.hpp:32