Пример #1
0
 /// <summary>
 /// Reads a single security declaration row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the security declaration table.</param>
 /// <returns>The row.</returns>
 public static SecurityDeclarationRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new SecurityDeclarationRow(
                (SecurityAction)reader.ReadUInt16(),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size)));
 }
Пример #2
0
 /// <summary>
 /// Reads a single file row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the file table.</param>
 /// <returns>The row.</returns>
 public static FileReferenceRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new FileReferenceRow(
                (FileAttributes)reader.ReadUInt32(),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size)));
 }
Пример #3
0
 /// <summary>
 /// Reads a single method semantics row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the method semantics table.</param>
 /// <returns>The row.</returns>
 public static MethodSemanticsRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new MethodSemanticsRow(
                (MethodSemanticsAttributes)reader.ReadUInt16(),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size)));
 }
Пример #4
0
 /// <summary>
 /// Reads a single custom attribute row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the custom attribute table.</param>
 /// <returns>The row.</returns>
 public static CustomAttributeRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new CustomAttributeRow(
                reader.ReadIndex((IndexSize)layout.Columns[0].Size),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size)));
 }
 /// <summary>
 /// Reads a single method implementation row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the method implementation table.</param>
 /// <returns>The row.</returns>
 public static MethodImplementationRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new MethodImplementationRow(
                reader.ReadIndex((IndexSize)layout.Columns[0].Size),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size)));
 }
Пример #6
0
 /// <summary>
 /// Reads a single type reference row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the type reference table.</param>
 /// <returns>The row.</returns>
 public static TypeReferenceRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new TypeReferenceRow(
                reader.ReadIndex((IndexSize)layout.Columns[0].Size),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size)));
 }
Пример #7
0
 /// <summary>
 /// Reads a single field definition row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the field definition table.</param>
 /// <returns>The row.</returns>
 public static FieldDefinitionRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new FieldDefinitionRow(
                (FieldAttributes)reader.ReadUInt16(),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size)));
 }
Пример #8
0
 /// <summary>
 /// Reads a single generic parameter row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the generic parameter table.</param>
 /// <returns>The row.</returns>
 public static GenericParameterRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new GenericParameterRow(
                reader.ReadUInt16(),
                (GenericParameterAttributes)reader.ReadUInt16(),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size),
                reader.ReadIndex((IndexSize)layout.Columns[3].Size)));
 }
Пример #9
0
 /// <summary>
 /// Reads a single constant row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the constants table.</param>
 /// <returns>The row.</returns>
 public static ConstantRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new ConstantRow(
                (ElementType)reader.ReadByte(),
                reader.ReadByte(),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size),
                reader.ReadIndex((IndexSize)layout.Columns[3].Size)));
 }
 /// <summary>
 /// Reads a single implementation map row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the implementation map table.</param>
 /// <returns>The row.</returns>
 public static ImplementationMapRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new ImplementationMapRow(
                (ImplementationMapAttributes)reader.ReadUInt16(),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size),
                reader.ReadIndex((IndexSize)layout.Columns[3].Size)));
 }
Пример #11
0
 /// <summary>
 /// Reads a single manifest resource row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the manifest resource table.</param>
 /// <returns>The row.</returns>
 public static ManifestResourceRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new ManifestResourceRow(
                reader.ReadUInt32(),
                (ManifestResourceAttributes)reader.ReadUInt32(),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size),
                reader.ReadIndex((IndexSize)layout.Columns[3].Size)));
 }
Пример #12
0
 /// <summary>
 /// Reads a single exported type row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the exported type table.</param>
 /// <returns>The row.</returns>
 public static ExportedTypeRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new ExportedTypeRow(
                (TypeAttributes)reader.ReadUInt32(),
                reader.ReadUInt32(),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size),
                reader.ReadIndex((IndexSize)layout.Columns[3].Size),
                reader.ReadIndex((IndexSize)layout.Columns[4].Size)));
 }
