- 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);
}
}