From 6bd04f5bc621d824229573521aa8f5edf0d51dda Mon Sep 17 00:00:00 2001 From: morkt Date: Sat, 27 Aug 2016 21:17:30 +0400 Subject: [PATCH] (ShiinaRio): additional encryption scheme. --- ArcFormats/ShiinaRio/WarcEncryption.cs | 49 ++++++++++++++++++++++++++ supported.html | 9 +++++ 2 files changed, 58 insertions(+) diff --git a/ArcFormats/ShiinaRio/WarcEncryption.cs b/ArcFormats/ShiinaRio/WarcEncryption.cs index a24b925c..4b31416a 100644 --- a/ArcFormats/ShiinaRio/WarcEncryption.cs +++ b/ArcFormats/ShiinaRio/WarcEncryption.cs @@ -722,4 +722,53 @@ namespace GameRes.Formats.ShiinaRio } } } + + [Serializable] + public class DodakureCrypt : IDecryptExtra + { + public void Decrypt (byte[] data, int index, uint length, uint flags) + { + if (length < 0x200) + return; + if ((flags & 0x204) == 0x204) + { + if (0x718E958D == LittleEndian.ToUInt32 (data, index)) + { + var input = new byte[0x200]; + Buffer.BlockCopy (data, index, input, 0, 0x200); + int remaining = LittleEndian.ToInt32 (input, 8); + int src = 12; + int dst = index; + bool rle = false; + while (remaining > 0) + { + int count = input[src++]; + if (rle) + { + byte v = data[dst-1]; + for (int i = 0; i < count; ++i) + data[dst++] = v; + } + else + { + Buffer.BlockCopy (input, src, data, dst, count); + src += count; + dst += count; + } + remaining -= count; + if (count < 0xFF) + rle = !rle; + } + } + if (length > 0x200) + data[index + 0x200] ^= (byte)length; + if (length > 0x201) + data[index + 0x201] ^= (byte)(length >> 8); + if (length > 0x202) + data[index + 0x202] ^= (byte)(length >> 16); + if (length > 0x203) + data[index + 0x203] ^= (byte)(length >> 24); + } + } + } } diff --git a/supported.html b/supported.html index d9f947d6..c3d197a6 100644 --- a/supported.html +++ b/supported.html @@ -195,6 +195,7 @@ Crime Rhyme
*.rpaRPA-3.0YesRen'PyKatawa Shoujo *.arc-YesWill +Chaste ☆ Chase!
Cynthia ~Sincerely to You~
Folklore Jam
Hapihosu! ~Osewasaremasu Nyuuin Seikatsu~
@@ -265,9 +266,12 @@ Seirei Tenshou
Se-kirara
Sharin no Kuni, Himawari no Shoujo
Shokusai no Miyako
+Smile Cubic!
+Suiheisen made Nan Mile?
Swan Song
Teakamamire no Tenshi
Zecchou Spiral!!
+Zettai Karen! Ojou-sama
*.tlgTLG0.0
TLG5.0
TLG6.0No *.ypfYPFYesYU-RIS @@ -375,6 +379,7 @@ Chikan Circle ShiinaRio v2.46
Chikan Circle 2 ShiinaRio v2.47
Chuuchuu Nurse ShiinaRio v2.45
Classmate no Okaa-san ShiinaRio v2.37
+Doushite Daite Kurenai no!?ShiinaRio v2.49
Draculius ShiinaRio v2.38
Enkaku Sousa 2.36 or 2.37
Gohoushi Nurse ~Mayonaka no Kyousei Call~ ShiinaRio v2.50
@@ -720,6 +725,7 @@ Wizard Links
Atori no Sora to Shinchuu no Tsuki
Favorite Sweet!
Nanapuri
+Sabae no Ou Scenario II
Soushinjutsu 3
*.spdSPDCNo @@ -1000,13 +1006,16 @@ Aniyome Kyouka-san to Sono Haha Chikako-san
Aru Kazoku no Kankeizu
Chou no Yume ~Futari no Chou~
Cosplay Ecchi ~Layer Kana no Yuuutsu~
+Fuka no Jugoku
Gakkou Yarashii Kaidan
Hanamaru! 2
Hime Kami 1/2
In'youchuu Goku ~Ryoujoku Jigoku Taimaroku~
In'youchuu Rei ~Ryoujoku Shiro Taima Emaki~
Koitsuma Biyori ~Yukino-san wa Hitozuma Kanrinin~
+Kowaku no Toki
Kuraibito
+Natsu Doki! Harem
Naze ka Kanojo ga Boku ni Ecchi o Sematte Kuru Ken
Onna Kyoushi Suzune
Oshioki ~Gakuen Reijou Kousei Keikaku~