mac安装pwntools(python3.8)解决多数问题
博客说明
文章所涉及的资料来自互联网整理和个人总结,意在于个人学习和经验汇总,如有什么地方侵权,请联系本人删除,谢谢!
安装pwntools
贴一下官方文档地址
http://docs.pwntools.com/en/stable/install/binutils.html#mac-os-x
采用homebrew
安装
brew install pwntools
一顿等待之后

配置python
进入python目录
/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages
创建mypath.pth

把下面的这段话写上去
/usr/local/Cellar/pwntools/4.0.1_1/libexec/lib/python3.8/site-packages

发现有错误,提示我们安装binutils
安装binutils
export ARCH='amd64'
brew install https://raw.githubusercontent.com/Gallopsled/pwntools-binutils/master/osx/binutils-$ARCH.rb
还是报错,是因为地址的问题,改动了一下

brew install https://raw.githubusercontent.com/Gallopsled/pwntools-binutils/master/macos/binutils-amd64.rb
使用下面的命令发现可以安装

测试
>>> import pwn
>>> pwn.asm("xor eax,eax")
b'1\xc0'

发现已经成功,遇到了好多坑
感谢
万能的网络
以及勤劳的自己
网友评论