Пример #13
0
 /// <summary>
 /// Reads a single module definition row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the module definition table.</param>
 /// <returns>The row.</returns>
 public static ModuleDefinitionRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new ModuleDefinitionRow(
                reader.ReadUInt16(),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size),
                reader.ReadIndex((IndexSize)layout.Columns[3].Size),
                reader.ReadIndex((IndexSize)layout.Columns[4].Size)));
 }
Пример #14
0
 /// <summary>
 /// Reads a single type definition row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the type definition table.</param>
 /// <returns>The row.</returns>
 public static TypeDefinitionRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new TypeDefinitionRow(
                (TypeAttributes)reader.ReadUInt32(),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size),
                reader.ReadIndex((IndexSize)layout.Columns[3].Size),
                reader.ReadIndex((IndexSize)layout.Columns[4].Size),
                reader.ReadIndex((IndexSize)layout.Columns[5].Size)));
 }
 /// <summary>
 /// Reads a single method definition row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the method definition table.</param>
 /// <param name="referenceResolver">The resolver to use for resolving the virtual address of the method body.</param>
 /// <returns>The row.</returns>
 public static MethodDefinitionRow FromReader(IBinaryStreamReader reader, TableLayout layout, ISegmentReferenceResolver referenceResolver)
 {
     return(new MethodDefinitionRow(
                referenceResolver.GetReferenceToRva(reader.ReadUInt32()),
                (MethodImplAttributes)reader.ReadUInt16(),
                (MethodAttributes)reader.ReadUInt16(),
                reader.ReadIndex((IndexSize)layout.Columns[3].Size),
                reader.ReadIndex((IndexSize)layout.Columns[4].Size),
                reader.ReadIndex((IndexSize)layout.Columns[5].Size)));
 }
Пример #16
0
 /// <summary>
 /// Reads a single method definition row from an input stream.
 /// </summary>
 /// <param name="context">The reader context.</param>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the method definition table.</param>
 /// <returns>The row.</returns>
 public static MethodDefinitionRow FromReader(PEReaderContext context, IBinaryStreamReader reader, TableLayout layout)
 {
     return(new MethodDefinitionRow(
                context.File.GetReferenceToRva(reader.ReadUInt32()),
                (MethodImplAttributes)reader.ReadUInt16(),
                (MethodAttributes)reader.ReadUInt16(),
                reader.ReadIndex((IndexSize)layout.Columns[3].Size),
                reader.ReadIndex((IndexSize)layout.Columns[4].Size),
                reader.ReadIndex((IndexSize)layout.Columns[5].Size)));
 }
Пример #17
0
 /// <summary>
 /// Reads a single assembly definition row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the assembly definition table.</param>
 /// <returns>The row.</returns>
 public static AssemblyDefinitionRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new AssemblyDefinitionRow(
                (AssemblyHashAlgorithm)reader.ReadUInt32(),
                reader.ReadUInt16(),
                reader.ReadUInt16(),
                reader.ReadUInt16(),
                reader.ReadUInt16(),
                (AssemblyAttributes)reader.ReadUInt32(),
                reader.ReadIndex((IndexSize)layout.Columns[6].Size),
                reader.ReadIndex((IndexSize)layout.Columns[7].Size),
                reader.ReadIndex((IndexSize)layout.Columns[8].Size)));
 }
Пример #18
0
 /// <summary>
 /// Reads a single assembly definition row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the assembly definition table.</param>
 /// <returns>The row.</returns>
 public static AssemblyReferenceRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new AssemblyReferenceRow(
                reader.ReadUInt16(),
                reader.ReadUInt16(),
                reader.ReadUInt16(),
                reader.ReadUInt16(),
                (AssemblyAttributes)reader.ReadUInt32(),
                reader.ReadIndex((IndexSize)layout.Columns[5].Size),
                reader.ReadIndex((IndexSize)layout.Columns[6].Size),
                reader.ReadIndex((IndexSize)layout.Columns[7].Size),
                reader.ReadIndex((IndexSize)layout.Columns[8].Size)));
 }
