LIEF: Library to Instrument Executable Formats Version 0.15.0
Loading...
Searching...
No Matches
Abstract/Relocation.hpp
1/* Copyright 2017 - 2024 R. Thomas
2 * Copyright 2017 - 2024 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_ABSTRACT_RELOCATION_H
17#define LIEF_ABSTRACT_RELOCATION_H
18
19#include <ostream>
20
21#include "LIEF/types.hpp"
22#include "LIEF/Object.hpp"
23#include "LIEF/visibility.h"
24
25namespace LIEF {
27class LIEF_API Relocation : public Object {
28
29 public:
30 Relocation();
31
33 Relocation(uint64_t address, uint8_t size);
34
35 ~Relocation() override;
36
37 Relocation& operator=(const Relocation&);
38 Relocation(const Relocation&);
39 void swap(Relocation& other);
40
42 virtual uint64_t address() const;
43
45 virtual size_t size() const;
46
47 virtual void address(uint64_t address);
48 virtual void size(size_t size);
49
51 void accept(Visitor& visitor) const override;
52
53
55 virtual bool operator<(const Relocation& rhs) const;
56
58 virtual bool operator<=(const Relocation& rhs) const;
59
61 virtual bool operator>(const Relocation& rhs) const;
62
64 virtual bool operator>=(const Relocation& rhs) const;
65
66 LIEF_API friend std::ostream& operator<<(std::ostream& os, const Relocation& entry);
67
68 protected:
69 uint64_t address_ = 0;
70 uint8_t size_ = 0;
71};
72
73
74}
75#endif
Definition Object.hpp:25
Class which represents an abstracted Relocation.
Definition Abstract/Relocation.hpp:27
virtual bool operator<(const Relocation &rhs) const
Comparaison based on the Relocation's address
virtual size_t size() const
Relocation size in bits
virtual bool operator<=(const Relocation &rhs) const
Comparaison based on the Relocation's address
virtual bool operator>(const Relocation &rhs) const
Comparaison based on the Relocation's address
virtual uint64_t address() const
Relocation's address.
virtual bool operator>=(const Relocation &rhs) const
Comparaison based on the Relocation's address
void accept(Visitor &visitor) const override
Method so that the visitor can visit us.
Relocation(uint64_t address, uint8_t size)
Constructor from a relocation's address and size.
Definition Visitor.hpp:219
LIEF namespace.
Definition Abstract/Binary.hpp:32