加载pwn模块时报错与解决

匿名 (未验证) 提交于 2019-12-02 23:35:02

错误一:

File "D:\Program Files\Python37\lib\site-packages\pwnlib\term\term.py", line 167


SyntaxError: invalid syntax

原因:

python3不再支持元组作为函数参数。

解决方案:

打开term.py,修改部分代码,去除元组参数。

 def goto(r, c):  #改了这里     do('cup', r - scroll + height - 1, c)
 def render_from(i, force = False, clear_after = False):     e = None     # `i` should always be a valid cell, but in case i f***ed up somewhere, I'll     # check it and just do nothing if something went wrong.     if i < 0 or i >= len(cells):         return     goto(cells[i].start[0],cells[i].start[1])  #改了这里     for c in cells[i:]:         if not force and c.start == e:             goto(cells[-1].end[0],cells[-1].end[1])  #改了这里             break         elif e:             c.start = e         render_cell(c, clear_after = clear_after)         e = c.end     if clear_after and (e[0] < scroll or e[1] < width - 1):         put('\x1b[J')     flush()

错误二:

import fcntl
ModuleNotFoundError: No module named 'fcntl'

原因:

windows中的python不自带fcntl而且这个模块

解决方案:

python路径下的Lib中新建一个fcntl.py文件,并写入:

 def fcntl(fd, op, arg=0):     return 0  def ioctl(fd, op, arg=0, mutable_flag=True):     if mutable_flag:         return 0     else:         return ""  def flock(fd, op):     return  def lockf(fd, operation, length=0, start=0, whence=0):     return

待续。。。

文章来源: https://blog.csdn.net/polaris_119/article/details/90521800
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!