recognize more of Nexas archives.

This commit is contained in:
morkt 2015-09-03 07:13:12 +04:00
parent 40c280a23c
commit 503855b55b
2 changed files with 14 additions and 3 deletions

View File

@ -64,10 +64,17 @@ namespace GameRes.Formats.NeXAS
public override bool IsHierarchic { get { return false; } }
public override bool CanCreate { get { return false; } }
public PacOpener ()
{
Signatures = new uint[] { 0x00434150, 0 };
}
public override ArcFile TryOpen (ArcView file)
{
if (!file.View.AsciiEqual (0, "PAC") || 'K' == file.View.ReadByte (3))
return null;
int count = file.View.ReadInt32 (4);
if (count <= 0 || count > 0xfffff)
if (!IsSaneCount (count))
return null;
int pack_type = file.View.ReadInt32 (8);
uint index_size = file.View.ReadUInt32 (file.MaxOffset-4);
@ -95,7 +102,7 @@ namespace GameRes.Formats.NeXAS
};
if (!entry.CheckPlacement (file.MaxOffset))
return null;
entry.IsPacked = pack_type != 0;
entry.IsPacked = pack_type != 0 && (pack_type != 4 || entry.Size != entry.UnpackedSize);
dir.Add (entry);
}
if (0 == pack_type)

View File

@ -113,7 +113,11 @@ Binary Pot<br/>
Tsukihime<br/>
Umineko<br/>
</td></tr>
<tr><td>*.pac</td><td><tt>PAC</tt></td><td>No</td><td>NeXAS</td><td>Maji de Watashi ni Koishinasai!</td></tr>
<tr><td>*.pac</td><td><tt>PAC</tt></td><td>No</td><td>NeXAS</td><td>
Baldr Sky DiveX<br/>
Jinki Extend Re:Vision<br/>
Maji de Watashi ni Koishinasai!<br/>
</td></tr>
<tr class="odd"><td>*.pac</td><td><tt>PAC1</tt></td><td>No</td><td rowspan="2">Riddle Soft</td><td rowspan="2">
Hana Hiraku<br/>
Iinari<br/>