Example #1
0
 public Param(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     Flags    = (ushort)ReadSize(2);
     Sequence = (ushort)ReadSize(2);
     Name     = ReadSize(HeapSizes.String);
 }
Example #2
0
 public MethodSemantics(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     Semantics   = (ushort)ReadSize(2);
     Method      = ReadSize(IndexSizes[Index.MethodDef]);
     Association = ReadSize(IndexSizes[Index.HasSemantics]);
 }
Example #3
0
 public MemberRef(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     Class     = ReadSize(IndexSizes[Index.MemberRefParent]);
     Name      = ReadSize(HeapSizes.String);
     Signature = ReadSize(HeapSizes.Blob);
 }
Example #4
0
 public TypeRef(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     ResolutionScope = ReadSize(IndexSizes[Index.ResolutionScope]);
     TypeName        = ReadSize(HeapSizes.String);
     TypeNamespace   = ReadSize(HeapSizes.String);
 }
Example #5
0
 public Event(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     EventFlags = (ushort)ReadSize(2);
     Name       = ReadSize(HeapSizes.String);
     EventType  = ReadSize(IndexSizes[Index.TypeDefOrRef]);
 }
Example #6
0
 public Field(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     Flags     = (ushort)ReadSize(2);
     Name      = ReadSize(HeapSizes.String);
     Signature = ReadSize(HeapSizes.Blob);
 }
Example #7
0
 public AssemblyOS(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     OSPlatformID   = ReadSize(4);
     OSMajorVersion = ReadSize(4);
     OSMinorVersion = ReadSize(4);
 }
Example #8
0
 public ClassLayout(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     PackingSize = (ushort)ReadSize(2);
     ClassSize   = ReadSize(4);
     Parent      = ReadSize(IndexSizes[Index.TypeDef]);
 }
Example #9
0
 public Param(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     Flags    = (ushort)ReadSize(2);
     Sequence = (ushort)ReadSize(2);
     Name     = ReadSize(HeapSizes.String);
 }
Example #10
0
 public Property(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     Flags = (ushort)ReadSize(2);
     Name  = ReadSize(HeapSizes.String);
     Type  = ReadSize(HeapSizes.Blob);
 }
Example #11
0
 public File(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     Flags     = ReadSize(4);
     Name      = ReadSize(HeapSizes.String);
     HashValue = ReadSize(HeapSizes.Blob);
 }
Example #12
0
 public MethodImpl(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     Class             = ReadSize(IndexSizes[Index.TypeDef]);
     MethodBody        = ReadSize(IndexSizes[Index.MethodDefOrRef]);
     MethodDeclaration = ReadSize(IndexSizes[Index.MethodDefOrRef]);
 }
Example #13
0
 public DeclSecurity(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     Action        = (ushort)ReadSize(2);
     Parent        = ReadSize(IndexSizes[Index.HasDeclSecurity]);
     PermissionSet = ReadSize(HeapSizes.Blob);
 }
Example #14
0
 public MethodImpl(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     Class             = ReadSize(IndexSizes[Index.TypeDef]);
     MethodBody        = ReadSize(IndexSizes[Index.MethodDefOrRef]);
     MethodDeclaration = ReadSize(IndexSizes[Index.MethodDefOrRef]);
 }
Example #15
0
 public AbstractTable(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset)
 {
     HeapSizes     = heapSizes;
     IndexSizes    = indexSizes;
     CurrentOffset = Offset;
 }
Example #16
0
 public ClassLayout(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     PackingSize = (ushort)ReadSize(2);
     ClassSize   = ReadSize(4);
     Parent      = ReadSize(IndexSizes[Index.TypeDef]);
 }
Example #17
0
 public Property(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     Flags = (ushort)ReadSize(2);
     Name  = ReadSize(HeapSizes.String);
     Type  = ReadSize(HeapSizes.Blob);
 }
Example #18
0
 public MemberRef(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     Class     = ReadSize(IndexSizes[Index.MemberRefParent]);
     Name      = ReadSize(HeapSizes.String);
     Signature = ReadSize(HeapSizes.Blob);
 }
