public IList <RomChecksumRecord> ReadTableRecords(int pos, int count) { List <RomChecksumRecord> records = new List <RomChecksumRecord> (count); stream.Seek(tablePos, System.IO.SeekOrigin.Begin); for (int i = 0; i < count; i++) { RomChecksumRecord record = new RomChecksumRecord(stream.ReadInt32BigEndian(), stream.ReadInt32BigEndian(), stream.ReadInt32BigEndian()); records.Add(record); } this.checksumRecords = records; return(records); }
public int CalcSum(RomChecksumRecord record) { int sum = 0; if (!record.IsEmpty) { stream.Seek(record.StartAddress, SeekOrigin.Begin); for (int p = record.StartAddress; p < record.EndAddress; p += 4) { sum += stream.ReadInt32BigEndian(); } } return(sum); }
public bool IsValid(RomChecksumRecord record) { return(CalcChecksumValue(record) == record.Checksum); }
public int CalcChecksumValue(RomChecksumRecord record) { return(ChecksumConstant - CalcSum(record)); }
public int CalcChecksumValue(RomChecksumRecord record) { return ChecksumConstant - CalcSum (record); }
public IList<RomChecksumRecord> ReadTableRecords(int pos, int count) { List<RomChecksumRecord> records = new List<RomChecksumRecord> (count); stream.Seek (tablePos, System.IO.SeekOrigin.Begin); for (int i = 0; i < count; i++) { RomChecksumRecord record = new RomChecksumRecord (stream.ReadInt32BigEndian (), stream.ReadInt32BigEndian (), stream.ReadInt32BigEndian ()); records.Add (record); } this.checksumRecords = records; return records; }
public bool IsValid(RomChecksumRecord record) { return CalcChecksumValue (record) == record.Checksum; }
public int CalcSum(RomChecksumRecord record) { int sum = 0; if (!record.IsEmpty) { stream.Seek (record.StartAddress, SeekOrigin.Begin); for (int p = record.StartAddress; p < record.EndAddress; p += 4) { sum += stream.ReadInt32BigEndian (); } } return sum; }