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
UUIDCommand.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_UUID_COMMAND_H
17
#define LIEF_MACHO_UUID_COMMAND_H
18
#include <array>
19
#include <memory>
20
#include <ostream>
21
22
#include "
LIEF/visibility.h
"
23
24
#include "
LIEF/MachO/LoadCommand.hpp
"
25
26
27
namespace
LIEF::MachO
{
28
29
namespace
details
{
30
struct
uuid_command;
31
}
32
33
using
uuid_t
= std::array<uint8_t, 16>;
34
36
class
LIEF_API
UUIDCommand
:
public
LoadCommand
{
37
public
:
38
UUIDCommand
() =
default
;
39
UUIDCommand
(
const
details::uuid_command& cmd);
40
41
UUIDCommand
&
operator=
(
const
UUIDCommand
& copy) =
default
;
42
UUIDCommand
(
const
UUIDCommand
& copy) =
default
;
43
44
std::unique_ptr<LoadCommand>
clone
()
const override
{
45
return
std::make_unique<UUIDCommand>(*
this
);
46
}
47
48
~UUIDCommand
()
override
=
default
;
49
51
const
uuid_t
&
uuid
() const
LIEF_LIFETIMEBOUND
{
52
return
uuid_;
53
}
54
void
uuid
(
const
uuid_t
&
uuid
) {
55
uuid_ =
uuid
;
56
}
57
58
void
accept
(
Visitor
& visitor)
const override
;
59
60
std::ostream&
print
(std::ostream& os)
const override
;
61
62
static
bool
classof
(
const
LoadCommand
* cmd) {
63
return
cmd->
command
() ==
LoadCommand::TYPE::UUID
;
64
}
65
66
private
:
67
uuid_t
uuid_ = {0};
68
};
69
70
}
71
72
#endif
LoadCommand.hpp
LIEF::MachO::LoadCommand::LoadCommand
LoadCommand()=default
LIEF::MachO::LoadCommand::command
LoadCommand::TYPE command() const
Command type.
Definition
LoadCommand.hpp:132
LIEF::MachO::LoadCommand::TYPE::UUID
@ UUID
Definition
LoadCommand.hpp:75
LIEF::MachO::UUIDCommand::uuid
const uuid_t & uuid() const
The UUID as a 16-bytes array.
Definition
UUIDCommand.hpp:51
LIEF::MachO::UUIDCommand::print
std::ostream & print(std::ostream &os) const override
LIEF::MachO::UUIDCommand::classof
static bool classof(const LoadCommand *cmd)
Definition
UUIDCommand.hpp:62
LIEF::MachO::UUIDCommand::accept
void accept(Visitor &visitor) const override
LIEF::MachO::UUIDCommand::uuid
void uuid(const uuid_t &uuid)
Definition
UUIDCommand.hpp:54
LIEF::MachO::UUIDCommand::operator=
UUIDCommand & operator=(const UUIDCommand ©)=default
LIEF::MachO::UUIDCommand::clone
std::unique_ptr< LoadCommand > clone() const override
Definition
UUIDCommand.hpp:44
LIEF::MachO::UUIDCommand::UUIDCommand
UUIDCommand(const UUIDCommand ©)=default
LIEF::MachO::UUIDCommand::~UUIDCommand
~UUIDCommand() override=default
LIEF::MachO::UUIDCommand::UUIDCommand
UUIDCommand()=default
LIEF::MachO::UUIDCommand::UUIDCommand
UUIDCommand(const details::uuid_command &cmd)
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
LIEF::MachO::uuid_t
std::array< uint8_t, 16 > uuid_t
Definition
UUIDCommand.hpp:33
visibility.h
LIEF_API
#define LIEF_API
Definition
visibility.h:45
Generated by
1.18.0