LIEF: Library to Instrument Executable Formats
Version 1.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>
19
#include <ostream>
20
21
#include "
LIEF/visibility.h
"
22
23
#include "
LIEF/MachO/LoadCommand.hpp
"
24
25
namespace
LIEF
{
26
namespace
MachO
{
27
28
namespace
details
{
29
struct
dylinker_command;
30
}
31
34
class
LIEF_API
DylinkerCommand
:
public
LoadCommand
{
35
public
:
36
DylinkerCommand
() =
default
;
37
DylinkerCommand
(
const
details::dylinker_command& cmd);
38
DylinkerCommand
(std::string
name
);
39
40
DylinkerCommand
&
operator=
(
const
DylinkerCommand
& copy) =
default
;
41
DylinkerCommand
(
const
DylinkerCommand
& copy) =
default
;
42
43
std::unique_ptr<LoadCommand>
clone
()
const override
{
44
return
std::unique_ptr<DylinkerCommand>(
new
DylinkerCommand
(*
this
));
45
}
46
47
~DylinkerCommand
()
override
=
default
;
48
49
std::ostream&
print
(std::ostream& os)
const override
;
50
52
const
std::string&
name
()
const
{
53
return
name_;
54
}
55
56
void
name
(std::string
name
) {
57
name_ = std::move(
name
);
58
}
59
60
void
accept
(
Visitor
& visitor)
const override
;
61
62
static
bool
classof
(
const
LoadCommand
* cmd) {
63
const
LoadCommand::TYPE
type = cmd->
command
();
64
return
type ==
LoadCommand::TYPE::ID_DYLINKER
||
65
type ==
LoadCommand::TYPE::LOAD_DYLINKER
;
66
}
67
68
private
:
69
std::string name_;
70
};
71
72
}
73
}
74
#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:43
LIEF::MachO::DylinkerCommand::name
const std::string & name() const
Path to the linker (or loader).
Definition
DylinkerCommand.hpp:52
LIEF::MachO::DylinkerCommand::classof
static bool classof(const LoadCommand *cmd)
Definition
DylinkerCommand.hpp:62
LIEF::MachO::DylinkerCommand::name
void name(std::string name)
Definition
DylinkerCommand.hpp:56
LIEF::MachO::DylinkerCommand::DylinkerCommand
DylinkerCommand(const details::dylinker_command &cmd)
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:128
LIEF::MachO::LoadCommand::TYPE
TYPE
Definition
LoadCommand.hpp:44
LIEF::MachO::LoadCommand::TYPE::ID_DYLINKER
@ ID_DYLINKER
Definition
LoadCommand.hpp:60
LIEF::MachO::LoadCommand::TYPE::LOAD_DYLINKER
@ LOAD_DYLINKER
Definition
LoadCommand.hpp:59
LIEF::Visitor
Definition
Visitor.hpp:210
LIEF::MachO::details
Definition
endianness_support.hpp:60
LIEF::MachO
Namespace related to the LIEF's Mach-O module.
Definition
Abstract/Header.hpp:36
LIEF
LIEF namespace.
Definition
Abstract/Binary.hpp:40
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:41
Generated by
1.17.0