diff --git a/Aaru.Archives/Symbian/Info.cs b/Aaru.Archives/Symbian/Info.cs index 1f0694498..93ed92133 100644 --- a/Aaru.Archives/Symbian/Info.cs +++ b/Aaru.Archives/Symbian/Info.cs @@ -31,6 +31,7 @@ // ****************************************************************************/ using System.IO; +using Aaru.CommonTypes.Interfaces; using Aaru.Helpers; namespace Aaru.Archives; @@ -39,30 +40,18 @@ public partial class Symbian { #region IArchive Members - public bool Identify(byte[] buffer) - { - if(buffer.Length < Marshal.SizeOf()) - return false; - - SymbianHeader header = Marshal.ByteArrayToStructureLittleEndian(buffer); - - if(header.uid1 == SYMBIAN9_MAGIC) - return true; - - if(header.uid3 != SYMBIAN_MAGIC) - return false; - - return header.uid2 is EPOC_MAGIC or EPOC6_MAGIC; - } - /// - public bool Identify(Stream stream) + public bool Identify(IFilter filter) { - if(stream.Length < Marshal.SizeOf()) + if(filter.DataForkLength < Marshal.SizeOf()) return false; + Stream stream = filter.GetDataForkStream(); + var hdr = new byte[Marshal.SizeOf()]; + stream.EnsureRead(hdr, 0, hdr.Length); + SymbianHeader header = Marshal.ByteArrayToStructureLittleEndian(hdr); if(header.uid1 == SYMBIAN9_MAGIC) diff --git a/Aaru.Archives/Symbian/Unsupported.cs b/Aaru.Archives/Symbian/Unsupported.cs index 19075158a..bb0abf214 100644 --- a/Aaru.Archives/Symbian/Unsupported.cs +++ b/Aaru.Archives/Symbian/Unsupported.cs @@ -46,7 +46,7 @@ public partial class Symbian #region IArchive Members /// - public ErrorNumber Open(Stream stream) => throw new NotImplementedException(); + public ErrorNumber Open(IFilter filter) => throw new NotImplementedException(); /// public bool IsOpened() => throw new NotImplementedException(); diff --git a/Aaru.CommonTypes b/Aaru.CommonTypes index 1d1613a4e..ef84faca3 160000 --- a/Aaru.CommonTypes +++ b/Aaru.CommonTypes @@ -1 +1 @@ -Subproject commit 1d1613a4e3747fc6ee85823dd31003afa53620a8 +Subproject commit ef84faca3829237a5e4f8cb152d32fca8865c128