mirror of
https://github.com/crskycode/GARbro.git
synced 2026-07-08 01:30:18 +08:00
(DameganeCrypt): another decryption scheme.
This commit is contained in:
@@ -92,6 +92,7 @@ namespace GameRes.Formats.KiriKiri
|
|||||||
{ arcStrings.ArcNoEncryption, NoCryptAlgorithm },
|
{ arcStrings.ArcNoEncryption, NoCryptAlgorithm },
|
||||||
{ "Cafe Sourire", new XorCrypt (0xcd) },
|
{ "Cafe Sourire", new XorCrypt (0xcd) },
|
||||||
{ "Coμ", new ComyuCrypt() },
|
{ "Coμ", new ComyuCrypt() },
|
||||||
|
{ "Damegane", new DameganeCrypt() },
|
||||||
{ "Fate/hollow ataraxia", new FateHACrypt() },
|
{ "Fate/hollow ataraxia", new FateHACrypt() },
|
||||||
{ "Fate/stay night", new FateCrypt() },
|
{ "Fate/stay night", new FateCrypt() },
|
||||||
{ "Imouto Style", new ImoutoStyleCrypt() },
|
{ "Imouto Style", new ImoutoStyleCrypt() },
|
||||||
@@ -1055,4 +1056,31 @@ NextEntry:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal class DameganeCrypt : ICrypt
|
||||||
|
{
|
||||||
|
public override byte Decrypt (Xp3Entry entry, long offset, byte value)
|
||||||
|
{
|
||||||
|
if (0 != (offset & 1))
|
||||||
|
return (byte)(value ^ entry.Hash);
|
||||||
|
else
|
||||||
|
return (byte)(value ^ offset);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Decrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count)
|
||||||
|
{
|
||||||
|
for (int i = 0; i < count; ++i, ++offset)
|
||||||
|
{
|
||||||
|
if (0 != (offset & 1))
|
||||||
|
values[pos+i] ^= (byte)entry.Hash;
|
||||||
|
else
|
||||||
|
values[pos+i] ^= (byte)offset;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public override void Encrypt (Xp3Entry entry, long offset, byte[] values, int pos, int count)
|
||||||
|
{
|
||||||
|
Decrypt (entry, offset, values, pos, count);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user