Fix CHD parsing, threading, version

This commit is contained in:
Matt Nadareski
2020-07-19 21:59:34 -07:00
parent 4596c7b299
commit ce38911d66
10 changed files with 77 additions and 62 deletions

View File

@@ -67,7 +67,7 @@ namespace SabreTools.Library.FileTypes
using (BinaryReader br = new BinaryReader(stream, Encoding.Default, true))
{
chd.tag = br.ReadCharsBigEndian(8);
chd.tag = br.ReadChars(8);
chd.length = br.ReadUInt32BigEndian();
chd.version = br.ReadUInt32BigEndian();
chd.flags = (Flags)br.ReadUInt32BigEndian();
@@ -75,11 +75,14 @@ namespace SabreTools.Library.FileTypes
chd.totalhunks = br.ReadUInt32BigEndian();
chd.logicalbytes = br.ReadUInt64BigEndian();
chd.metaoffset = br.ReadUInt64BigEndian();
chd.md5 = br.ReadBytesBigEndian(16);
chd.parentmd5 = br.ReadBytesBigEndian(16);
chd.md5 = br.ReadBytes(16);
chd.parentmd5 = br.ReadBytes(16);
chd.hunkbytes = br.ReadUInt32BigEndian();
chd.sha1 = br.ReadBytesBigEndian(20);
chd.parentsha1 = br.ReadBytesBigEndian(20);
chd.sha1 = br.ReadBytes(20);
chd.parentsha1 = br.ReadBytes(20);
chd.MD5 = chd.md5;
chd.SHA1 = chd.sha1;
}
return chd;