コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }
コード例 #3
0
 public bool IsValid(RomChecksumRecord record)
 {
     return(CalcChecksumValue(record) == record.Checksum);
 }
コード例 #4
0
 public int CalcChecksumValue(RomChecksumRecord record)
 {
     return(ChecksumConstant - CalcSum(record));
 }
コード例 #5
0
 public int CalcChecksumValue(RomChecksumRecord record)
 {
     return ChecksumConstant - CalcSum (record);
 }
コード例 #6
0
        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;
        }
コード例 #7
0
 public bool IsValid(RomChecksumRecord record)
 {
     return CalcChecksumValue (record) == record.Checksum;
 }
コード例 #8
0
 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;
 }