LIEF: Library to Instrument Executable Formats Version 0.16.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 {
26
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
45
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 used to parse a single binary (i.e. non-FAT)
Definition BinaryParser.hpp:74
Class that provides an interface over a binding operation.
Definition BindingInfo.hpp:38
TYPES
Definition BindingInfo.hpp:43
virtual TYPES type() const =0
The type of the binding. This type provides the origin of the binding (LC_DYLD_INFO or LC_DYLD_CHAINE...
Class which represents a library dependency.
Definition DylibCommand.hpp:34
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
Class which represents a LoadCommand::TYPE::SEGMENT / LoadCommand::TYPE::SEGMENT_64 command.
Definition SegmentCommand.hpp:49
Class that represents a Symbol in a Mach-O file.
Definition MachO/Symbol.hpp:47
LIEF namespace.
Definition Abstract/Binary.hpp:32
#define LIEF_API
Definition visibility.h:41