mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(Legacy): bunch of formats.
(GSX): K5 archives + K4 images. (HyperWorks): G images. (IDA): better support packed entries. (Logg): ARF, MBM archives, FRM images. (Omi): DAT archives. (Rare): X archives. (RHSS): 'CRG' archives. (SplushWave): better SWG images support.
This commit is contained in:
@@ -36,11 +36,11 @@ namespace GameRes.Formats.Logg
|
||||
[Export(typeof(ArchiveFormat))]
|
||||
public class MbmOpener : ArchiveFormat
|
||||
{
|
||||
public override string Tag { get { return "MBM"; } }
|
||||
public override string Description { get { return "Logg Adv engine resource archive"; } }
|
||||
public override uint Signature { get { return 0; } }
|
||||
public override bool IsHierarchic { get { return false; } }
|
||||
public override bool CanWrite { get { return false; } }
|
||||
public override string Tag => "MBM";
|
||||
public override string Description => "Logg Adv engine resource archive";
|
||||
public override uint Signature => 0;
|
||||
public override bool IsHierarchic => false;
|
||||
public override bool CanWrite => false;
|
||||
|
||||
public override ArcFile TryOpen (ArcView file)
|
||||
{
|
||||
@@ -63,19 +63,27 @@ namespace GameRes.Formats.Logg
|
||||
|
||||
IDictionary<uint, string> GetArchiveIndex (ArcView file)
|
||||
{
|
||||
uint last_offset = FileListMap.Value.Keys.Last();
|
||||
string list_name;
|
||||
if (!ArcSizeToFileListMap.TryGetValue ((uint)file.MaxOffset, out list_name))
|
||||
return null;
|
||||
var file_map = ReadFileList (list_name);
|
||||
uint last_offset = file_map.Keys.Last();
|
||||
if (last_offset != file.MaxOffset)
|
||||
return null;
|
||||
return FileListMap.Value;
|
||||
return file_map;
|
||||
}
|
||||
|
||||
Lazy<IDictionary<uint, string>> FileListMap = new Lazy<IDictionary<uint, string>> (ReadFileList);
|
||||
static readonly Dictionary<uint, string> ArcSizeToFileListMap = new Dictionary<uint, string> {
|
||||
{ 0x0AB0F5F4, "logg_pl.lst" },
|
||||
{ 0x0BFFD3DA, "logg_ak.lst" },
|
||||
{ 0x09809196, "logg_th.lst" },
|
||||
};
|
||||
|
||||
static IDictionary<uint, string> ReadFileList ()
|
||||
static IDictionary<uint, string> ReadFileList (string list_name)
|
||||
{
|
||||
var file_map = new SortedDictionary<uint,string>();
|
||||
var comma = new char[] {','};
|
||||
FormatCatalog.Instance.ReadFileList ("logg_pl.lst", line => {
|
||||
FormatCatalog.Instance.ReadFileList (list_name, line => {
|
||||
var parts = line.Split (comma, 2);
|
||||
uint offset = uint.Parse (parts[0], NumberStyles.HexNumber);
|
||||
if (2 == parts.Length)
|
||||
|
||||
Reference in New Issue
Block a user