mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 15:44:00 +08:00
(MblOpener): another archive format variant.
This commit is contained in:
parent
be3cf68c86
commit
d3a459cfb0
@ -52,6 +52,8 @@ namespace GameRes.Formats.Marble
|
|||||||
arc = ReadIndex (file, count, filename_len, 8);
|
arc = ReadIndex (file, count, filename_len, 8);
|
||||||
if (null == arc)
|
if (null == arc)
|
||||||
arc = ReadIndex (file, count, 0x10, 4);
|
arc = ReadIndex (file, count, 0x10, 4);
|
||||||
|
if (null == arc)
|
||||||
|
arc = ReadIndex (file, count, 0x38, 4);
|
||||||
return arc;
|
return arc;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,12 +62,20 @@ namespace GameRes.Formats.Marble
|
|||||||
uint index_size = (8u + filename_len) * (uint)count;
|
uint index_size = (8u + filename_len) * (uint)count;
|
||||||
if (index_size > file.View.Reserve (index_offset, index_size))
|
if (index_size > file.View.Reserve (index_offset, index_size))
|
||||||
return null;
|
return null;
|
||||||
|
try
|
||||||
|
{
|
||||||
var dir = new List<Entry> (count);
|
var dir = new List<Entry> (count);
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
string name = file.View.ReadString (index_offset, filename_len);
|
string name = file.View.ReadString (index_offset, filename_len);
|
||||||
if (0 == name.Length)
|
if (0 == name.Length)
|
||||||
return null;
|
return null;
|
||||||
|
if (filename_len-name.Length > 1)
|
||||||
|
{
|
||||||
|
string ext = file.View.ReadString (index_offset+name.Length+1, filename_len-(uint)name.Length-1);
|
||||||
|
if (0 != ext.Length)
|
||||||
|
name = Path.ChangeExtension (name, ext);
|
||||||
|
}
|
||||||
name = name.ToLowerInvariant();
|
name = name.ToLowerInvariant();
|
||||||
index_offset += (uint)filename_len;
|
index_offset += (uint)filename_len;
|
||||||
uint offset = file.View.ReadUInt32 (index_offset);
|
uint offset = file.View.ReadUInt32 (index_offset);
|
||||||
@ -83,7 +93,14 @@ namespace GameRes.Formats.Marble
|
|||||||
dir.Add (entry);
|
dir.Add (entry);
|
||||||
index_offset += 8;
|
index_offset += 8;
|
||||||
}
|
}
|
||||||
|
if (0 == dir.Count)
|
||||||
|
return null;
|
||||||
return new ArcFile (file, this, dir);
|
return new ArcFile (file, this, dir);
|
||||||
}
|
}
|
||||||
|
catch
|
||||||
|
{
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user