(MPK): check if *.msc entries are actually encrypted.

This commit is contained in:
morkt 2017-03-03 17:42:51 +04:00
parent bbc77ecbaf
commit 01cd7d7675

View File

@ -76,12 +76,11 @@ namespace GameRes.Formats.Propeller
public override Stream OpenEntry (ArcFile arc, Entry entry) public override Stream OpenEntry (ArcFile arc, Entry entry)
{ {
if (!entry.Name.EndsWith (".msc", StringComparison.InvariantCultureIgnoreCase)) var input = arc.File.CreateStream (entry.Offset, entry.Size);
return base.OpenEntry (arc, entry); if (!entry.Name.EndsWith (".msc", StringComparison.InvariantCultureIgnoreCase)
var data = arc.File.View.ReadBytes (entry.Offset, entry.Size); || 0x88 != input.PeekByte())
for (int i = 0; i < data.Length; ++i) return input;
data[i] ^= 0x88; return new XoredStream (input, 0x88);
return new BinMemoryStream (data, entry.Name);
} }
} }
} }