Beispiel #1
0
        public byte[] DecryptHeader()
        {
            try
            {
                if (FirmwareRaw != null)
                {
                    if (FirmwareRaw.Length > 512)
                    {
                        var iv  = FirmwareIV();
                        var key = KeyHandler.Aes256;

                        var fileName  = @"header.rawBytes";
                        var rawHeader = FirmwareSigned.ByteSelect(640, 543);

                        var dec = CryptoHandler.AesDecrypt(rawHeader, key, iv);
                        File.WriteAllBytes(fileName, dec);
                    }
                }
            }
            catch (Exception ex)
            {
                UiMessages.Error(ex.ToString());
            }

            //default
            return(null);
        }
Beispiel #2
0
        public byte[] SignedSHA512()
        {
            try
            {
                if (FirmwareSigned != null)
                {
                    if (FirmwareSigned.Length > 512)
                    {
                        return(FirmwareSigned.ByteSelect(512));
                    }
                }
            }
            catch (Exception ex)
            {
                UiMessages.Error(ex.ToString());
            }

            //default
            return(null);
        }
Beispiel #3
0
        public byte[] EncryptedInstaller()
        {
            try
            {
                if (FirmwareSigned != null)
                {
                    if (FirmwareSigned.Length > 512)
                    {
                        return(FirmwareSigned.ByteSelect(FirmwareSigned.Length - 544, 639));
                    }
                }
            }
            catch (Exception ex)
            {
                UiMessages.Error(ex.ToString());
            }

            //default
            return(null);
        }
Beispiel #4
0
        public byte[] SHA512Image()
        {
            try
            {
                if (FirmwareSigned != null)
                {
                    if (FirmwareSigned.Length > 512)
                    {
                        var imageBytes = FirmwareSigned.ByteSelect(FirmwareSigned.Length - 512, 511);
                        return(imageBytes.SHA512());
                    }
                }
            }
            catch (Exception ex)
            {
                UiMessages.Error(ex.ToString());
            }

            //default
            return(null);
        }