#!/usr/bin/env python3 import struct, sys d = open(sys.argv[1], 'rb').read() print('size', len(d), 'head', d[:16]) pos = 12 while pos + 8 <= len(d) and pos < 200000: name = d[pos:pos+4] if not all(65 <= c <= 90 for c in name): print(' stop at', pos, name) break ln_be = struct.unpack('>I', d[pos+4:pos+8])[0] ln_le = struct.unpack(' len(d): break