1

When I try to use angr I get this warning

import angr WARNING | 2018-06-30 15:10:26,560 | angr.state_plugins.unicorn_engine | failed loading "angr_native.dylib", unicorn support disabled (dlopen(/usr/local/lib/python2.7/site-packages/angr/lib/angr_native.dylib, 6): Library not loaded: libunicorn.1.dylib Referenced from: /usr/local/lib/python2.7/site-packages/angr/lib/angr_native.dylib
Reason: image not found: dlopen(/usr/local/lib/python2.7/site-packages/angr/lib/angr_native.dylib, 6): Library not loaded: libunicorn.1.dylib Referenced from: /usr/local/lib/python2.7/site-packages/angr/lib/angr_native.dylib
Reason: image not found)

Could you help to solve this problem?

Patrick Trentin
  • 7,126
  • 3
  • 23
  • 40
Rung K
  • 23
  • 4
  • Do you have `libunicorn.1.dylib` on your computer? What's its full path? Try Finder's search or in the worst case the slow brute-force `find / -name 'libunicorn.*' 2>/dev/null` or the – tripleee Jun 30 '18 at 20:17
  • Yes, it's on my computer. `/Library/Python/2.7/site-packages/unicorn/lib/libunicorn.a` `/Library/Python/2.7/site-packages/unicorn/lib/libunicorn.dylib` `/Users/cutlass/Library/Python/2.7/lib/python/site-packages/unicorn/lib/libunicorn.a` `/Users/cutlass/Library/Python/2.7/lib/python/site-packages/unicorn/lib/libunicorn.dylib` What should I do next? – Rung K Jul 01 '18 at 23:52
  • having exactly the same issue. – Krypton Jul 02 '18 at 05:04
  • Not sure how this applies on MacOS but on many Linux-based platforms, having `libfoo.so` but not `libfoo.`*version*`.so` is solved by installing the corresponding `-dev` package (i.e. you have used Apt or Yum to install `foo` but you still need `foo-dev` or `foo-devel`, respectively). As a distant hackish fallback, you can create the missing symlink yourself. – tripleee Jul 02 '18 at 08:10

1 Answers1

2

I got exactly the same issue. It was a shame on me that I did not follow the installation instruction https://docs.angr.io/INSTALL.html. On Mac, the following fix must be done.

BASEDIR=/usr/local/lib/python2.7/site-packages
# If you don't know where your site-packages folder is, use this to find them:
python2 -c "import site; print(site.getsitepackages())"

install_name_tool -change libunicorn.1.dylib "$BASEDIR"/unicorn/lib/libunicorn.dylib "$BASEDIR"/angr/lib/angr_native.dylib
install_name_tool -change libpyvex.dylib "$BASEDIR"/pyvex/lib/libpyvex.dylib "$BASEDIR"/angr/lib/angr_native.dylib
Krypton
  • 3,337
  • 5
  • 32
  • 52
  • 1
    I've tried it before, but after reading your advice, I've decided to follow installation instruction again. I thought there would be some dependency conflicts, so I followed the installation instruction again in a clean virtual environment, and it worked. It's a shame to me, too. Thank you for your advice. – Rung K Jul 02 '18 at 05:39