15#ifndef LIEF_PE_RESOURCE_VERSION_H
16#define LIEF_PE_RESOURCE_VERSION_H
69 WINDOWS16 = 0x00000001,
78 WINDOWS32 = 0x00000004,
81 DOS_WINDOWS16 = DOS | WINDOWS16,
84 DOS_WINDOWS32 = DOS | WINDOWS32,
88 OS216_PM16 = OS216 | PM16,
92 OS232_PM32 = OS232 | PM32,
95 NT_WINDOWS32 = NT | WINDOWS32,
100 UNKNOWN = 0x00000000,
120 STATIC_LIB = 0x00000007,
123 static constexpr auto DRV_K = uint64_t(1) << 33;
124 static constexpr auto FONT_K = uint64_t(1) << 34;
128 UNKNOWN = 0x00000000,
144 DRV_INSTALLABLE = 0x00000008 |
DRV_K,
150 DRV_INPUTMETHOD = 0x0000000B |
DRV_K,
153 DRV_VERSIONED_PRINTER = 0x0000000C,
173 INFO_INFERRED = 0x00000010,
177 PATCHED = 0x00000004,
180 PRERELEASE = 0x00000002,
184 PRIVATEBUILD = 0x00000008,
190 SPECIALBUILD = 0x00000020,
258 std::vector<FILE_FLAGS>
flags()
const;
281 os << info.to_string();
296 return fixed_file_info_;
300 return fixed_file_info_;
305 if (
auto& info = string_file_info_) {
306 return &info.value();
317 if (
auto& info = var_file_info_) {
318 return &info.value();
331 const std::u16string&
key()
const {
344 key_ = std::move(value);
353 var_file_info_ = std::move(info);
358 string_file_info_ = std::move(info);
383 std::optional<ResourceStringFileInfo> string_file_info_;
384 std::optional<ResourceVarFileInfo> var_file_info_;
Class that is used to a read stream of data from different sources.
Definition BinaryStream.hpp:34
Class which represents a Data Node in the PE resources tree.
Definition ResourceData.hpp:35
Representation of the StringFileInfo structure.
Definition ResourceStringFileInfo.hpp:39
Representation of the VarFileInfo structure.
Definition ResourceVarFileInfo.hpp:38
const fixed_file_info_t & file_info() const
Return the fixed file info (VS_FIXEDFILEINFO).
Definition ResourceVersion.hpp:295
ResourceVersion(ResourceVersion &&)=default
ResourceVersion & operator=(const ResourceVersion &)=default
const ResourceVarFileInfo * var_file_info() const
Definition ResourceVersion.hpp:348
fixed_file_info_t & file_info()
Definition ResourceVersion.hpp:299
const ResourceStringFileInfo * string_file_info() const
Definition ResourceVersion.hpp:311
~ResourceVersion() override=default
ResourceVersion & string_file_info(ResourceStringFileInfo info)
Definition ResourceVersion.hpp:357
std::string key_u8() const
The key as an utf8 string.
ResourceVersion(const ResourceVersion &)=default
static result< ResourceVersion > parse(const ResourceData &node)
ResourceVersion & key(std::u16string value)
Definition ResourceVersion.hpp:343
ResourceVarFileInfo * var_file_info()
Return the VarFileInfo element.
Definition ResourceVersion.hpp:316
ResourceStringFileInfo * string_file_info()
Return the StringFileInfo element.
Definition ResourceVersion.hpp:304
ResourceVersion & operator=(ResourceVersion &&)=default
ResourceVersion & var_file_info(ResourceVarFileInfo info)
Definition ResourceVersion.hpp:352
friend std::ostream & operator<<(std::ostream &os, const ResourceVersion &version)
uint16_t type() const
The type of data in the version resource.
Definition ResourceVersion.hpp:326
ResourceVersion & type(uint16_t value)
Definition ResourceVersion.hpp:338
static result< ResourceVersion > parse(BinaryStream &stream)
const std::u16string & key() const
The Unicode string L"VS_VERSION_INFO".
Definition ResourceVersion.hpp:331
static result< ResourceVersion > parse(const uint8_t *p, size_t sz)
void accept(Visitor &visitor) const override
Definition Visitor.hpp:211
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:118
Wrapper that contains an Object (T) or an error.
Definition errors.hpp:78
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:31
const char * to_string(CODE_PAGES e)
LIEF namespace.
Definition Abstract/Binary.hpp:41
lief_version_t version()
Return the current version.
This structure represents the VS_FIXEDFILEINFO structure defined in verrsrc.h.
Definition ResourceVersion.hpp:47
FILE_FLAGS
Definition ResourceVersion.hpp:165
VERSION_OS
Definition ResourceVersion.hpp:48
uint32_t file_date_ms
The most significant 32 bits of the file's 64-bit binary creation date and time stamp.
Definition ResourceVersion.hpp:246
uint32_t file_subtype
The function of the file. The possible values depend on the value of file_type.
Definition ResourceVersion.hpp:242
FILE_TYPE_DETAILS file_type_details() const
Definition ResourceVersion.hpp:260
uint32_t product_version_ms
The most significant 32 bits of the binary version number of the product with which this file was dis...
Definition ResourceVersion.hpp:217
uint32_t file_flags
Contains a bitmask that specifies the Boolean attributes of the file. This member can include one or ...
Definition ResourceVersion.hpp:230
uint32_t signature
Contains the value 0xFEEF04BD. This is used with the szKey member of the VS_VERSIONINFO structure whe...
Definition ResourceVersion.hpp:197
uint32_t file_version_ls
The least significant 32 bits of the file's binary version number. This member is used with file_vers...
Definition ResourceVersion.hpp:212
friend std::ostream & operator<<(std::ostream &os, const fixed_file_info_t &info)
Definition ResourceVersion.hpp:279
uint32_t file_version_ms
The most significant 32 bits of the file's binary version number. This member is used with file_versi...
Definition ResourceVersion.hpp:207
static constexpr auto DRV_K
Definition ResourceVersion.hpp:123
FILE_TYPE
Definition ResourceVersion.hpp:98
@ FONT
The file contains a font. If dwFileType is VFT_FONT, dwFileSubtype contains a more specific descripti...
Definition ResourceVersion.hpp:114
@ DRV
The file contains a device driver. If dwFileType is VFT_DRV, dwFileSubtype contains a more specific d...
Definition ResourceVersion.hpp:110
std::vector< FILE_FLAGS > flags() const
List of FILE_FLAGS.
uint32_t product_version_ls
The least significant 32 bits of the binary version number of the product with which this file was di...
Definition ResourceVersion.hpp:222
uint32_t file_type
The general type of file. This member can be one of the values specified in FILE_TYPE....
Definition ResourceVersion.hpp:238
uint32_t struct_version
The binary version number of this structure. The high-order word of this member contains the major ve...
Definition ResourceVersion.hpp:202
std::string to_string() const
FILE_TYPE_DETAILS
Definition ResourceVersion.hpp:126
@ UNKNOWN
The type is unknown by the system.
Definition ResourceVersion.hpp:128
uint32_t file_os
The operating system for which this file was designed. This member can be one of the values specified...
Definition ResourceVersion.hpp:234
uint32_t file_date_ls
The least significant 32 bits of the file's 64-bit binary creation date and time stamp.
Definition ResourceVersion.hpp:250
static constexpr auto FONT_K
Definition ResourceVersion.hpp:124
bool has(FILE_FLAGS f) const
Check if the given FILE_FLAGS is present.
Definition ResourceVersion.hpp:253
static constexpr auto SIGNATURE_VALUE
Definition ResourceVersion.hpp:193
uint32_t file_flags_mask
Contains a bitmask that specifies the valid bits in file_flags. A bit is valid only if it was defined...
Definition ResourceVersion.hpp:226
#define LIEF_API
Definition visibility.h:44