Class CorLibTypeFactory
- Namespace
- AsmResolver.DotNet.Signatures
- Assembly
- AsmResolver.DotNet.dll
Provides a mechanism for obtaining commonly used element type signatures in various blob signatures, defined in the common object runtime library, such as mscorlib (for .NET framework) or System.Private.CorLib (for .NET Core).
public class CorLibTypeFactory
- Inheritance
-
CorLibTypeFactory
- Inherited Members
Constructors
CorLibTypeFactory(IResolutionScope)
Creates a new factory with the provided resolution scope referencing a common object runtime library.
public CorLibTypeFactory(IResolutionScope corLibScope)
Parameters
corLibScope
IResolutionScopeThe reference to the common object runtime library.
Properties
Boolean
Gets the element type signature for bool.
public CorLibTypeSignature Boolean { get; }
Property Value
Byte
Gets the element type signature for byte.
public CorLibTypeSignature Byte { get; }
Property Value
Char
Gets the element type signature for char.
public CorLibTypeSignature Char { get; }
Property Value
CorLibScope
Gets the resolution scope referencing the common object runtime (COR) library.
public IResolutionScope CorLibScope { get; }
Property Value
Double
Gets the element type signature for double.
public CorLibTypeSignature Double { get; }
Property Value
Int16
Gets the element type signature for short.
public CorLibTypeSignature Int16 { get; }
Property Value
Int32
Gets the element type signature for int.
public CorLibTypeSignature Int32 { get; }
Property Value
Int64
Gets the element type signature for long.
public CorLibTypeSignature Int64 { get; }
Property Value
IntPtr
Gets the element type signature for nint.
public CorLibTypeSignature IntPtr { get; }
Property Value
Object
Gets the element type signature for object.
public CorLibTypeSignature Object { get; }
Property Value
SByte
Gets the element type signature for sbyte.
public CorLibTypeSignature SByte { get; }
Property Value
Single
Gets the element type signature for float.
public CorLibTypeSignature Single { get; }
Property Value
String
Gets the element type signature for string.
public CorLibTypeSignature String { get; }
Property Value
TypedReference
Gets the element type signature for TypedReference.
public CorLibTypeSignature TypedReference { get; }
Property Value
UInt16
Gets the element type signature for ushort.
public CorLibTypeSignature UInt16 { get; }
Property Value
UInt32
Gets the element type signature for uint.
public CorLibTypeSignature UInt32 { get; }
Property Value
UInt64
Gets the element type signature for ulong.
public CorLibTypeSignature UInt64 { get; }
Property Value
UIntPtr
Gets the element type signature for nuint.
public CorLibTypeSignature UIntPtr { get; }
Property Value
Void
Gets the element type signature for void.
public CorLibTypeSignature Void { get; }
Property Value
Methods
CreateMscorlib40TypeFactory(ModuleDefinition)
Creates a new type factory that references mscorlib 4.0.0.0.
public static CorLibTypeFactory CreateMscorlib40TypeFactory(ModuleDefinition module)
Parameters
module
ModuleDefinition
Returns
- CorLibTypeFactory
The factory.
ExtractDotNetRuntimeInfo()
Maps the corlib reference to the appropriate .NET or .NET Core version.
public DotNetRuntimeInfo ExtractDotNetRuntimeInfo()
Returns
- DotNetRuntimeInfo
The runtime information.
FromElementType(ElementType)
Obtains the common object runtime type signature from its element type.
public CorLibTypeSignature? FromElementType(ElementType elementType)
Parameters
elementType
ElementTypeThe element type.
Returns
- CorLibTypeSignature
The corlib type, or
null
if none was found.
FromName(string?, string?)
Obtains the common object runtime type signature by its full name.
public CorLibTypeSignature? FromName(string? ns, string? name)
Parameters
Returns
- CorLibTypeSignature
The corlib type, or
null
if none was found.
FromType(ITypeDescriptor)
Transforms the provided type descriptor to a common object runtime type signature.
public CorLibTypeSignature? FromType(ITypeDescriptor type)
Parameters
type
ITypeDescriptorThe type to transform to a corlib type signature.
Returns
- CorLibTypeSignature
The corlib type, or
null
if none was found.