mirror of
https://github.com/crskycode/GARbro.git
synced 2024-12-23 19:34:15 +08:00
add support of PSV mpk
This commit is contained in:
parent
66dde11935
commit
4a81140a2c
@ -39,22 +39,43 @@ 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);
|
||||
for (int i = 0; i < count; ++i)
|
||||
uint index_offset = 0;
|
||||
if (version_temp == 65536)
|
||||
{
|
||||
var name = file.View.ReadString (index_offset+0x18, 0xE0);
|
||||
var entry = Create<PackedEntry> (name);
|
||||
entry.Offset = file.View.ReadInt64 (index_offset);
|
||||
entry.Size = file.View.ReadUInt32 (index_offset+8);
|
||||
entry.UnpackedSize = file.View.ReadUInt32 (index_offset+0x10);
|
||||
if (!entry.CheckPlacement (file.MaxOffset))
|
||||
return null;
|
||||
dir.Add (entry);
|
||||
index_offset += 0x100;
|
||||
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);
|
||||
var entry = Create<PackedEntry> (name);
|
||||
entry.Offset = file.View.ReadInt64 (index_offset);
|
||||
entry.Size = file.View.ReadUInt32 (index_offset+8);
|
||||
entry.UnpackedSize = file.View.ReadUInt32 (index_offset+0x10);
|
||||
if (!entry.CheckPlacement (file.MaxOffset))
|
||||
return null;
|
||||
dir.Add (entry);
|
||||
index_offset += 0x100;
|
||||
}
|
||||
}
|
||||
return new ArcFile (file, this, dir);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user