mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
[Symbian Installation File] Decode requisites.
This commit is contained in:
36
Aaru.Archives/Localization/Localization.Designer.cs
generated
36
Aaru.Archives/Localization/Localization.Designer.cs
generated
@@ -149,6 +149,42 @@ namespace Aaru.Archives {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Required UID {0} version {1}.{2}.
|
||||
/// </summary>
|
||||
internal static string Required_UID_0_version_1_2 {
|
||||
get {
|
||||
return ResourceManager.GetString("Required_UID_0_version_1_2", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Required variant: {0}.
|
||||
/// </summary>
|
||||
internal static string Required_variant_0 {
|
||||
get {
|
||||
return ResourceManager.GetString("Required_variant_0", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Requisite #{0}:.
|
||||
/// </summary>
|
||||
internal static string Requisite_0 {
|
||||
get {
|
||||
return ResourceManager.GetString("Requisite_0", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Requisite for language {0}: {1}.
|
||||
/// </summary>
|
||||
internal static string Requisite_for_language_0_1 {
|
||||
get {
|
||||
return ResourceManager.GetString("Requisite_for_language_0_1", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to SIS contains an application.
|
||||
/// </summary>
|
||||
|
||||
@@ -69,4 +69,16 @@
|
||||
<data name="Files_for_all_languages" xml:space="preserve">
|
||||
<value>Ficheros para todos los idiomas:</value>
|
||||
</data>
|
||||
<data name="Required_UID_0_version_1_2" xml:space="preserve">
|
||||
<value>Requerida UID {0} versión {1}.{2}</value>
|
||||
</data>
|
||||
<data name="Required_variant_0" xml:space="preserve">
|
||||
<value>Variante requerida: {0}</value>
|
||||
</data>
|
||||
<data name="Requisite_0" xml:space="preserve">
|
||||
<value>Requisito nº {0}:</value>
|
||||
</data>
|
||||
<data name="Requisite_for_language_0_1" xml:space="preserve">
|
||||
<value>Requisito para el idioma {0}: {1}</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -77,4 +77,16 @@
|
||||
<data name="Files_for_0_language" xml:space="preserve">
|
||||
<value>Files for `{0}` language:</value>
|
||||
</data>
|
||||
<data name="Requisite_0" xml:space="preserve">
|
||||
<value>Requisite #{0}:</value>
|
||||
</data>
|
||||
<data name="Required_UID_0_version_1_2" xml:space="preserve">
|
||||
<value>Required UID {0} version {1}.{2}</value>
|
||||
</data>
|
||||
<data name="Required_variant_0" xml:space="preserve">
|
||||
<value>Required variant: {0}</value>
|
||||
</data>
|
||||
<data name="Requisite_for_language_0_1" xml:space="preserve">
|
||||
<value>Requisite for language {0}: {1}</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -36,7 +36,7 @@ namespace Aaru.Archives;
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||
public partial class Symbian
|
||||
public sealed partial class Symbian
|
||||
{
|
||||
// Magics
|
||||
const uint SYMBIAN_MAGIC = 0x10000419;
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace Aaru.Archives;
|
||||
[SuppressMessage("ReSharper", "UnusedType.Local")]
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
public partial class Symbian
|
||||
public sealed partial class Symbian
|
||||
{
|
||||
#region Nested type: Attribute
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.Archives;
|
||||
|
||||
public partial class Symbian
|
||||
public sealed partial class Symbian
|
||||
{
|
||||
#region IArchive Members
|
||||
|
||||
@@ -72,13 +72,11 @@ public partial class Symbian
|
||||
|
||||
public void GetInformation(IFilter filter, Encoding encoding, out string information)
|
||||
{
|
||||
_encoding= encoding ?? Encoding.GetEncoding("windows-1252");
|
||||
_encoding = encoding ?? Encoding.GetEncoding("windows-1252");
|
||||
information = "";
|
||||
var description = new StringBuilder();
|
||||
var languages = new List<string>();
|
||||
var capabilities = new Dictionary<uint, uint>();
|
||||
var en_Pos = 0;
|
||||
var componentName = "";
|
||||
Stream stream = filter.GetDataForkStream();
|
||||
|
||||
if(stream.Length < Marshal.SizeOf<SymbianHeader>())
|
||||
@@ -237,6 +235,50 @@ public partial class Symbian
|
||||
description.AppendFormat(Localization.File_contains_0_files_pointer_1, sh.files, sh.files_ptr).AppendLine();
|
||||
description.AppendFormat(Localization.File_contains_0_requisites, sh.requisites).AppendLine();
|
||||
|
||||
uint offset = sh.reqs_ptr;
|
||||
|
||||
if(sh.requisites > 0)
|
||||
{
|
||||
for(var r = 0; r < sh.requisites; r++)
|
||||
{
|
||||
br.BaseStream.Seek(offset, SeekOrigin.Begin);
|
||||
var requisiteRecord = new RequisiteRecord
|
||||
{
|
||||
uid = br.ReadUInt32(),
|
||||
majorVersion = br.ReadUInt16(),
|
||||
minorVersion = br.ReadUInt16(),
|
||||
variant = br.ReadUInt32()
|
||||
};
|
||||
|
||||
buffer = br.ReadBytes(sizeof(uint) * languages.Count);
|
||||
span = buffer;
|
||||
requisiteRecord.namesLengths = MemoryMarshal.Cast<byte, uint>(span)[..languages.Count].ToArray();
|
||||
|
||||
buffer = br.ReadBytes(sizeof(uint) * languages.Count);
|
||||
span = buffer;
|
||||
requisiteRecord.namesPointers = MemoryMarshal.Cast<byte, uint>(span)[..languages.Count].ToArray();
|
||||
|
||||
description.AppendFormat(Localization.Requisite_0, r).AppendLine();
|
||||
description.AppendFormat("\t" + Localization.Required_UID_0_version_1_2, requisiteRecord.uid,
|
||||
requisiteRecord.majorVersion, requisiteRecord.minorVersion).
|
||||
AppendLine();
|
||||
description.AppendFormat("\t" + Localization.Required_variant_0, requisiteRecord.variant).AppendLine();
|
||||
|
||||
offset = (uint)br.BaseStream.Position;
|
||||
|
||||
for(var i = 0; i < languages.Count; i++)
|
||||
{
|
||||
br.BaseStream.Seek(requisiteRecord.namesPointers[i], SeekOrigin.Begin);
|
||||
buffer = br.ReadBytes((int)requisiteRecord.namesLengths[i]);
|
||||
description.AppendFormat("\t" + Localization.Requisite_for_language_0_1, languages[i],
|
||||
_encoding.GetString(buffer)).
|
||||
AppendLine();
|
||||
}
|
||||
|
||||
description.AppendLine();
|
||||
}
|
||||
}
|
||||
|
||||
// description.AppendLine(Localization.Capabilities);
|
||||
// foreach(KeyValuePair<uint, uint> kvp in capabilities)
|
||||
// description.AppendFormat("{0} = {1}", kvp.Key, kvp.Value).AppendLine();
|
||||
@@ -245,7 +287,7 @@ public partial class Symbian
|
||||
_files = new List<DecodedFileRecord>();
|
||||
|
||||
uint currentFile = 0;
|
||||
uint offset = sh.files_ptr;
|
||||
offset = sh.files_ptr;
|
||||
|
||||
do
|
||||
{
|
||||
|
||||
@@ -39,7 +39,7 @@ using Marshal = Aaru.Helpers.Marshal;
|
||||
|
||||
namespace Aaru.Archives;
|
||||
|
||||
public partial class Symbian
|
||||
public sealed partial class Symbian
|
||||
{
|
||||
void Parse(BinaryReader br, ref uint offset, ref uint currentFile, uint maxFiles, List<string> languages)
|
||||
{
|
||||
@@ -59,7 +59,6 @@ public partial class Symbian
|
||||
br.BaseStream.Seek(-sizeof(FileRecordType), SeekOrigin.Current);
|
||||
|
||||
byte[] buffer;
|
||||
ReadOnlySpan<byte> span;
|
||||
|
||||
switch(recordType)
|
||||
{
|
||||
@@ -113,7 +112,7 @@ public partial class Symbian
|
||||
multipleFileRecord.record = Marshal.ByteArrayToStructureLittleEndian<BaseFileRecord>(buffer);
|
||||
|
||||
buffer = br.ReadBytes(sizeof(uint) * languages.Count);
|
||||
span = buffer;
|
||||
ReadOnlySpan<byte> span = buffer;
|
||||
multipleFileRecord.lengths = MemoryMarshal.Cast<byte, uint>(span)[..languages.Count].ToArray();
|
||||
|
||||
buffer = br.ReadBytes(sizeof(uint) * languages.Count);
|
||||
|
||||
@@ -43,7 +43,8 @@ namespace Aaru.Archives;
|
||||
[SuppressMessage("ReSharper", "UnusedType.Local")]
|
||||
[SuppressMessage("ReSharper", "InconsistentNaming")]
|
||||
[SuppressMessage("ReSharper", "InheritdocConsiderUsage")]
|
||||
public partial class Symbian
|
||||
[SuppressMessage("ReSharper", "NotAccessedField.Local")]
|
||||
public sealed partial class Symbian
|
||||
{
|
||||
#region Nested type: AttributeConditionalExpression
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ using Aaru.CommonTypes.Interfaces;
|
||||
namespace Aaru.Archives;
|
||||
|
||||
// Information from https://thoukydides.github.io/riscos-psifs/sis.html
|
||||
public partial class Symbian : IArchive
|
||||
public sealed partial class Symbian : IArchive
|
||||
{
|
||||
const string MODULE_NAME = "Symbian Installation File Plugin";
|
||||
Encoding _encoding;
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace Aaru.Archives;
|
||||
|
||||
[SuppressMessage("ReSharper", "UnusedType.Global")]
|
||||
[SuppressMessage("ReSharper", "UnusedMember.Local")]
|
||||
public partial class Symbian
|
||||
public sealed partial class Symbian
|
||||
{
|
||||
#region IArchive Members
|
||||
|
||||
|
||||
@@ -1029,9 +1029,11 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=incompat/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=INDEXF/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Inheritdoc/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=innotek/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=INOPB/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=INSITE/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=instspace/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Interix/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=interseek/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=intl/@EntryIndexedValue">True</s:Boolean>
|
||||
@@ -1103,6 +1105,7 @@
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=maxbpg/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=maxcontig/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=maxiform/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=maxinsspc/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mbit/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=mbsize/@EntryIndexedValue">True</s:Boolean>
|
||||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Mbytes/@EntryIndexedValue">True</s:Boolean>
|
||||
|
||||
Reference in New Issue
Block a user