Class VersionInfoResource
- Namespace
- AsmResolver.PE.Win32Resources.Version
- Assembly
- AsmResolver.PE.Win32Resources.dll
Represents a native version resource file.
public class VersionInfoResource : VersionTableEntry, ISegment, IOffsetProvider, IWritable, IWin32Resource
- Inheritance
-
VersionInfoResource
- Implements
- Inherited Members
Constructors
VersionInfoResource()
Creates a new empty version info resource targeting the English (United States) language identifier.
public VersionInfoResource()
VersionInfoResource(int)
Creates a new empty version info resource.
public VersionInfoResource(int lcid)
Parameters
lcidintThe language identifier the resource version info is targeting.
Fields
VsVersionInfoKey
The name of the root object of the native version resource file.
public const string VsVersionInfoKey = "VS_VERSION_INFO"
Field Value
Properties
FixedVersionInfo
Gets the fixed version info stored in this version resource.
public FixedVersionInfo FixedVersionInfo { get; set; }
Property Value
this[string]
Gets or sets a version table entry by its name.
public VersionTableEntry this[string name] { get; set; }
Parameters
namestringThe name of the child.
Property Value
Key
Gets the name of the table.
public override string Key { get; }
Property Value
Lcid
Gets the language identifier the resource version info is targeting.
public int Lcid { get; }
Property Value
ValueType
Gets the value type of the table.
protected override VersionTableValueType ValueType { get; }
Property Value
Methods
AddEntry(VersionTableEntry)
Adds (or overrides the existing entry with the same name) to the version resource.
public void AddEntry(VersionTableEntry entry)
Parameters
entryVersionTableEntryThe entry to add.
FindAllFromDirectory(ResourceDirectory)
Obtains all version info resources from the provided root win32 resources directory.
public static IEnumerable<VersionInfoResource?> FindAllFromDirectory(ResourceDirectory rootDirectory)
Parameters
rootDirectoryResourceDirectoryThe root resources directory to extract the version info from.
Returns
- IEnumerable<VersionInfoResource>
The version info resource, or
nullif none was found.
FromDirectory(ResourceDirectory)
Obtains the first version info resource from the provided root win32 resources directory.
public static VersionInfoResource? FromDirectory(ResourceDirectory rootDirectory)
Parameters
rootDirectoryResourceDirectoryThe root resources directory to extract the version info from.
Returns
- VersionInfoResource
The version info resource, or
nullif none was found.
FromDirectory(ResourceDirectory, int)
Obtains the version info resource from the provided root win32 resources directory.
public static VersionInfoResource? FromDirectory(ResourceDirectory rootDirectory, int lcid)
Parameters
rootDirectoryResourceDirectoryThe root resources directory to extract the version info from.
lcidintThe language identifier to get the version info from.
Returns
- VersionInfoResource
The version info resource, or
nullif none was found.
FromReader(ref BinaryStreamReader)
Reads a version resource from an input stream.
public static VersionInfoResource FromReader(ref BinaryStreamReader reader)
Parameters
readerBinaryStreamReaderThe input stream.
Returns
- VersionInfoResource
The parsed version resource.
Exceptions
- FormatException
Occurs when the input stream does not point to a valid version resource.
FromReader(int, ref BinaryStreamReader)
Reads a version resource from an input stream.
public static VersionInfoResource FromReader(int lcid, ref BinaryStreamReader reader)
Parameters
lcidintThe language identifier to get the version info from.
readerBinaryStreamReaderThe input stream.
Returns
- VersionInfoResource
The parsed version resource.
Exceptions
- FormatException
Occurs when the input stream does not point to a valid version resource.
FromResourceData(ResourceData)
Obtains the version info resource from the provided resource data entry.
public static VersionInfoResource FromResourceData(ResourceData dataEntry)
Parameters
dataEntryResourceDataThe data entry to extract the version info from.
Returns
- VersionInfoResource
The extracted version info resource.
GetChild<TEntry>(string)
Gets a version table entry by its name.
public TEntry GetChild<TEntry>(string name) where TEntry : VersionTableEntry
Parameters
namestringThe name of the child.
Returns
- TEntry
The entry.
Type Parameters
TEntryThe type of the version table entry to lookup.
GetChildren()
Gets a collection of entries stored in the version resource.
public IEnumerable<VersionTableEntry> GetChildren()
Returns
GetPhysicalSize()
Computes the number of bytes that the structure contains.
public override uint GetPhysicalSize()
Returns
- uint
The number of bytes.
GetValueLength()
Gets the length of the raw value.
protected override uint GetValueLength()
Returns
- uint
The raw value.
InsertIntoDirectory(ResourceDirectory)
Serializes the win32 resource to the provided root win32 resource data directory.
public void InsertIntoDirectory(ResourceDirectory rootDirectory)
Parameters
rootDirectoryResourceDirectoryThe root directory to submit the changes to.
RemoveEntry(string)
Remove an entry by its name.
public bool RemoveEntry(string name)
Parameters
namestringThe name of the child to remove..
Returns
- bool
trueif the name existed in the table and was removed successfully,falseotherwise.
WriteValue(BinaryStreamWriter)
Writes the value field of the version structure.
protected override void WriteValue(BinaryStreamWriter writer)
Parameters
writerBinaryStreamWriterThe output stream.