Exploit Development Env

This is about … .

pwntools

Installing this was no piece of cake. Running brew info pwntools did install it but it was not usable from a python console of file, whichever version I was trying to use. I kept getting the following error with a unicorn module:

error: [Errno 2] No such file or directory: '/private/var/folders/qr/0141vtnn6b90rb95k7dxt_v40000gn/T/pip-install-aay617qf/unicorn_2e7424c1f653496d8b2d9a21682df184/../../include/unicorn'

ย  ย  ย  [end of output]

ย  note: This error originates from a subprocess, and is likely not a problem with pip.

ย  ERROR: Failed building wheel for unicorn

ย  Running setup.py clean for unicorn

ย  Building wheel for colored-traceback (setup.py) ... done

ย  Created wheel for colored-traceback: filename=colored_traceback-0.3.0-py3-none-any.whl size=4608 sha256=57af77a3aec068552968097c7a71b2d672a6d8bbc5322635f77fa399f08cef04

ย  Stored in directory: /Users/user/Library/Caches/pip/wheels/10/49/bd/750e09783fb038570efede2d03819a7141fc2350de51daf575

Successfully built capstone intervaltree psutil colored-traceback

Failed to build unicorn

Installing collected packages: unicorn, sortedcontainers, pyserial, pyelftools, urllib3, python-dateutil, pysocks, pyparsing, pygments, pycparser, psutil, plumbum, pathlib2, MarkupSafe, intervaltree, idna, charset-normalizer, certifi, capstone, rpyc, ropgadget, requests, packaging, mako, colored-traceback, cffi, pynacl, cryptography, bcrypt, paramiko, pwntools

ย  Running setup.py install for unicorn ... error

ย  error: subprocess-exited-with-error

ย  ร— Running setup.py install for unicorn did not run successfully.

ย  โ”‚ exit code: 1

ย  โ•ฐโ”€> [6 lines of output]

ย  ย  ย  running install

ย  ย  ย  /opt/homebrew/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.

ย  ย  ย  ย  warnings.warn(

ย  ย  ย  running build

ย  ย  ย  Building C extensions

ย  ย  ย  error: [Errno 2] No such file or directory: '/private/var/folders/qr/0141vtnn6b90rb95k7dxt_v40000gn/T/pip-install-aay617qf/unicorn_2e7424c1f653496d8b2d9a21682df184/../../include/unicorn'

ย  ย  ย  [end of output]

ย  note: This error originates from a subprocess, and is likely not a problem with pip.

error: legacy-install-failure

  

ร— Encountered error while trying to install package.

โ•ฐโ”€> unicorn

  

note: This is an issue with the package mentioned above, not pip.

As it turned out, the PipPy package is too old and one must install the latest version some other way. I even tried building the unicorn myself but it did not help (even though it was installed).

Below is the solution that might also be helpful in similar cases:

MACOS_UNIVERSAL=no pip install capstone
pip install "git+https://github.com/aquynh/capstone.git#egg=capstone&subdirectory=bindings/python"

MACOS_UNIVERSAL=no pip install unicorn
pip install "git+https://github.com/unicorn-engine/unicorn.git#egg=unicorn&subdirectory=bindings/python"

References

Expand… https://pergunte.org/question/stack/53015819/installing-pwntools-on-macos