(name);
entry.Offset = index.ReadInt64();
- entry.Size = index.ReadUInt32();
+ entry.UnpackedSize = index.ReadUInt32();
+ entry.Size = index.ReadUInt32();
+ entry.AlignedSize = index.ReadUInt32();
if (!entry.CheckPlacement (max_offset))
return null;
- entry.UnpackedSize = index.ReadUInt32();
- entry.AlignedSize = index.ReadUInt32();
- entry.IsPacked = index.ReadInt32() != 0;
+ entry.IsPacked = index.ReadInt32 () != 0;
if (string.IsNullOrEmpty (entry.Type) && is_audio)
{
entry.Type = "audio";
}
- string password = "";
- if (!entry.IsPacked && scheme.TypeKeys != null)
+ if (scheme.Version > 0)
{
- password = scheme.GetTypePassword (name, is_audio);
- }
- if (!string.IsNullOrEmpty (password) || is_video)
- {
- password = string.Format ("{0} {1:X08} {2}", name.ToLowerInvariant(), entry.UnpackedSize, password);
- entry.Key = Encodings.cp932.GetBytes (password);
+ string password = "";
+ if (!entry.IsPacked && scheme.TypeKeys != null)
+ {
+ password = scheme.GetTypePassword (name, is_audio);
+ }
+ if (!string.IsNullOrEmpty (password) || is_video)
+ {
+ password = string.Format ("{0} {1:X08} {2}", name.ToLowerInvariant(), entry.UnpackedSize, password);
+ entry.Key = Encodings.cp932.GetBytes (password);
+ }
}
dir.Add (entry);
}
@@ -221,7 +229,16 @@ namespace GameRes.Formats.Musica
}
}
if (is_video)
+ {
+ if (scheme.Version < 1)
+ {
+ var table = new byte[0x100];
+ for (int i = 0; i < 0x100; ++i)
+ table[video_key[i]] = (byte)i;
+ video_key = table;
+ }
return new MovPazArchive (file, this, dir, scheme.Version, xor_key, video_key, parts);
+ }
return new PazArchive (file, this, dir, scheme.Version, xor_key, scheme.ArcKeys[arc_name].DataKey, parts);
}
@@ -258,7 +275,8 @@ namespace GameRes.Formats.Musica
if (null == input)
return Stream.Null;
- input = new XoredStream (input, parc.XorKey);
+ if (parc.XorKey != 0)
+ input = new XoredStream (input, parc.XorKey);
if (parc is MovPazArchive)
input = DecryptVideo (input, (MovPazArchive)parc, pent);
else
@@ -280,6 +298,17 @@ namespace GameRes.Formats.Musica
Stream DecryptVideo (Stream input, MovPazArchive arc, PazEntry entry)
{
+ if (arc.Version < 1)
+ {
+ using (input)
+ {
+ var data = new byte[entry.AlignedSize];
+ input.Read (data, 0, data.Length);
+ for (int i = 0; i < data.Length; ++i)
+ data[i] = arc.MovKey[data[i]];
+ return new BinMemoryStream (data, entry.Name);
+ }
+ }
var key = new byte[0x100];
for (int i = 0; i < 0x100; ++i)
key[i] = (byte)(arc.MovKey[i] ^ entry.Key[i % entry.Key.Length]);
diff --git a/supported.html b/supported.html
index 064703e8..ff05b33b 100644
--- a/supported.html
+++ b/supported.html
@@ -131,6 +131,7 @@ Happy Princess
Happy Princess ~Another Fairytale~
Idol ☆ Revolution
Katahane
+Magical Kanon 2 ~Hiiro no Bergamot~
Narimono
Reconquista
Switch!! ~Boku ga Natsu ni Omou Koto~
@@ -1251,6 +1252,7 @@ Tiara
*.gbc | GBCF | No |
*.paz | - | No | Musica |
+Haru no Ashioto
Tsumi no Hikari Rendezvous
|
arc.dat | - | No | AdvSys3 |
@@ -1305,6 +1307,7 @@ Tsumadori
|
*.epk | EPK | No | Ellefin Game System |
Angelium -Tokimeki Love God-
+Teri ☆ Mix
|
*.elg | ELG | No |