LIEF: Library to Instrument Executable Formats
Version 2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
lief-install
x86_64
static
include
LIEF
MachO
DylinkerCommand.hpp
Go to the documentation of this file.
1
/* Copyright 2017 - 2026 R. Thomas
2
* Copyright 2017 - 2026 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_DYLINKER_COMMAND_H
17
#define LIEF_MACHO_DYLINKER_COMMAND_H
18
#include <string_view>
19
#include <memory>
20
#include <ostream>
21
#include <string>
22
23
#include "
LIEF/visibility.h
"
24
25
#include "
LIEF/MachO/LoadCommand.hpp
"
26
27
28
namespace
LIEF::MachO
{
29
30
namespace
details
{
31
struct
dylinker_command;
32
}
33
36
class
LIEF_API
DylinkerCommand
:
public
LoadCommand
{
37
public
:
38
DylinkerCommand
() =
default
;
39
DylinkerCommand
(
const
details::dylinker_command& cmd);
40
DylinkerCommand
(std::string
name
);
41
42
DylinkerCommand
&
operator=
(
const
DylinkerCommand
& copy) =
default
;
43
DylinkerCommand
(
const
DylinkerCommand
& copy) =
default
;
44
45
std::unique_ptr<LoadCommand>
clone
()
const override
{
46
return
std::make_unique<DylinkerCommand>(*
this
);
47
}
48
49
~DylinkerCommand
()
override
=
default
;
50
51
std::ostream&
print
(std::ostream& os)
const override
;
52
54
std::string_view
name
() const
LIEF_LIFETIMEBOUND
{
55
return
name_;
56
}
57
58
void
name
(std::string
name
) {
59
name_ = std::move(
name
);
60
}
61
62
void
accept
(
Visitor
& visitor)
const override
;
63
64
static
bool
classof
(
const
LoadCommand
* cmd) {
65
const
LoadCommand::TYPE
type = cmd->
command
();
66
return
type ==
LoadCommand::TYPE::ID_DYLINKER
||
67
type ==
LoadCommand::TYPE::LOAD_DYLINKER
;
68
}
69
70
private
:
71
std::string name_;
72
};
73
74
}
75
76
#endif
LoadCommand.hpp
LIEF::MachO::DylinkerCommand::~DylinkerCommand
~DylinkerCommand() override=default
LIEF::MachO::DylinkerCommand::DylinkerCommand
DylinkerCommand()=default
LIEF::MachO::DylinkerCommand::clone
std::unique_ptr< LoadCommand > clone() const override
Definition
DylinkerCommand.hpp:45
LIEF::MachO::DylinkerCommand::classof
static bool classof(const LoadCommand *cmd)
Definition
DylinkerCommand.hpp:64
LIEF::MachO::DylinkerCommand::name
void name(std::string name)
Definition
DylinkerCommand.hpp:58
LIEF::MachO::DylinkerCommand::DylinkerCommand
DylinkerCommand(const details::dylinker_command &cmd)
LIEF::MachO::DylinkerCommand::name
std::string_view name() const
Path to the linker (or loader).
Definition
DylinkerCommand.hpp:54
LIEF::MachO::DylinkerCommand::DylinkerCommand
DylinkerCommand(std::string name)
LIEF::MachO::DylinkerCommand::print
std::ostream & print(std::ostream &os) const override
LIEF::MachO::DylinkerCommand::operator=
DylinkerCommand & operator=(const DylinkerCommand ©)=default
LIEF::MachO::DylinkerCommand::accept
void accept(Visitor &visitor) const override
LIEF::MachO::DylinkerCommand::DylinkerCommand
DylinkerCommand(const DylinkerCommand ©)=default
LIEF::MachO::LoadCommand::LoadCommand
LoadCommand()=default
LIEF::MachO::LoadCommand::command
LoadCommand::TYPE command() const
Command type.
Definition
LoadCommand.hpp:132
LIEF::MachO::LoadCommand::TYPE
TYPE
Definition
LoadCommand.hpp:47
LIEF::MachO::LoadCommand::TYPE::ID_DYLINKER
@ ID_DYLINKER
Definition
LoadCommand.hpp:63
LIEF::MachO::LoadCommand::TYPE::LOAD_DYLINKER
@ LOAD_DYLINKER
Definition
LoadCommand.hpp:62
LIEF::Visitor
Definition
Visitor.hpp:212
LIEF_LIFETIMEBOUND
#define LIEF_LIFETIMEBOUND
Definition
compiler_attributes.hpp:72
LIEF::MachO::details
Definition
endianness_support.hpp:59
LIEF::MachO
Namespace related to the LIEF's Mach-O module.
Definition
Abstract/Header.hpp:36
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0