variation of Circus resource archives.

This commit is contained in:
morkt 2016-02-05 15:51:43 +04:00
parent c4f9c1ed47
commit d0b4b1e8a5
2 changed files with 8 additions and 3 deletions

View File

@ -2,7 +2,7 @@
//! \date Mon Jun 15 16:11:56 2015 //! \date Mon Jun 15 16:11:56 2015
//! \brief Circus archive format. //! \brief Circus archive format.
// //
// Copyright (C) 2015 by morkt // Copyright (C) 2015-2016 by morkt
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
@ -51,6 +51,8 @@ namespace GameRes.Formats.Circus
if (count <= 1 || count > 0xfffff) if (count <= 1 || count > 0xfffff)
return null; return null;
var dir = ReadIndex (file, count, 0x30); var dir = ReadIndex (file, count, 0x30);
if (null == dir)
dir = ReadIndex (file, count, 0x3C);
if (null == dir) if (null == dir)
return null; return null;
return new ArcFile (file, this, dir); return new ArcFile (file, this, dir);
@ -64,12 +66,14 @@ namespace GameRes.Formats.Circus
return null; return null;
--count; --count;
uint next_offset = file.View.ReadUInt32 (index_offset+name_length); uint next_offset = file.View.ReadUInt32 (index_offset+name_length);
if (next_offset < 4+index_size)
return null;
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)
{ {
if (0 == file.View.ReadByte (index_offset))
return null;
string name = file.View.ReadString (index_offset, (uint)name_length); string name = file.View.ReadString (index_offset, (uint)name_length);
if (0 == name.Length)
return null;
var entry = FormatCatalog.Instance.Create<Entry> (name); var entry = FormatCatalog.Instance.Create<Entry> (name);
index_offset += name_length; index_offset += name_length;
uint offset = next_offset; uint offset = next_offset;

View File

@ -391,6 +391,7 @@ Soshite Ashita no Sekai yori<br/>
<tr><td>*.b</td><td><tt>ABMP7</tt><br/><tt>abmp10</tt><br/><tt>abmp11</tt></td><td>No</td></tr> <tr><td>*.b</td><td><tt>ABMP7</tt><br/><tt>abmp10</tt><br/><tt>abmp11</tt></td><td>No</td></tr>
<tr><td>*.png</td><td><tt>DPNG</tt></td><td>No</td></tr> <tr><td>*.png</td><td><tt>DPNG</tt></td><td>No</td></tr>
<tr class="odd"><td>*.dat</td><td>-</td><td>No</td><td rowspan="3">Circus</td><td rowspan="3"> <tr class="odd"><td>*.dat</td><td>-</td><td>No</td><td rowspan="3">Circus</td><td rowspan="3">
Infantaria XP<br/>
Maid no Yakata ~Zetsubou Hen~<br/> Maid no Yakata ~Zetsubou Hen~<br/>
</td></tr> </td></tr>
<tr class="odd"><td>*.crx</td><td><tt>CRXG</tt></td><td>No</td></tr> <tr class="odd"><td>*.crx</td><td><tt>CRXG</tt></td><td>No</td></tr>