Esempio n. 1
0
        private void CreateChunks()
        {
            CreateMetaDataChunks(module);

            CreateDebugDirectory();

            imageCor20Header = new ByteArrayChunk(new byte[0x48]);
            CreateStrongNameSignature();
        }
Esempio n. 2
0
        /// <summary>
        /// Adds a resource
        /// </summary>
        /// <param name="stream">The resource data</param>
        /// <returns>The resource data</returns>
        public ByteArrayChunk Add(IImageStream stream)
        {
            if (setOffsetCalled)
            {
                throw new InvalidOperationException("SetOffset() has already been called");
            }
            var rawData = stream.ReadAllBytes();

            length = Utils.AlignUp(length + 4 + (uint)rawData.Length, alignment);
            var data = new ByteArrayChunk(rawData);

            resources.Add(data);
            return(data);
        }