(CxEncryption.Init): control block expected to be on a dword boundary.

This commit is contained in:
morkt
2016-07-07 08:22:31 +04:00
parent 29d9a262f3
commit db294724dc

View File

@@ -110,7 +110,7 @@ namespace GameRes.Formats.KiriKiri
unsafe unsafe
{ {
byte* begin = view.GetPointer (0); byte* begin = view.GetPointer (0);
byte* end = begin + (((uint)tpm.MaxOffset - 0x1000u) & ~0xFu); byte* end = begin + (((uint)tpm.MaxOffset - 0x1000u) & ~0x3u);
try { try {
while (begin < end) while (begin < end)
{ {
@@ -128,7 +128,7 @@ namespace GameRes.Formats.KiriKiri
ControlBlock[i] = ~src[i]; ControlBlock[i] = ~src[i];
return; return;
} }
begin += 0x10; // control block expected to be on a paragraph boundary begin += 4; // control block expected to be on a dword boundary
} }
throw new InvalidEncryptionScheme ("No control block found inside TPM plugin"); throw new InvalidEncryptionScheme ("No control block found inside TPM plugin");
} }