def _DecodeText(cls, packet_lines):
packet_bytes = []
# First line is timestamp and stuff, skip it.
# Format: 0x0010: 0000 0020 3aff 3ffe 0000 0000 0000 0000 ....:.?.........
for line in packet_lines[1:]:
m = re.match(r'\s+0x[a-f\d]+:\s+((?:[\da-f]{2,4}\s)*)', line, re.IGNORECASE)
if m is None: continue
for hexpart in m.group(1).split():
packet_bytes.append(base64.b16decode(hexpart.upper()))
return ''.join(packet_bytes)
评论列表
文章目录