Exemplo n.º 1
0
        public void Read(byte[] file)
        {
            // Make sure the file contains at least a full header
            Assertions.AssertLength(SizeOfHeader, file);

            this.buffer = file;

            this.sections = new Dictionary <SectionType, Section> {
                {
                    SectionType.Code,
                    new Section {
                        SizePointer   = PointerCodeSize,
                        OffsetPointer = PointerCodeOffset,
                        Size          = BitConverter.ToUInt32(file, PointerCodeSize),
                        Offset        = BitConverter.ToUInt32(file, PointerCodeOffset)
                    }
                }, {
                    SectionType.Data,
                    new Section {
                        SizePointer   = PointerDataSize,
                        OffsetPointer = PointerDataOffset,
                        Size          = BitConverter.ToUInt32(file, PointerDataSize),
                        Offset        = BitConverter.ToUInt32(file, PointerDataOffset)
                    }
                }
            };
        }
Exemplo n.º 2
0
        public void SetAllEntries(Entry[] entries)
        {
            Assertions.AssertLength((uint)this.NumEntries, entries, exact: true);

            this.ProcessEntries(entries);
        }