(WARC): support archives versions 1.40 and 1.20

This commit is contained in:
morkt
2017-01-25 09:35:56 +04:00
parent f40102bef9
commit 93293d3aed
3 changed files with 12 additions and 3 deletions

View File

@@ -84,7 +84,7 @@ namespace GameRes.Formats.ShiinaRio // 椎名里緒
return null;
int version = file.View.ReadByte (7) - 0x30;
version = 100 + version * 10;
if (170 != version && 130 != version && 150 != version)
if (170 != version && 150 != version && 140 != version && 130 != version && 120 != version)
throw new NotSupportedException ("Not supported WARC version");
uint index_offset = 0xf182ad82u ^ file.View.ReadUInt32 (8);
if (index_offset >= file.MaxOffset)

View File

@@ -141,9 +141,9 @@ namespace GameRes.Formats.ShiinaRio
uint effective_length = Math.Min (data_length, 1024u);
int a, b;
uint fac = 0;
Rand = data_length;
if (WarcVersion > 120)
{
Rand = data_length;
a = (sbyte)data[index] ^ (sbyte)data_length;
b = (sbyte)data[index+1] ^ (sbyte)(data_length / 2);
if (data_length != MaxIndexLength)