LIEF: Library to Instrument Executable Formats Version 0.17.0
Loading...
Searching...
No Matches
IndirectBindingInfo.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_MACHO_INDIRECT_BINDING_INFO_H
17#define LIEF_MACHO_INDIRECT_BINDING_INFO_H
18#include <ostream>
19#include <cstdint>
20
21#include "LIEF/visibility.h"
23
24namespace LIEF {
25namespace MachO {
30 friend class BinaryParser;
31 public:
32
33 IndirectBindingInfo(SegmentCommand& segment, Symbol& symbol, int32_t ordinal,
34 DylibCommand* dylib, uint64_t address)
35 {
36 segment_ = &segment;
37 symbol_ = &symbol;
38 library_ordinal_ = ordinal;
39 library_ = dylib;
40 address_ = address;
41 }
42
43 IndirectBindingInfo& operator=(const IndirectBindingInfo& other) = default;
44 IndirectBindingInfo(const IndirectBindingInfo& other) = default;
45
46 IndirectBindingInfo(IndirectBindingInfo&&) noexcept = default;
47
48
49 BindingInfo::TYPES type() const override {
50 return BindingInfo::TYPES::INDIRECT_SYMBOL;
51 }
52
53 static bool classof(const BindingInfo* info) {
54 return info->type() == BindingInfo::TYPES::INDIRECT_SYMBOL;
55 }
56
57 ~IndirectBindingInfo() override = default;
58
59 LIEF_API friend
60 std::ostream& operator<<(std::ostream& os, const IndirectBindingInfo& info) {
61 os << static_cast<const BindingInfo&>(info);
62 return os;
63 }
64};
65
66}
67}
68#endif
Class that provides an interface over a binding operation.
Definition BindingInfo.hpp:39
This class represents a binding operation infered from the indirect symbol table.
Definition IndirectBindingInfo.hpp:29
IndirectBindingInfo(IndirectBindingInfo &&) noexcept=default
IndirectBindingInfo & operator=(const IndirectBindingInfo &other)=default
static bool classof(const BindingInfo *info)
Definition IndirectBindingInfo.hpp:53
~IndirectBindingInfo() override=default
IndirectBindingInfo(const IndirectBindingInfo &other)=default
friend std::ostream & operator<<(std::ostream &os, const IndirectBindingInfo &info)
Definition IndirectBindingInfo.hpp:60
IndirectBindingInfo(SegmentCommand &segment, Symbol &symbol, int32_t ordinal, DylibCommand *dylib, uint64_t address)
Definition IndirectBindingInfo.hpp:33
Namespace related to the LIEF's Mach-O module.
Definition Abstract/Header.hpp:36
LIEF namespace.
Definition Abstract/Binary.hpp:36
#define LIEF_API
Definition visibility.h:41