Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

libcrypto Catalina #13

Open
ivancristina opened this issue Nov 12, 2019 · 4 comments
Open

libcrypto Catalina #13

ivancristina opened this issue Nov 12, 2019 · 4 comments

Comments

@ivancristina
Copy link

I know this issue is not specifically xpwn related, but I encountered a problem with Catalina where linker doesn't work properly

MBP-di-Ivan:build ivancristina$ make
[  5%] Built target common
[ 12%] Built target minizip
[ 33%] Built target hfs
[ 49%] Built target dmg
[ 52%] Built target dmg-bin
[ 56%] Built target hdutil
[ 59%] Built target hfsplus
[ 82%] Built target xpwn
[ 84%] Linking C executable xpwntool
ld: cannot link directly with dylib/framework, your binary is not an allowed client of /usr/lib/libcrypto.dylib for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [ipsw-patch/xpwntool] Error 1
make[1]: *** [ipsw-patch/CMakeFiles/xpwntool.dir/all] Error 2
make: *** [all] Error 2

Any help would be highly appreciated

@ivancristina ivancristina changed the title Libcrypto Catalina libcrypto Catalina Nov 12, 2019
@hexploitable
Copy link

hexploitable commented Nov 12, 2019

Basically openssl (and thus libcrypto) is deprecated on macos. You'll need to install openssl via brew and then replace the instances of /usr/lib/libcrypto.dylib with the openssl path to libcrypto, e.g. I've manually symlinked mine into: /usr/local/lib/

@ivancristina
Copy link
Author

I've done that too, but I still get the same error. The error reported up here happened after the openssl installation via homebrew

@hexploitable
Copy link

Did you set the search paths correctly in the env? I get past this error after that.

@honghaoz
Copy link

honghaoz commented Dec 29, 2021

Here is the detailed steps for a successful compiling on Big Sur (11.6.1) on an Intel Mac.

  1. clone the repo https://github.com/planetbeing/xpwn.git to a local dir
  2. cd to the cloned repo: cd ./xpwn
  3. mkdir build-dir
  4. cd ./build-dir
  5. brew install openssl
  6. make symlink: sudo ln -s /usr/local/opt/openssl/lib/libcrypto.dylib /usr/local/lib/libcrypto1.dylib, as @hexploitable mentioned above.
  7. set environment variables: (from No package 'libcrypto' found scipr-lab/libsnark#99 (comment))
    LD_LIBRARY_PATH=/usr/local/opt/openssl/lib:"${LD_LIBRARY_PATH}"
    CPATH=/usr/local/opt/openssl/include:"${CPATH}"
    PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig:"${PKG_CONFIG_PATH}"
    export LD_LIBRARY_PATH CPATH PKG_CONFIG_PATH
    
  8. Run CMake:
    CPPFLAGS=-I/usr/local/opt/openssl/include LDFLAGS=-L/usr/local/opt/openssl/lib PKG_CONFIG_PATH=/usr/local/opt/openssl/lib/pkgconfig cmake -DWITH_PROCPS=OFF -DWITH_SUPERCOP=OFF ..
    
  9. Apply changes from xpwntool.c update #15
    in ipsw-patch/xpwntool.c, add #include "xpwn/img3.h"
  10. Run make

Now you should see compiled bins under build-dir

davidxbors added a commit to davidxbors/external-tools that referenced this issue Nov 27, 2022
This commit adds xpwn, a tool used by iExtractor-manager.
The commit also solves this issue [1].
[1] planetbeing/xpwn#13

Signed-off-by: David Bors <daviddvd267@gmail.com>
razvand pushed a commit to malus-security/external-tools that referenced this issue Mar 5, 2023
This commit adds xpwn, a tool used by iExtractor-manager.
The commit also solves this issue [1].
[1] planetbeing/xpwn#13

Signed-off-by: David Bors <daviddvd267@gmail.com>
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants