RFpwner

解决mac上的pwntools问题

2025-03-04

解决mac上的pwntools问题

首先是pwntools的环境配置,brew下载完毕之后,

进入python3的交互界面

import site
site.getsitepackages()
回显
/opt/homebrew/Cellar/python@3.13/3.13.0_1/Frameworks/Python.framework/Versions/3.13/lib/python3.13/site-packages

之后,进入到该目录,然后创建一个mypath.pth

里面加入/opt/homebrew/Cellar/pwntools/4.13.1/libexec/lib/python3.13/site-packages

之后,就可以全局用了

之后,下载bintils,

brew install https://raw.githubusercontent.com/Gallopsled/pwntools-binutils/master/macos/binutils-amd64.rb

这样不行,打开这个页面

image.png

class BinutilsAmd64 < Formula
homepage "https://www.gnu.org/software/binutils/binutils.html"
url "https://ftpmirror.gnu.org/binutils/binutils-2.38.tar.gz"
mirror "https://ftp.gnu.org/gnu/binutils/binutils-2.38.tar.gz"
sha256 "b3f1dc5b17e75328f19bd88250bee2ef9f91fc8cbb7bd48bdb31390338636052"

# No --default-names option as it interferes with Homebrew builds.

def install
system "./configure", "--disable-debug",
"--disable-dependency-tracking",
"--prefix=#{prefix}",
"--target=amd64-unknown-linux-gnu",
"--disable-static",
"--disable-multilib",
"--disable-nls",
"--disable-werror"
system "make", "MAKEINFO=true", "-j"
system "make", "MAKEINFO=true", "install"
system "rm", "-rf", "#{prefix}/share/info"
end

test do
assert .include? 'main'
assert_equal 0, 0.exitstatus
end
end

之后在github创建一个仓库,然后里面

image.png

之后,通过brew tap lhy/my-tap [https://gitee.com/liu-sad/binutils.gi](https://gitee.com/liu-sad/binutils.git)t

创建一个tap仓库好像是,然后就可以本地下载了,

brew install binutils-amd64

然后,运行成功!

image.png

← Back to Home