def hexDump(bytes):
"""Useful utility; prints the string in hexadecimal"""
for i in range(len(bytes)):
sys.stdout.write("%2x " % (ord(bytes[i])))
if (i+1) % 8 == 0:
print(repr(bytes[i-7:i+1]))
remainder = len(bytes) % 8
if(remainder != 0):
print(string.rjust("", (8-remainder)*3 - 1),
repr(bytes[i-len(bytes)%8:i+1]))
评论列表
文章目录