import gzip, struct, sys p = sys.argv[1] raw = open(p, 'rb').read() try: d = gzip.decompress(raw) except Exception: d = raw phoff = struct.unpack('