From fcce2da234432cb516d4e67ddc26108476b173f4 Mon Sep 17 00:00:00 2001 From: morkt Date: Thu, 21 May 2015 23:42:45 +0400 Subject: [PATCH] fixed scripts decryption. --- ArcFormats/ArcEAGLS.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ArcFormats/ArcEAGLS.cs b/ArcFormats/ArcEAGLS.cs index ead319a6..be84cfb6 100644 --- a/ArcFormats/ArcEAGLS.cs +++ b/ArcFormats/ArcEAGLS.cs @@ -123,12 +123,12 @@ namespace GameRes.Formats.Eagls byte[] input = new byte[entry.Size]; arc.File.View.Read (entry.Offset, input, 0, entry.Size); int text_offset = 3600; - int text_length = (int)(entry.Size - 3600 - 2); - int seed = input[input.Length-1]; + int text_length = (int)(entry.Size - text_offset - 2); + int seed = (sbyte)input[input.Length-1]; for (int i = 0; i < text_length; i += 2) { seed = seed * 0x343FD + 0x269EC3; - int index = (seed >> 16) & 0x7fff; + int index = (int)(((uint)seed >> 16) & 0x7fff); input[text_offset + i] ^= (byte)Key[index % Key.Length]; } return new MemoryStream (input);