Example #19
0
 public Field(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     Flags     = (ushort)ReadSize(2);
     Name      = ReadSize(HeapSizes.String);
     Signature = ReadSize(HeapSizes.Blob);
 }
Example #20
0
 public File(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     Flags     = ReadSize(4);
     Name      = ReadSize(HeapSizes.String);
     HashValue = ReadSize(HeapSizes.Blob);
 }
Example #21
0
 public DeclSecurity(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     Action        = (ushort)ReadSize(2);
     Parent        = ReadSize(IndexSizes[Index.HasDeclSecurity]);
     PermissionSet = ReadSize(HeapSizes.Blob);
 }
Example #22
0
 public CustomAttribute(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     Parent = ReadSize(IndexSizes[Index.HasCustomAttribute]);
     Type   = ReadSize(IndexSizes[Index.CustomAttributeType]);
     Value  = ReadSize(HeapSizes.Blob);
 }
Example #23
0
 public Event(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     EventFlags = (ushort)ReadSize(2);
     Name       = ReadSize(HeapSizes.String);
     EventType  = ReadSize(IndexSizes[Index.TypeDefOrRef]);
 }
Example #24
0
 public AssemblyOS(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     OSPlatformID   = ReadSize(4);
     OSMajorVersion = ReadSize(4);
     OSMinorVersion = ReadSize(4);
 }
Example #25
0
 public MethodSemantics(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     Semantics   = (ushort)ReadSize(2);
     Method      = ReadSize(IndexSizes[Index.MethodDef]);
     Association = ReadSize(IndexSizes[Index.HasSemantics]);
 }
Example #26
0
 public TypeRef(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     ResolutionScope = ReadSize(IndexSizes[Index.ResolutionScope]);
     TypeName        = ReadSize(HeapSizes.String);
     TypeNamespace   = ReadSize(HeapSizes.String);
 }
Example #27
0
 public AbstractTable(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset)
 {
     HeapSizes     = heapSizes;
     IndexSizes    = indexSizes;
     CurrentOffset = Offset;
 }
Example #28
0
 public CustomAttribute(IRawFile peFile, long offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(peFile, offset, heapSizes, indexSizes)
 {
     Parent = ReadSize(IndexSizes[Index.HasCustomAttribute]);
     Type   = ReadSize(IndexSizes[Index.CustomAttributeType]);
     Value  = ReadSize(HeapSizes.Blob);
 }
Example #29
0
 public ImplMap(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     MappingFlags    = (ushort)ReadSize(2);
     MemberForwarded = ReadSize(IndexSizes[Index.MemberForwarded]);
     ImportName      = ReadSize(HeapSizes.String);
     ImportScope     = ReadSize(IndexSizes[Index.ModuleRef]);
 }
Example #30
0
 public ManifestResource(byte[] buff, uint offset, HeapSizes heapSizes, IndexSize indexSizes)
     : base(buff, offset, heapSizes, indexSizes)
 {
     Offset         = ReadSize(4);
     Flags          = ReadSize(4);
     Name           = ReadSize(HeapSizes.String);
     Implementation = ReadSize(IndexSizes[Index.Implementation]);
 }
Example #31
0
 /// <summary>
 /// Reads an index with the specified index size of the stream.
 /// </summary>
 /// <param name="reader">The reader to use for reading the data.</param>
 /// <param name="size">The size of the index.</param>
 /// <returns>The index.</returns>
 public static uint ReadIndex(this IBinaryStreamReader reader, IndexSize size)
 {
     switch (size)
     {
         case IndexSize.Short:
             return reader.ReadUInt16();
         case IndexSize.Long:
             return reader.ReadUInt32();
         default:
             throw new ArgumentOutOfRangeException("size");
     }
 }
Example #32
0
 /// <summary>
 /// Writes an index with the specified size to the stream.
 /// </summary>
 /// <param name="writer">The writer to use.</param>
 /// <param name="indexSize">The size of the index.</param>
 /// <param name="value">The value to write.</param>
 public static void WriteIndex(this IBinaryStreamWriter writer, IndexSize indexSize, uint value)
 {
     if (indexSize == IndexSize.Short)
         writer.WriteUInt16((ushort)value);
     else
         writer.WriteUInt32(value);
 }