[Symbian Installation File] Show all component records.

This commit is contained in:
2023-10-07 03:11:54 +01:00
parent 6da3257dc3
commit 8319b21477
5 changed files with 47 additions and 17 deletions

View File

@@ -78,11 +78,20 @@ namespace Aaru.Archives {
}
/// <summary>
/// Looks up a localized string similar to Component: {0} v{1}.{2}.
/// Looks up a localized string similar to Component name for language with code {0}: {1}.
/// </summary>
internal static string Component_0_v1_2 {
internal static string Component_name_for_language_with_code_0_1 {
get {
return ResourceManager.GetString("Component_0_v1_2", resourceCulture);
return ResourceManager.GetString("Component_name_for_language_with_code_0_1", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Component version: {0}.{1}.
/// </summary>
internal static string Component_version_0_1 {
get {
return ResourceManager.GetString("Component_version_0_1", resourceCulture);
}
}

View File

@@ -24,9 +24,6 @@
<data name="Capabilities" xml:space="preserve">
<value>Capacidades:</value>
</data>
<data name="Component_0_v1_2" xml:space="preserve">
<value>Componente: {0} v{1}.{2}</value>
</data>
<data name="CRC16_of_header_0" xml:space="preserve">
<value>CRC16 de la cabecera: 0x{0:X4}</value>
</data>
@@ -60,4 +57,10 @@
<data name="Unknown_EPOC_magic_0" xml:space="preserve">
<value>Mágica EPOC 0x{0:X8} desconocida</value>
</data>
<data name="Component_name_for_language_with_code_0_1" xml:space="preserve">
<value>Nombre del componente para el idioma con código {0}: {1}</value>
</data>
<data name="Component_version_0_1" xml:space="preserve">
<value>Versión del componente: {0}.{1}</value>
</data>
</root>

View File

@@ -53,9 +53,6 @@
<data name="SIS_contains_an_application" xml:space="preserve">
<value>SIS contains an application</value>
</data>
<data name="Component_0_v1_2" xml:space="preserve">
<value>Component: {0} v{1}.{2}</value>
</data>
<data name="File_contains_0_languages" xml:space="preserve">
<value>Archive contains {0} languages:</value>
</data>
@@ -68,4 +65,10 @@
<data name="Capabilities" xml:space="preserve">
<value>Capabilities:</value>
</data>
<data name="Component_version_0_1" xml:space="preserve">
<value>Component version: {0}.{1}</value>
</data>
<data name="Component_name_for_language_with_code_0_1" xml:space="preserve">
<value>Component name for language with code {0}: {1}</value>
</data>
</root>

View File

@@ -103,7 +103,10 @@ public partial class Symbian
// Go to component record
br.BaseStream.Seek(sh.comp_ptr, SeekOrigin.Begin);
var componentRecord = new ComponentRecord();
var componentRecord = new ComponentRecord
{
names = new string[languages.Count]
};
buffer = new byte[sizeof(uint) * languages.Count];
// Read the component string lenghts
@@ -122,13 +125,9 @@ public partial class Symbian
"Found component name for language {0} at {1} with a length of {2} bytes",
languages[i], componentRecord.namesPointers[i], componentRecord.namesLengths[i]);
if(i != en_Pos)
continue;
br.BaseStream.Seek(componentRecord.namesPointers[i], SeekOrigin.Begin);
byte[] componentName_B = br.ReadBytes((int)componentRecord.namesLengths[i]);
componentName = encoding.GetString(componentName_B);
break;
buffer = br.ReadBytes((int)componentRecord.namesLengths[i]);
componentRecord.names[i] = encoding.GetString(buffer);
}
// Go to capabilities (???)
@@ -170,7 +169,9 @@ public partial class Symbian
break;
}
description.AppendFormat(Localization.Component_0_v1_2, componentName, sh.major, sh.minor).AppendLine();
description.AppendFormat(Localization.Component_version_0_1, sh.major, sh.minor).AppendLine();
description.AppendLine();
description.AppendFormat(Localization.File_contains_0_languages, sh.languages).AppendLine();
@@ -181,6 +182,16 @@ public partial class Symbian
description.Append($"{languages[i]}");
}
description.AppendLine();
description.AppendLine();
for(var i = 0; i < languages.Count; i++)
{
description.AppendFormat(Localization.Component_name_for_language_with_code_0_1, languages[i],
componentRecord.names[i]).
AppendLine();
}
description.AppendLine();
description.AppendFormat(Localization.File_contains_0_files_pointer_1, sh.files, sh.files_ptr).AppendLine();

View File

@@ -146,6 +146,10 @@ public partial class Symbian
/// Pointers to the component names, array sorted as language records
/// </summary>
public uint[] namesPointers;
/// <summary>
/// Decoded names, not on-disk
/// </summary>
public string[] names;
}
#endregion