|
- import sys
- def show(f):
- d=open(f,'rb').read()
- n=d[0]|d[1]<<8
- print(f,'len',n,'file',len(d))
- print('code:',d[2:2+n].hex(' '))
- t=d[2+n:]
- print('tail:',t.hex(' '))
- print('asc :',''.join(chr(b) if 32<=b<127 else '.' for b in t))
- for f in sys.argv[1:]: show(f)
|