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
VersionMin.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_VERSION_MIN_COMMAND_H
17
#define LIEF_MACHO_VERSION_MIN_COMMAND_H
18
#include <ostream>
19
#include <array>
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
version_min_command;
30
}
31
33
class
LIEF_API
VersionMin
:
public
LoadCommand
{
34
35
public
:
37
using
version_t
= std::array<uint32_t, 3>;
38
39
VersionMin
() =
default
;
40
VersionMin
(
const
details::version_min_command& version_cmd);
41
42
VersionMin
&
operator=
(
const
VersionMin
& copy) =
default
;
43
VersionMin
(
const
VersionMin
& copy) =
default
;
44
45
std::unique_ptr<LoadCommand>
clone
()
const override
{
46
return
std::unique_ptr<VersionMin>(
new
VersionMin
(*
this
));
47
}
48
49
~VersionMin
()
override
=
default
;
50
52
const
version_t
&
version
()
const
{
53
return
version_;
54
}
55
void
version
(
const
version_t
&
version
) {
56
version_ =
version
;
57
}
58
60
const
version_t
&
sdk
()
const
{
61
return
sdk_;
62
}
63
void
sdk
(
const
version_t
&
sdk
) {
64
sdk_ =
sdk
;
65
}
66
67
void
accept
(
Visitor
& visitor)
const override
;
68
69
std::ostream&
print
(std::ostream& os)
const override
;
70
71
static
bool
classof
(
const
LoadCommand
* cmd) {
72
const
LoadCommand::TYPE
type = cmd->
command
();
73
return
type ==
LoadCommand::TYPE::VERSION_MIN_MACOSX
||
74
type ==
LoadCommand::TYPE::VERSION_MIN_IPHONEOS
||
75
type ==
LoadCommand::TYPE::VERSION_MIN_TVOS
||
76
type ==
LoadCommand::TYPE::VERSION_MIN_WATCHOS
;
77
}
78
79
private
:
80
version_t version_;
81
version_t sdk_;
82
};
83
84
}
85
}
86
#endif
LoadCommand.hpp
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::VERSION_MIN_TVOS
@ VERSION_MIN_TVOS
Definition
LoadCommand.hpp:93
LIEF::MachO::LoadCommand::TYPE::VERSION_MIN_WATCHOS
@ VERSION_MIN_WATCHOS
Definition
LoadCommand.hpp:94
LIEF::MachO::LoadCommand::TYPE::VERSION_MIN_MACOSX
@ VERSION_MIN_MACOSX
Definition
LoadCommand.hpp:82
LIEF::MachO::LoadCommand::TYPE::VERSION_MIN_IPHONEOS
@ VERSION_MIN_IPHONEOS
Definition
LoadCommand.hpp:83
LIEF::MachO::VersionMin::~VersionMin
~VersionMin() override=default
LIEF::MachO::VersionMin::VersionMin
VersionMin(const VersionMin ©)=default
LIEF::MachO::VersionMin::version
const version_t & version() const
Return the version as an array.
Definition
VersionMin.hpp:52
LIEF::MachO::VersionMin::sdk
const version_t & sdk() const
Return the sdk version as an array.
Definition
VersionMin.hpp:60
LIEF::MachO::VersionMin::VersionMin
VersionMin(const details::version_min_command &version_cmd)
LIEF::MachO::VersionMin::accept
void accept(Visitor &visitor) const override
LIEF::MachO::VersionMin::clone
std::unique_ptr< LoadCommand > clone() const override
Definition
VersionMin.hpp:45
LIEF::MachO::VersionMin::version
void version(const version_t &version)
Definition
VersionMin.hpp:55
LIEF::MachO::VersionMin::VersionMin
VersionMin()=default
LIEF::MachO::VersionMin::operator=
VersionMin & operator=(const VersionMin ©)=default
LIEF::MachO::VersionMin::classof
static bool classof(const LoadCommand *cmd)
Definition
VersionMin.hpp:71
LIEF::MachO::VersionMin::sdk
void sdk(const version_t &sdk)
Definition
VersionMin.hpp:63
LIEF::MachO::VersionMin::print
std::ostream & print(std::ostream &os) const override
LIEF::MachO::VersionMin::version_t
std::array< uint32_t, 3 > version_t
Version is an array of 3 integers.
Definition
VersionMin.hpp:37
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