- added detection for unsupported .SDX with encrypted/compressed content

This commit is contained in:
Horst Beham
2023-01-15 18:51:38 +01:00
parent c6b2f9c815
commit 4556d94077
3 changed files with 36 additions and 3 deletions

View File

@@ -1,4 +1,6 @@
using ChanSort.Api;
using System.IO;
using System.Text;
using ChanSort.Api;
namespace ChanSort.Loader.SatcoDX
{
@@ -10,6 +12,14 @@ namespace ChanSort.Loader.SatcoDX
public SerializerBase CreateSerializer(string inputFile)
{
var buffer = new byte[7];
using (var strm = new FileStream(inputFile, FileMode.Open))
{
var len = strm.Read(buffer, 0, buffer.Length);
if (len != buffer.Length || Encoding.ASCII.GetString(buffer, 0, len) != "SATCODX")
return null;
}
return new Serializer(inputFile);
}
}

View File

@@ -1,5 +1,7 @@
using System.IO;
using System.CodeDom;
using System.IO;
using System.Linq;
using System.Text;
using ChanSort.Api;
namespace ChanSort.Loader.Unsupported
@@ -12,18 +14,21 @@ namespace ChanSort.Loader.Unsupported
public string PluginName => "Unsupported";
public string FileFilter => "*";
private string path;
private string dir;
private string name;
private string ext;
public SerializerBase CreateSerializer(string inputFile)
{
path = inputFile;
dir = Path.GetDirectoryName(inputFile);
name = Path.GetFileName(inputFile).ToLowerInvariant();
ext = Path.GetExtension(name);
CheckForMediaTekAndroidBin();
CheckForVestelEncryptedDb();
CheckForSdxEncrypted();
throw LoaderException.TryNext("File is not on the list of explicitly unsupported formats");
}
@@ -68,5 +73,22 @@ namespace ChanSort.Loader.Unsupported
}
#endregion
#region CheckForSdxEncrypted()
/// <summary>
/// Not sure if these .sdx files are also from SatcoDX, but they seem to have a 64 byte file header and then either encrypted or
/// compressed data that can't be analyzed. One such file came from a Xoro
/// </summary>
private void CheckForSdxEncrypted()
{
using var strm = new FileStream(this.path, FileMode.Open);
var buffer = new byte[24];
var len = strm.Read(buffer, 0, buffer.Length);
if (len < buffer.Length)
return;
var str = Encoding.ASCII.GetString(buffer, 0, buffer.Length);
if (str.StartsWith("CDX\0MSTDatabaseV"))
throw LoaderException.Fail("Encrypted SDX channel lists (used by Xoro and others) can't be read/modified with ChanSort.");
}
#endregion
}
}

View File

@@ -1,10 +1,11 @@
ChanSort Change Log
===================
2023-01-14
2023-01-15
- added support for Vision EDGE 4K set-top-box (DVB-S only)
- TCL: separate lists for DVB-C/T/S, each starting at 1
- TCL: cleaned up "Hide" vs "Skip"
- SDX: showing message when an unsupported, encrypted .sdx file is opened (e.g. from Xoro STB)
2023-01-12
- TCL: fixed upload failure due to incorrect checksum when DtvData.db was larger than 307200 bytes