LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
osx/Host.hpp
Go to the documentation of this file.
1/* Copyright 2017 - 2026 R. Thomas
2 *
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 * http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15#ifndef LIEF_RUNTIME_OSX_HOST_H
16#define LIEF_RUNTIME_OSX_HOST_H
17#include "LIEF/visibility.h"
18#include <cstdint>
19#include <ostream>
20#include <string>
21
22
24
26 public:
28 uint32_t major = 0;
29 uint32_t minor = 0;
30 uint32_t patch = 0;
31
32 version_t(uint32_t major, uint32_t minor, uint32_t patch) :
33 major{major},
34 minor{minor},
35 patch{patch} {}
36
37 bool operator<=(const version_t& rhs) const;
38 bool operator>(const version_t& rhs) const {
39 return !(*this <= rhs);
40 }
41
42 bool operator>=(const version_t& rhs) const;
43 bool operator<(const version_t& rhs) const {
44 return !(*this >= rhs);
45 }
46
47 bool operator==(const version_t& other) const;
48 bool operator!=(const version_t& other) const {
49 return !(*this == other);
50 }
51
52 std::string to_string() const;
53
54 static const version_t& BigSur();
55 static const version_t& Monterey();
56 static const version_t& Ventura();
57 static const version_t& Sonoma();
58 static const version_t& Sequoia();
59 static const version_t& Tahoe();
60
61 LIEF_API friend std::ostream& operator<<(std::ostream& os,
62 const version_t version) {
63 os << version.to_string();
64 return os;
65 }
66 };
67
69 static std::string os_version_name();
70
73
78 static bool is_sip_enabled();
79};
80
81
82}
83
84
85#endif
Definition osx/Host.hpp:25
static std::string os_version_name()
The OS version string (e.g. Version 26.2 (Build 25C56)).
static bool is_sip_enabled()
Whether System Integrity Protection (SIP) is enabled on this host.
static version_t os_version()
The OS version (e.g. 13.0.0).
Definition osx/Host.hpp:23
lief_version_t version()
Return the current version.
Definition osx/Host.hpp:27
static const version_t & Tahoe()
bool operator==(const version_t &other) const
bool operator<(const version_t &rhs) const
Definition osx/Host.hpp:43
uint32_t major
Definition osx/Host.hpp:28
bool operator<=(const version_t &rhs) const
version_t(uint32_t major, uint32_t minor, uint32_t patch)
Definition osx/Host.hpp:32
static const version_t & BigSur()
bool operator>=(const version_t &rhs) const
friend std::ostream & operator<<(std::ostream &os, const version_t version)
Definition osx/Host.hpp:61
uint32_t patch
Definition osx/Host.hpp:30
static const version_t & Ventura()
static const version_t & Sonoma()
static const version_t & Sequoia()
bool operator!=(const version_t &other) const
Definition osx/Host.hpp:48
uint32_t minor
Definition osx/Host.hpp:29
static const version_t & Monterey()
bool operator>(const version_t &rhs) const
Definition osx/Host.hpp:38
#define LIEF_API
Definition visibility.h:44