(name);
+ entry.Offset = file.View.ReadInt64 (index_offset);
+ entry.Size = file.View.ReadUInt32 (index_offset+8);
+ if (!entry.CheckPlacement (file.MaxOffset))
+ return null;
+ dir.Add (entry);
+ index_offset += 0x10;
+ }
+ return new ArcFile (file, this, dir);
+ }
+
+ public override Stream OpenEntry (ArcFile arc, Entry entry)
+ {
+ var input = arc.File.CreateStream (entry.Offset, entry.Size);
+ return new CryptoStream (input, new XorTransform (0x90), CryptoStreamMode.Read);
+ }
+ }
+}
diff --git a/ArcFormats/Slg/ImageTIG.cs b/ArcFormats/Slg/ImageTIG.cs
new file mode 100644
index 00000000..2dcf5492
--- /dev/null
+++ b/ArcFormats/Slg/ImageTIG.cs
@@ -0,0 +1,98 @@
+//! \file ImageTIG.cs
+//! \date Sat Jun 04 18:00:15 2016
+//! \brief SLG system encrypted PNG images.
+//
+// Copyright (C) 2016 by morkt
+//
+// Permission is hereby granted, free of charge, to any person obtaining a copy
+// of this software and associated documentation files (the "Software"), to
+// deal in the Software without restriction, including without limitation the
+// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+// sell copies of the Software, and to permit persons to whom the Software is
+// furnished to do so, subject to the following conditions:
+//
+// The above copyright notice and this permission notice shall be included in
+// all copies or substantial portions of the Software.
+//
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+// IN THE SOFTWARE.
+//
+
+using System.ComponentModel.Composition;
+using System.IO;
+using System.Security.Cryptography;
+
+namespace GameRes.Formats.Slg
+{
+ [Export(typeof(ImageFormat))]
+ public class TigFormat : PngFormat
+ {
+ public override string Tag { get { return "TIG"; } }
+ public override string Description { get { return "SLG system encrypted PNG image"; } }
+ public override uint Signature { get { return 0x7CF3C28B; } }
+
+ public override ImageMetaData ReadMetaData (Stream stream)
+ {
+ using (var proxy = new ProxyStream (stream, true))
+ using (var input = new CryptoStream (proxy, new TigTransform(), CryptoStreamMode.Read))
+ return base.ReadMetaData (input);
+ }
+
+ public override ImageData Read (Stream stream, ImageMetaData info)
+ {
+ using (var proxy = new ProxyStream (stream, true))
+ using (var input = new CryptoStream (proxy, new TigTransform(), CryptoStreamMode.Read))
+ return base.Read (input, info);
+ }
+
+ public override void Write (Stream file, ImageData image)
+ {
+ throw new System.NotImplementedException ("TigFormat.Write not implemented");
+ }
+ }
+
+ internal sealed class TigTransform : ICryptoTransform
+ {
+ const int BlockSize = 256;
+ uint m_key;
+
+ public bool CanReuseTransform { get { return true; } }
+ public bool CanTransformMultipleBlocks { get { return true; } }
+ public int InputBlockSize { get { return BlockSize; } }
+ public int OutputBlockSize { get { return BlockSize; } }
+
+ public TigTransform ()
+ {
+ m_key = 0x7F7F7F7F;
+ }
+
+ public int TransformBlock (byte[] inputBuffer, int inputOffset, int inputCount,
+ byte[] outputBuffer, int outputOffset)
+ {
+ for (int i = 0; i < inputCount; ++i)
+ {
+ m_key *= 0x343FD;
+ m_key += 0x269EC3;
+ outputBuffer[outputOffset+i] = (byte)(inputBuffer[inputOffset+i] - (m_key >> 16));
+ }
+ return inputCount;
+ }
+
+ public byte[] TransformFinalBlock (byte[] inputBuffer, int inputOffset, int inputCount)
+ {
+ byte[] outputBuffer = new byte[inputCount];
+ TransformBlock (inputBuffer, inputOffset, inputCount, outputBuffer, 0);
+ return outputBuffer;
+ }
+
+ public void Dispose ()
+ {
+ System.GC.SuppressFinalize (this);
+ }
+ }
+}
diff --git a/supported.html b/supported.html
index 537fcf66..86181010 100644
--- a/supported.html
+++ b/supported.html
@@ -364,6 +364,7 @@ Lovers Collection
Nachtmusik
Nachtmusik Another
Oto☆Puri
+Rakuen no Rukia ~Blood Moon Rising~
Samayou Mitama ni Yasuragi no Toki wo
Time Trouble ~Marie ni Kubikkake~
@@ -579,6 +580,7 @@ Before Dawn Daybreak ~Shinen no Utahime~
Gun-Katana
Jishou Seirei Majutsushi vs Shinsei Daiikkyuu Akuma
Kurogane no Tsubasa ~The Alchemist's Story~
+Mushitsukai
Yami no Koe series
*.dwq | BMP JPEG PNG JPEG+MASK PACKBMP+MASK
| No |
@@ -638,6 +640,7 @@ Cross Quartz
Hyakki Yakou
Saikyou Goshujin-sama! -Mighty My Master-
Saiminjutsu Re
+Wizard Links
*.med | MD | No |
*.tcd | TCD3 | No | TopCat |
@@ -809,9 +812,12 @@ Tokyo Necro
Thanatos no Koi ~In Ane Otouto Soukan~
|
*.gps | GPS | No |
-*.alb | ALB1.21 | No | SLG system |
+ |
*.szs | SZS100__ | No | SLG system |
+Sengoku Hime
Shihen 69 ~Shinen no Messiah~
|
+*.tig | \x7C\xF3\xC2\x8B | No |
+*.alb | ALB1.21 | No |
*.voi | - | No |
*.wag | IAF_ | No | Hexenhaus |
Angenehm Platz -Kleiner Garten Sie Erstellen-
|