mirror of
https://github.com/crskycode/GARbro.git
synced 2024-11-27 07:34:00 +08:00
add support of PSV mpk
This commit is contained in:
parent
66dde11935
commit
4a81140a2c
@ -39,11 +39,31 @@ namespace GameRes.Formats.NitroPlus
|
||||
|
||||
public override ArcFile TryOpen (ArcView file)
|
||||
{
|
||||
uint version_temp = file.View.ReadUInt32 (4);
|
||||
int count = file.View.ReadInt32 (8);
|
||||
if (!IsSaneCount (count))
|
||||
return null;
|
||||
uint index_offset = 0x48;
|
||||
var dir = new List<Entry> (count);
|
||||
uint index_offset = 0;
|
||||
if (version_temp == 65536)
|
||||
{
|
||||
index_offset = 0x44;
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
var name = file.View.ReadString (index_offset+0x1c, 0xE0);
|
||||
var entry = Create<PackedEntry> (name);
|
||||
entry.Offset = file.View.ReadInt32 (index_offset);
|
||||
entry.Size = file.View.ReadUInt32 (index_offset+4);
|
||||
entry.UnpackedSize = file.View.ReadUInt32 (index_offset+8);
|
||||
if (!entry.CheckPlacement (file.MaxOffset))
|
||||
return null;
|
||||
dir.Add (entry);
|
||||
index_offset += 0x100;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
index_offset = 0x48;
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
var name = file.View.ReadString (index_offset+0x18, 0xE0);
|
||||
@ -56,6 +76,7 @@ namespace GameRes.Formats.NitroPlus
|
||||
dir.Add (entry);
|
||||
index_offset += 0x100;
|
||||
}
|
||||
}
|
||||
return new ArcFile (file, this, dir);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user