ufrisk / LeechCore

LeechCore - Physical Memory Acquisition Library & The LeechAgent Remote Memory Acquisition Agent
GNU General Public License v3.0
488 stars 92 forks source link

Missing depednency, byteswap.h, MacOS 13.6 #36

Open phillip-at-work opened 9 months ago

phillip-at-work commented 9 months ago

Encountered missing dependency during pip install. Seems to be a general macos issue. See full trace. Can you suggest a fix?

(volatility) indigo-mac-000:volatility3 indigo$ pip install leechcorepyc DEPRECATION: Loading egg at /Users/indigo/anaconda3/envs/volatility/lib/python3.11/site-packages/pefile-2023.2.7-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 DEPRECATION: Loading egg at /Users/indigo/anaconda3/envs/volatility/lib/python3.11/site-packages/volatility3-2.5.2-py3.11.egg is deprecated. pip 24.3 will enforce this behaviour change. A possible replacement is to use pip for package installation.. Discussion can be found at https://github.com/pypa/pip/issues/12330 Collecting leechcorepyc Using cached leechcorepyc-2.16.5.tar.gz (177 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: leechcorepyc Building wheel for leechcorepyc (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [51 lines of output] /Library/Developer/CommandLineTools/usr/bin/make clean -C leechcore rm -f .o || true rm -f /.o || true rm -f .so || true /Library/Developer/CommandLineTools/usr/bin/make clean -C leechcore_ft601_driver_linux || true rm -f *.o /Library/Developer/CommandLineTools/usr/bin/make clean -C leechcore_device_qemu || true make: ** leechcore_device_qemu: No such file or directory. Stop. /Library/Developer/CommandLineTools/usr/bin/make clean -C leechcore_device_rawtcp || true rm -f .o rm files/.so || true rm: files/.so: No such file or directory rm leechcore.so || true rm: leechcore.so: No such file or directory rm leechcorepyc/.so || true rm: leechcorepyc/.so: No such file or directory /Library/Developer/CommandLineTools/usr/bin/make -C leechcore gcc -c -o oscompatibility.o oscompatibility.c -I. -D LINUX -D _GNU_SOURCE -shared -fPIC -fvisibility=hidden -pthread pkg-config libusb-1.0 --libs --cflags -fPIE -fPIC -pie -fstack-protector-strong -D_FORTIFY_SOURCE=2 -O1 -Wl,-z,noexecstack -Wall -Wno-multichar -Wno-unused-result -Wno-unused-variable -Wno-unused-value -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast clang: warning: -lusb-1.0: 'linker' input unused [-Wunused-command-line-argument] clang: warning: -Wl,-z,noexecstack: 'linker' input unused [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-L/opt/homebrew/Cellar/libusb/1.0.26/lib' [-Wunused-command-line-argument] clang: warning: argument unused during compilation: '-pie' [-Wunused-command-line-argument] In file included from oscompatibility.c:40: ./oscompatibility.h:29:10: fatal error: 'byteswap.h' file not found

include

           ^~~~~~~~~~~~
  1 error generated.
  make[1]: *** [oscompatibility.o] Error 1
  make: *** [all] Error 2
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.macosx-11.1-arm64-cpython-311
  creating build/lib.macosx-11.1-arm64-cpython-311/leechcorepyc
  copying leechcorepyc/__init__.py -> build/lib.macosx-11.1-arm64-cpython-311/leechcorepyc
  running build_ext
  building 'leechcorepyc.leechcorepyc' extension
  creating build/temp.macosx-11.1-arm64-cpython-311
  clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /Users/indigo/anaconda3/envs/volatility/include -arch arm64 -fPIC -O2 -isystem /Users/indigo/anaconda3/envs/volatility/include -arch arm64 -DLINUX= -Iincludes -I/usr/include/libusb-1.0/ -I/Users/indigo/anaconda3/envs/volatility/include/python3.11 -c leechcorepyc.c -o build/temp.macosx-11.1-arm64-cpython-311/leechcorepyc.o -I. -L. -l:leechcore.so -shared -fPIC -fvisibility=hidden
  clang: warning: -l:leechcore.so: 'linker' input unused [-Wunused-command-line-argument]
  clang: warning: argument unused during compilation: '-L.' [-Wunused-command-line-argument]
  clang: warning: argument unused during compilation: '-shared' [-Wunused-command-line-argument]
  In file included from leechcorepyc.c:6:
  In file included from ./leechcorepyc.h:24:
  ./oscompatibility.h:28:10: fatal error: 'byteswap.h' file not found
  #include <byteswap.h>
           ^~~~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/clang' failed with exit code 1
  [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for leechcorepyc Running setup.py clean for leechcorepyc Failed to build leechcorepyc ERROR: Could not build wheels for leechcorepyc, which is required to install pyproject.toml-based projects

ufrisk commented 9 months ago

macOS is currently not supported unfortunately.

I got an M2 mac a month ago or so just to be able to add support, but other work have come in-between unfortunately.

I'll put this up as an enhancement suggestion.

ConnorBP commented 2 months ago

I would like to get this working on my mac. Would be nice to use it as my attack device since it is my favorite development device. I could give it some attempt, though I'm unsure what porting this for mac might entail. Has anyone else had any success with this so far they would like to share? Or a fork that has already been started?

Edit: found this gist 😄 https://gist.github.com/atr000/249599