Class GuidStream
- Namespace
- AsmResolver.PE.DotNet.Metadata
- Assembly
- AsmResolver.PE.dll
Represents the metadata stream containing GUIDs referenced by entries in the tables stream.
public abstract class GuidStream : MetadataHeap, IMetadataStream, ISegment, IOffsetProvider, IWritable
- Inheritance
-
GuidStream
- Implements
- Derived
- Inherited Members
Remarks
Like most metadata streams, the GUID stream does not necessarily contain just valid strings. It can contain (garbage) data that is never referenced by any of the tables in the tables stream. The only guarantee that the GUID heap provides, is that any blob index in the tables stream is the start address (relative to the start of the GUID stream) of a GUID.
Constructors
GuidStream()
Initializes the GUID stream with its default name.
protected GuidStream()
GuidStream(string)
Initializes the GUID stream with a custom name.
protected GuidStream(string name)
Parameters
name
stringThe name of the stream.
Fields
DefaultName
The default name of a GUID stream, as described in the specification provided by ECMA-335.
public const string DefaultName = "#GUID"
Field Value
GuidSize
The size of a single GUID in the GUID stream.
public const int GuidSize = 16
Field Value
Methods
EnumerateGuids()
Performs a linear sweep on the stream and yields all GUIDs that are stored.
public abstract IEnumerable<Guid> EnumerateGuids()
Returns
- IEnumerable<Guid>
The GUID enumerator.
GetGuidByIndex(uint)
Gets a GUID by its GUID index.
public abstract Guid GetGuidByIndex(uint index)
Parameters
index
uintThe offset into the heap to start reading.
Returns
- Guid
The GUID.
TryFindGuidIndex(Guid, out uint)
Searches the stream for the provided GUID.
public abstract bool TryFindGuidIndex(Guid guid, out uint index)
Parameters
guid
GuidThe GUID to search for.
index
uintWhen the function returns
true
, contains the index at which the GUID was found.
Returns
- bool
true
if the GUID index was found,false
otherwise.