16#ifndef LIEF_PE_RESOURCE_VERSION_H
17#define LIEF_PE_RESOURCE_VERSION_H
120 static constexpr auto DRV_K = uint64_t(1) << 33;
121 static constexpr auto FONT_K = uint64_t(1) << 34;
255 std::vector<FILE_FLAGS>
flags()
const;
279 os << info.to_string();
294 return fixed_file_info_;
298 return fixed_file_info_;
303 if (
auto& info = string_file_info_) {
304 return &info.value();
315 if (
auto& info = var_file_info_) {
316 return &info.value();
329 const std::u16string&
key()
const {
342 key_ = std::move(value);
350 var_file_info_ = std::move(info);
355 string_file_info_ = std::move(info);
Class that is used to a read stream of data from different sources.
Definition BinaryStream.hpp:33
Class which represents a Data Node in the PE resources tree.
Definition ResourceData.hpp:33
Representation of the StringFileInfo structure.
Definition ResourceStringFileInfo.hpp:40
Representation of the VarFileInfo structure.
Definition ResourceVarFileInfo.hpp:39
const fixed_file_info_t & file_info() const
Return the fixed file info (VS_FIXEDFILEINFO).
Definition ResourceVersion.hpp:293
ResourceVersion(ResourceVersion &&)=default
ResourceVersion & operator=(const ResourceVersion &)=default
const ResourceVarFileInfo * var_file_info() const
Definition ResourceVersion.hpp:345
fixed_file_info_t & file_info()
Definition ResourceVersion.hpp:297
const ResourceStringFileInfo * string_file_info() const
Definition ResourceVersion.hpp:309
~ResourceVersion() override=default
ResourceVersion & string_file_info(ResourceStringFileInfo info)
Definition ResourceVersion.hpp:354
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:341
ResourceVarFileInfo * var_file_info()
Return the VarFileInfo element.
Definition ResourceVersion.hpp:314
ResourceStringFileInfo * string_file_info()
Return the StringFileInfo element.
Definition ResourceVersion.hpp:302
ResourceVersion & operator=(ResourceVersion &&)=default
ResourceVersion & var_file_info(ResourceVarFileInfo info)
Definition ResourceVersion.hpp:349
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:324
ResourceVersion & type(uint16_t value)
Definition ResourceVersion.hpp:336
static result< ResourceVersion > parse(BinaryStream &stream)
const std::u16string & key() const
The Unicode string L"VS_VERSION_INFO".
Definition ResourceVersion.hpp:329
static result< ResourceVersion > parse(const uint8_t *p, size_t sz)
void accept(Visitor &visitor) const override
Definition Visitor.hpp:210
Definition optional.hpp:23
Namespace related to the LIEF's PE module.
Definition Abstract/Header.hpp:32
const char * to_string(CODE_PAGES e)
LIEF namespace.
Definition Abstract/Binary.hpp:40
result< ok_t > ok_error_t
Opaque structure that is used by LIEF to avoid writing result<void> f(...). Instead,...
Definition errors.hpp:109
lief_version_t version()
Return the current version.
tl::expected< T, lief_errors > result
Wrapper that contains an Object (T) or an error.
Definition errors.hpp:75
This structure represents the VS_FIXEDFILEINFO structure defined in verrsrc.h.
Definition ResourceVersion.hpp:45
FILE_FLAGS
Definition ResourceVersion.hpp:162
@ PRERELEASE
The file is a development version, not a commercially released product.
Definition ResourceVersion.hpp:177
@ PATCHED
The file has been modified and is not identical to the original shipping file of the same version num...
Definition ResourceVersion.hpp:174
@ INFO_INFERRED
The file's version structure was created dynamically; therefore, some of the members in this structur...
Definition ResourceVersion.hpp:170
@ PRIVATEBUILD
The file was not built using standard release procedures. If this flag is set, the StringFileInfo str...
Definition ResourceVersion.hpp:181
@ SPECIALBUILD
The file was built by the original company using standard release procedures but is a variation of th...
Definition ResourceVersion.hpp:187
@ DEBUG
The file contains debugging information or is compiled with debugging features enabled.
Definition ResourceVersion.hpp:165
VERSION_OS
Definition ResourceVersion.hpp:46
@ NT_WINDOWS32
The file was designed for Windows NT.
Definition ResourceVersion.hpp:92
@ PM32
The file was designed for 32-bit Presentation Manager.
Definition ResourceVersion.hpp:72
@ DOS_WINDOWS32
The file was designed for 32-bit Windows running on MS-DOS.
Definition ResourceVersion.hpp:81
@ OS216_PM16
The file was designed for 16-bit Presentation Manager running on 16-bit OS/2.
Definition ResourceVersion.hpp:85
@ UNKNOWN
The operating system for which the file was designed is unknown to the system.
Definition ResourceVersion.hpp:48
@ OS232_PM32
The file was designed for 32-bit Presentation Manager running on 32-bit OS/2.
Definition ResourceVersion.hpp:89
@ OS232
The file was designed for 32-bit OS/2.
Definition ResourceVersion.hpp:57
@ DOS_WINDOWS16
The file was designed for 16-bit Windows running on MS-DOS.
Definition ResourceVersion.hpp:78
@ DOS
The file was designed for MS-DOS.
Definition ResourceVersion.hpp:51
@ WINCE
The file was designed for Windows CE (Windows Embedded Compact).
Definition ResourceVersion.hpp:63
@ OS216
The file was designed for 16-bit OS/2.
Definition ResourceVersion.hpp:54
@ NT
The file was designed for Windows NT.
Definition ResourceVersion.hpp:60
@ WINDOWS16
The file was designed for 16-bit Windows.
Definition ResourceVersion.hpp:66
@ WINDOWS32
The file was designed for 32-bit Windows.
Definition ResourceVersion.hpp:75
@ PM16
The file was designed for 16-bit Presentation Manager.
Definition ResourceVersion.hpp:69
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:243
uint32_t file_subtype
The function of the file. The possible values depend on the value of file_type.
Definition ResourceVersion.hpp:239
FILE_TYPE_DETAILS file_type_details() const
Definition ResourceVersion.hpp:257
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:214
uint32_t file_flags
Contains a bitmask that specifies the Boolean attributes of the file. This member can include one or ...
Definition ResourceVersion.hpp:227
uint32_t signature
Contains the value 0xFEEF04BD. This is used with the szKey member of the VS_VERSIONINFO structure whe...
Definition ResourceVersion.hpp:194
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:209
friend std::ostream & operator<<(std::ostream &os, const fixed_file_info_t &info)
Definition ResourceVersion.hpp:277
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:204
static constexpr auto DRV_K
Definition ResourceVersion.hpp:120
FILE_TYPE
Definition ResourceVersion.hpp:95
@ APP
The file contains an application.
Definition ResourceVersion.hpp:100
@ FONT
The file contains a font. If dwFileType is VFT_FONT, dwFileSubtype contains a more specific descripti...
Definition ResourceVersion.hpp:111
@ DLL
The file contains a DLL.
Definition ResourceVersion.hpp:103
@ STATIC_LIB
The file contains a static-link library.
Definition ResourceVersion.hpp:117
@ DRV
The file contains a device driver. If dwFileType is VFT_DRV, dwFileSubtype contains a more specific d...
Definition ResourceVersion.hpp:107
@ VXD
The file contains a virtual device.
Definition ResourceVersion.hpp:114
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:219
uint32_t file_type
The general type of file. This member can be one of the values specified in FILE_TYPE....
Definition ResourceVersion.hpp:235
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:199
std::string to_string() const
FILE_TYPE_DETAILS
Definition ResourceVersion.hpp:123
@ DRV_INSTALLABLE
The file contains an installable driver.
Definition ResourceVersion.hpp:141
@ DRV_LANGUAGE
The file contains a language driver.
Definition ResourceVersion.hpp:131
@ DRV_DISPLAY
The file contains a display driver.
Definition ResourceVersion.hpp:133
@ DRV_SOUND
The file contains a sound driver.
Definition ResourceVersion.hpp:143
@ UNKNOWN
The type is unknown by the system.
Definition ResourceVersion.hpp:125
@ DRV_MOUSE
The file contains a mouse driver.
Definition ResourceVersion.hpp:135
@ DRV_KEYBOARD
The file contains a keyboard driver.
Definition ResourceVersion.hpp:129
@ DRV_PRINTER
The file contains a printer driver.
Definition ResourceVersion.hpp:127
@ FONT_TRUETYPE
The file contains a TrueType font.
Definition ResourceVersion.hpp:159
@ FONT_VECTOR
The file contains a vector font.
Definition ResourceVersion.hpp:156
@ DRV_VERSIONED_PRINTER
The file contains a versioned printer driver.
Definition ResourceVersion.hpp:150
@ FONT_RASTER
The file contains a raster font.
Definition ResourceVersion.hpp:153
@ DRV_INPUTMETHOD
Definition ResourceVersion.hpp:147
@ DRV_NETWORK
The file contains a network driver.
Definition ResourceVersion.hpp:137
@ DRV_SYSTEM
The file contains a system driver.
Definition ResourceVersion.hpp:139
@ DRV_COMM
The file contains a communications driver.
Definition ResourceVersion.hpp:145
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:231
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:247
static constexpr auto FONT_K
Definition ResourceVersion.hpp:121
bool has(FILE_FLAGS f) const
Check if the given FILE_FLAGS is present.
Definition ResourceVersion.hpp:250
static constexpr auto SIGNATURE_VALUE
Definition ResourceVersion.hpp:190
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:223
#define LIEF_API
Definition visibility.h:41