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
DyldEnvironment.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_DYLD_ENVIROMENT_COMMAND_H
17
#define LIEF_MACHO_DYLD_ENVIROMENT_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
DyldEnvironment
:
public
LoadCommand
{
37
public
:
38
DyldEnvironment
() =
default
;
39
DyldEnvironment
(
const
details::dylinker_command& cmd);
40
41
DyldEnvironment
&
operator=
(
const
DyldEnvironment
& copy) =
default
;
42
DyldEnvironment
(
const
DyldEnvironment
& copy) =
default
;
43
44
std::unique_ptr<LoadCommand>
clone
()
const override
{
45
return
std::make_unique<DyldEnvironment>(*
this
);
46
}
47
48
~DyldEnvironment
()
override
=
default
;
49
50
std::ostream&
print
(std::ostream& os)
const override
;
51
53
std::string_view
value
() const
LIEF_LIFETIMEBOUND
{
54
return
value_;
55
}
56
57
void
value
(std::string
value
) {
58
value_ = std::move(
value
);
59
}
60
61
void
accept
(
Visitor
& visitor)
const override
;
62
63
static
bool
classof
(
const
LoadCommand
* cmd) {
64
return
cmd->
command
() ==
LoadCommand::TYPE::DYLD_ENVIRONMENT
;
65
}
66
67
private
:
68
std::string value_;
69
};
70
71
}
72
73
#endif
LoadCommand.hpp
LIEF::MachO::DyldEnvironment::DyldEnvironment
DyldEnvironment(const DyldEnvironment ©)=default
LIEF::MachO::DyldEnvironment::DyldEnvironment
DyldEnvironment(const details::dylinker_command &cmd)
LIEF::MachO::DyldEnvironment::value
void value(std::string value)
Definition
DyldEnvironment.hpp:57
LIEF::MachO::DyldEnvironment::~DyldEnvironment
~DyldEnvironment() override=default
LIEF::MachO::DyldEnvironment::value
std::string_view value() const
The actual environment variable.
Definition
DyldEnvironment.hpp:53
LIEF::MachO::DyldEnvironment::DyldEnvironment
DyldEnvironment()=default
LIEF::MachO::DyldEnvironment::classof
static bool classof(const LoadCommand *cmd)
Definition
DyldEnvironment.hpp:63
LIEF::MachO::DyldEnvironment::operator=
DyldEnvironment & operator=(const DyldEnvironment ©)=default
LIEF::MachO::DyldEnvironment::clone
std::unique_ptr< LoadCommand > clone() const override
Definition
DyldEnvironment.hpp:44
LIEF::MachO::DyldEnvironment::print
std::ostream & print(std::ostream &os) const override
LIEF::MachO::DyldEnvironment::accept
void accept(Visitor &visitor) const override
LIEF::MachO::LoadCommand::LoadCommand
LoadCommand()=default
LIEF::MachO::LoadCommand::command
LoadCommand::TYPE command() const
Command type.
Definition
LoadCommand.hpp:132
LIEF::MachO::LoadCommand::TYPE::DYLD_ENVIRONMENT
@ DYLD_ENVIRONMENT
Definition
LoadCommand.hpp:88
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