diff options
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/corrupt.py | 2 | ||||
-rwxr-xr-x | tests/debug.py | 12 |
2 files changed, 7 insertions, 7 deletions
diff --git a/tests/corrupt.py b/tests/corrupt.py index 4a49d42..d994389 100755 --- a/tests/corrupt.py +++ b/tests/corrupt.py @@ -19,7 +19,7 @@ def corrupt(block): break tag ^= ntag - size = (tag & 0xfff) if (tag & 0xfff) != 0xfff else 0 + size = (tag & 0x1fff) if (tag & 0x1fff) != 0x1fff else 0 file.seek(size, os.SEEK_CUR) # lob off last 3 bytes diff --git a/tests/debug.py b/tests/debug.py index 2fcc05a..0088442 100755 --- a/tests/debug.py +++ b/tests/debug.py @@ -76,11 +76,11 @@ def main(*blocks): off += 4 type = (tag & 0x7fc00000) >> 22 - id = (tag & 0x003ff000) >> 12 - size = (tag & 0x00000fff) >> 0 + id = (tag & 0x003fe000) >> 13 + size = (tag & 0x00001fff) >> 0 iscrc = (type & 0x1f0) == 0x0f0 - data = file.read(size if size != 0xfff else 0) + data = file.read(size if size != 0x1fff else 0) if iscrc: crc = binascii.crc32(data[:4], crc) else: @@ -89,12 +89,12 @@ def main(*blocks): print '%04x: %08x %-14s %3s %3s %-23s %-8s' % ( off, tag, typeof(type) + (' bad!' if iscrc and ~crc else ''), - id if id != 0x3ff else '.', - size if size != 0xfff else 'x', + id if id != 0x1ff else '.', + size if size != 0x1fff else 'x', ' '.join('%02x' % ord(c) for c in data[:8]), ''.join(c if c >= ' ' and c <= '~' else '.' for c in data[:8])) - off += size if size != 0xfff else 0 + off += size if size != 0x1fff else 0 if iscrc: crc = 0 tag ^= (type & 1) << 31 |