LIEF: Library to Instrument Executable Formats Version 2.0.0
Loading...
Searching...
No Matches
windows/Host.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_RUNTIME_WINDOWS_HOST_H
17#define LIEF_RUNTIME_WINDOWS_HOST_H
18#include "LIEF/visibility.h"
19#include <cstdint>
20#include <ostream>
21#include <string>
22
23
25
28 public:
30 uint32_t major = 0;
31 uint32_t minor = 0;
32 uint32_t build_number = 0;
33
34 version_t() = default;
35
36 version_t(uint32_t major, uint32_t minor, uint32_t build_number) :
37 major(major),
38 minor(minor),
40
41 bool operator<=(const version_t& rhs) const;
42 bool operator>(const version_t& rhs) const {
43 return !(*this <= rhs);
44 }
45
46 bool operator>=(const version_t& rhs) const;
47 bool operator<(const version_t& rhs) const {
48 return !(*this >= rhs);
49 }
50
51 bool operator==(const version_t& other) const;
52 bool operator!=(const version_t& other) const {
53 return !(*this == other);
54 }
55
56
57 std::string to_string() const;
58 LIEF_API friend std::ostream& operator<<(std::ostream& os,
59 const version_t& version) {
60 os << version.to_string();
61 return os;
62 }
63 };
64
67};
68
69
70}
71
72
73#endif
This class exposes Windows-specific host information.
Definition windows/Host.hpp:27
static version_t version()
Return the Windows version (e.g., 10.0.26200).
Definition windows/Host.hpp:24
Definition windows/Host.hpp:29
uint32_t minor
Definition windows/Host.hpp:31
uint32_t major
Definition windows/Host.hpp:30
bool operator>=(const version_t &rhs) const
bool operator==(const version_t &other) const
version_t(uint32_t major, uint32_t minor, uint32_t build_number)
Definition windows/Host.hpp:36
friend std::ostream & operator<<(std::ostream &os, const version_t &version)
Definition windows/Host.hpp:58
bool operator<(const version_t &rhs) const
Definition windows/Host.hpp:47
uint32_t build_number
Definition windows/Host.hpp:32
bool operator!=(const version_t &other) const
Definition windows/Host.hpp:52
bool operator>(const version_t &rhs) const
Definition windows/Host.hpp:42
bool operator<=(const version_t &rhs) const
#define LIEF_API
Definition visibility.h:45