Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified ArcFormats/Resources/Formats.dat
Binary file not shown.
39 changes: 39 additions & 0 deletions ArcFormats/ShiinaRio/WarcEncryption.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1311,4 +1311,43 @@ unsafe void DoCrypt (byte[] data, int index, uint length)
}
}
}

[Serializable]
public class Ushimitsu2Crypt : IDecryptExtra
{
public void Decrypt(byte[] data, int index, uint length, uint flags)
{
byte[] key = new byte[]
{
0x4B, 0x4D, 0x36, 0x35, 0x33, 0x32, 0x20, 0x43,
0x50, 0x55, 0x20, 0x63, 0x6F, 0x72, 0x65, 0x20,
0x65, 0x6D, 0x75, 0x6C, 0x61, 0x74, 0x69, 0x6F,
0x6E, 0x20, 0x3A, 0x20, 0x43, 0x6F, 0x70, 0x79,
0x72, 0x69, 0x67, 0x68, 0x74, 0x28, 0x43, 0x29,
0x20, 0x32, 0x30, 0x30, 0x35, 0x2C, 0x36, 0x20,
0x59, 0x2E, 0x59, 0x61, 0x6D, 0x61, 0x64, 0x61,
0x2F, 0x53, 0x54, 0x55, 0x44, 0x49, 0x4F, 0x20,
0x82, 0xE6, 0x82, 0xB5, 0x82, 0xAD, 0x82, 0xF1
};

if (length >= 0x200)
{
if ((flags & 0x202) == 0x202)
{
for (int i = 0; i < ((length & 0x7E) | 1); i++)
{
data[index + i] ^= key[i % 0x40];
}
var value = MemoryMarshal.Read<uint>(data.AsSpan(index + 0x100));
value ^= length;
MemoryMarshal.Write<uint>(data.AsSpan(index + 0x100), ref value);
}
}
}

public void Encrypt(byte[] data, int index, uint length, uint flags)
{
throw new NotImplementedException();
}
}
}
Loading