From 0249ecf40e8cc77f3437a8d0844c48725d4ba8d0 Mon Sep 17 00:00:00 2001 From: morkt Date: Wed, 30 Jul 2014 01:14:45 +0400 Subject: [PATCH] (GetKeyFromEntry): fixed PHENOMENO key. --- ArcFormats/ArcNPA.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ArcFormats/ArcNPA.cs b/ArcFormats/ArcNPA.cs index 411c4cc4..f89081e2 100644 --- a/ArcFormats/ArcNPA.cs +++ b/ArcFormats/ArcNPA.cs @@ -183,6 +183,8 @@ namespace GameRes.Formats if (arc.GameId != NpaTitleId.LAMENTO && arc.GameId != NpaTitleId.LAMENTOTR) encrypted_length += entry.RawName.Length; + if (encrypted_length > entry.Size) + encrypted_length = (int)entry.Size; using (var view = arc.File.CreateViewAccessor (entry.Offset, entry.Size)) { @@ -193,7 +195,7 @@ namespace GameRes.Formats try { int x; - for (x = 0; x < entry.Size && x < encrypted_length; x++) + for (x = 0; x < encrypted_length; x++) { if (arc.GameId == NpaTitleId.LAMENTO || arc.GameId == NpaTitleId.LAMENTOTR) { @@ -251,6 +253,7 @@ namespace GameRes.Formats case NpaTitleId.SONICOMI: case NpaTitleId.LOSTX: case NpaTitleId.DRAMATICALMURDER: + case NpaTitleId.PHENOMENO: key1 = 0x20101118; break; case NpaTitleId.TOTONO: