mirror of
https://mirror.ghproxy.com/https://github.com/dexyfex/CodeWalker
synced 2024-11-16 20:17:30 +08:00
Add better error message for AWC encrypting stream of wrong length
This commit is contained in:
parent
d5ac5e8e59
commit
09d7cf68ff
@ -341,6 +341,10 @@ namespace CodeWalker.GameFiles
|
||||
{
|
||||
if (SingleChannelEncryptFlag && !WholeFileEncrypted)
|
||||
{
|
||||
if (datachunk.Data.Length % 4 != 0)
|
||||
{
|
||||
throw new Exception($"Unable to encrypt data chunk of length {datachunk.Data.Length}: Data to encrypt must be a multiple of 4 bytes long.\nEnsure that PCM streams have an even number of samples, and ADPCM streams have a multiple of 8 samples.");
|
||||
}
|
||||
Encrypt_RSXXTEA(datachunk.Data);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user