LIEF: Library to Instrument Executable Formats Version 0.15.1
Loading...
Searching...
No Matches
Abstract/Relocation.hpp
Go to the documentation of this file.
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#include <cstdint>
21
22#include "LIEF/Object.hpp"
23#include "LIEF/visibility.h"
24
25namespace LIEF {
27class LIEF_API Relocation : public Object {
28
29 public:
31
33 Relocation(uint64_t address, uint8_t size);
34
35 ~Relocation() override;
36
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
friend std::ostream & operator<<(std::ostream &os, const Relocation &entry)
void swap(Relocation &other)
Relocation & operator=(const Relocation &)
virtual void address(uint64_t address)
~Relocation() override
virtual void size(size_t size)
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.
Relocation(const Relocation &)
Definition Visitor.hpp:224
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41