restore_system_call.py 文件源码

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

项目:peda-arm 作者: alset0326 项目源码 文件源码
def do():
    system_calls = {}
    p = progressbar.ProgressBar(maxval=500).start()
    for index, line in enumerate(open('unistd.h', 'r').readlines()):
        # print repr(line.strip())
        try:
            if '(' in line:
                p.update(index)
                num = re.search('\((.*)\)', line).group(1)
                num = int(eval(num))
                func_name = line.split('(')[0].strip()
                system_calls[num] = [func_name]
                system_calls[num].extend(get_system_call(func_name))
                # print system_calls[num][1]
        except Exception as e:
            print index, line, e.message

    p.finish()
    open('system_calls', 'w').write(zlib.compress(pickle.dumps(system_calls)))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号