Beispiel #1
0
 internal MetaDataStream(NETHeader netheader, int headeroffset, Structures.METADATA_STREAM_HEADER rawHeader, string name)
 {
     this.headeroffset = headeroffset;
     this.netheader = netheader;
     this.streamHeader = rawHeader;
     this.name = name;
     this.indexsize = 2;
 }
Beispiel #2
0
        internal MetaDataStream(NETHeader netheader, int headeroffset, Structures.METADATA_STREAM_HEADER rawHeader, string name)
        {
            this._headeroffset = headeroffset;
            this._netheader = netheader;
            this._streamHeader = rawHeader;
            this._name = name;
            this._indexsize = 2;

            byte[] contents = netheader._assembly._peImage.ReadBytes(StreamOffset, (int)StreamSize);
            _mainStream = new MemoryStream();
            _binReader = new BinaryReader(_mainStream);
            _binWriter = new BinaryWriter(_mainStream);
            _mainStream.Write(contents, 0, contents.Length);
            _mainStream.Seek(0, SeekOrigin.Begin);
        }
Beispiel #3
0
        public MetaDataStream(string name, byte[] contents)
        {
            Name = name;
            this._streamHeader = new Structures.METADATA_STREAM_HEADER()
            {
                Offset = 0,
                Size = (uint)contents.Length,
            };

            _mainStream = new MemoryStream();
            _binReader = new BinaryReader(_mainStream);
            _binWriter = new BinaryWriter(_mainStream);
            _mainStream.Write(contents, 0, contents.Length);
            _mainStream.Seek(0, SeekOrigin.Begin);
        }