public PEFileHeader(byte[] headerValue)
        {
            if (headerValue.Length > 20)
            {
                throw new PEHeaderException("The PE File header is too long.");
            }
            if (headerValue.Length < 20)
            {
                throw new PEHeaderException("The PE File header is too short.");
            }

            ValidateBytes(headerValue);

            _characteristics = new PEFileHeaderCharacteristics(GetArraySlice(headerValue, 18, 2));

            _headerValue = headerValue;
        }
Example #2
0
        public PEFileHeader(byte[] headerValue)
        {
            if (headerValue.Length > 20)
            {
                throw new PEHeaderException("The PE File header is too long.");
            }
            if (headerValue.Length < 20)
            {
                throw new PEHeaderException("The PE File header is too short.");
            }

            ValidateBytes(headerValue);

            _characteristics = new PEFileHeaderCharacteristics(GetArraySlice(headerValue, 18, 2));

            _headerValue = headerValue;
        }