config.py 文件源码

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

项目:kAFL 作者: RUB-SysSec 项目源码 文件源码
def parse_range_ip_filter(string):
    m = re.match(r"([(0-9abcdef]{1,16})(?:-([0-9abcdef]{1,16}))?$", string.replace("0x", "").lower())
    if not m:
        raise argparse.ArgumentTypeError("'" + string + "' is not a range of number.")

    #print(m.group(1))
    #print(m.group(2))
    start = min(int(m.group(1).replace("0x", ""), 16), int(m.group(2).replace("0x", ""), 16))
    end = max(int(m.group(1).replace("0x", ""), 16), int(m.group(2).replace("0x", ""), 16)) or start

    if start > end:
        raise argparse.ArgumentTypeError("Invalid range specified.")
    return list([start, end])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号