Пример #19
0
 /// <summary>
 /// Reads a single class layout row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the class layout table.</param>
 /// <returns>The row.</returns>
 public static ClassLayoutRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new ClassLayoutRow(
                reader.ReadUInt16(),
                reader.ReadUInt32(),
                reader.ReadIndex((IndexSize)layout.Columns[2].Size)));
 }
Пример #20
0
 /// <summary>
 /// Reads a single assembly reference operating system row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the assembly reference operating system table.</param>
 /// <returns>The row.</returns>
 public static AssemblyRefOSRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new AssemblyRefOSRow(
                reader.ReadUInt32(),
                reader.ReadUInt32(),
                reader.ReadUInt32(),
                reader.ReadIndex((IndexSize)layout.Columns[3].Size)));
 }
Пример #21
0
 /// <summary>
 /// Reads a single stand-alone signature row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the stand-alone signature table.</param>
 /// <returns>The row.</returns>
 public static StandAloneSignatureRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new StandAloneSignatureRow(reader.ReadIndex((IndexSize)layout.Columns[0].Size)));
 }
Пример #22
0
 /// <summary>
 /// Reads a single property map row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the property map table.</param>
 /// <returns>The row.</returns>
 public static PropertyMapRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new PropertyMapRow(
                reader.ReadIndex((IndexSize)layout.Columns[0].Size),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size)));
 }
Пример #23
0
 /// <summary>
 /// Reads a single field RVA row from an input stream.
 /// </summary>
 /// <param name="context">The reader context.</param>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the field RVA table.</param>
 /// <returns>The row.</returns>
 public static FieldRvaRow FromReader(PEReaderContext context, IBinaryStreamReader reader, TableLayout layout)
 {
     return(new FieldRvaRow(
                context.File.GetReferenceToRva(reader.ReadUInt32()),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size)));
 }
Пример #24
0
 /// <summary>
 /// Reads a single type specification row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the type specification table.</param>
 /// <returns>The row.</returns>
 public static TypeSpecificationRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new TypeSpecificationRow(reader.ReadIndex((IndexSize)layout.Columns[0].Size)));
 }
 /// <summary>
 /// Reads a single generic parameter row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the generic parameter table.</param>
 /// <returns>The row.</returns>
 public static GenericParameterConstraintRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new GenericParameterConstraintRow(
                reader.ReadIndex((IndexSize)layout.Columns[0].Size),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size)));
 }
Пример #26
0
 /// <summary>
 /// Reads a single nested class row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the nested class table.</param>
 /// <returns>The row.</returns>
 public static NestedClassRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new NestedClassRow(
                reader.ReadIndex((IndexSize)layout.Columns[0].Size),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size)));
 }
Пример #27
0
 /// <summary>
 /// Reads a single field pointer row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the field pointer table.</param>
 /// <returns>The row.</returns>
 public static FieldPointerRow FromReader(IBinaryStreamReader reader, TableLayout layout)
 {
     return(new FieldPointerRow(reader.ReadIndex((IndexSize)layout.Columns[0].Size)));
 }
Пример #28
0
 /// <summary>
 /// Reads a single field RVA row from an input stream.
 /// </summary>
 /// <param name="reader">The input stream.</param>
 /// <param name="layout">The layout of the field RVA table.</param>
 /// <param name="referenceResolver"></param>
 /// <returns>The row.</returns>
 public static FieldRvaRow FromReader(IBinaryStreamReader reader, TableLayout layout, ISegmentReferenceResolver referenceResolver)
 {
     return(new FieldRvaRow(
                referenceResolver.GetReferenceToRva(reader.ReadUInt32()),
                reader.ReadIndex((IndexSize)layout.Columns[1].Size)));
 }