test_creator.py 文件源码

python
阅读 34 收藏 0 点赞 0 评论 0

项目:amazonbeat 作者: awormuth 项目源码 文件源码
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)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号