Exemplo n.º 1
0
        internal Firmware
        (
            [NotNull] byte[] body,
            [NotNull] FirmwareImageBlocks imageBlocks,
            [NotNull] FirmwareStringBlocks stringBlocks,
            [NotNull] FirmwareDefinition definition,
            EncryptionType encryptionType
        )
        {
            if (body == null)
            {
                throw new ArgumentNullException("body");
            }
            if (imageBlocks == null)
            {
                throw new ArgumentNullException("imageBlocks");
            }
            if (stringBlocks == null)
            {
                throw new ArgumentNullException("stringBlocks");
            }
            if (definition == null)
            {
                throw new ArgumentNullException("definition");
            }

            Definition     = definition;
            EncryptionType = encryptionType;
            m_bodyStream   = new FirmwareStream(body);
            m_imageBlocks  = imageBlocks;
            m_stringBlocks = stringBlocks;
        }
Exemplo n.º 2
0
        internal void ReloadResources([NotNull] FirmwareLoader loader)
        {
            if (loader == null)
            {
                throw new ArgumentNullException("loader");
            }

            var firmwareBytes = GetBody();

            m_imageBlocks  = loader.LoadImageBlocks(firmwareBytes, Definition);
            m_stringBlocks = loader.LoadStringBlocks(firmwareBytes, Definition);
        }
Exemplo n.º 3
0
        internal Firmware(
            [NotNull] byte[] body,
            [NotNull] FirmwareImageBlocks imageBlocks,
            [NotNull] FirmwareStringBlocks stringBlocks,
            [NotNull] FirmwareDefinition definition,
            bool isEncrypted
            )
        {
            if (body == null) throw new ArgumentNullException("body");
            if (imageBlocks == null) throw new ArgumentNullException("imageBlocks");
            if (stringBlocks == null) throw new ArgumentNullException("stringBlocks");
            if (definition == null) throw new ArgumentNullException("definition");

            Definition = definition;
            IsEncrypted = isEncrypted;
            m_bodyStream = new FirmwareStream(body);
            m_imageBlocks = imageBlocks;
            m_stringBlocks = stringBlocks;
        }
Exemplo n.º 4
0
        internal void ReloadResources([NotNull] FirmwareLoader loader)
        {
            if (loader == null) throw new ArgumentNullException("loader");

            var firmwareBytes = GetBody();
            m_imageBlocks = loader.LoadImageBlocks(firmwareBytes, Definition);
            m_stringBlocks = loader.LoadStringBlocks(firmwareBytes, Definition);
        }