Repository: angr/angr

Issue:
The version of CFFI>=1.7.0 maybe not correct
<!--
*Disclaimer:
The angr suite is maintained by a small team of volunteers.
While we cannot guarantee any timeliness for fixes and enhancements, we will do our best.
For more real-time help with angr, from us and the community, join our [Slack.](http://angr.io/invite/)*
-->
---

**Describe the bug.**
<!--
Please include a clear and concise description of what the bug is.
-->
I encounter a error, like this:
```
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/dist-packages/angr/project.py", line 131, in __init__
    self.loader = cle.Loader(self.filename, concrete_target=concrete_target, **load_options)
  File "/usr/local/lib/python3.6/dist-packages/cle/loader.py", line 133, in __init__
    self.initial_load_objects = self._internal_load(main_binary, *preload_libs, *force_load_libs, preloading=(main_binary, *preload_libs))
  File "/usr/local/lib/python3.6/dist-packages/cle/loader.py", line 652, in _internal_load
    obj = self._load_object_isolated(main_spec)
  File "/usr/local/lib/python3.6/dist-packages/cle/loader.py", line 832, in _load_object_isolated
    result = backend_cls(binary, binary_stream, is_main_bin=self.main_object is None, loader=self, **options)
  File "/usr/local/lib/python3.6/dist-packages/cle/backends/elf/elf.py", line 152, in __init__
    self._load_plt()
  File "/usr/local/lib/python3.6/dist-packages/cle/backends/elf/metaelf.py", line 90, in _load_plt
    sanity_check=not self.pic)
  File "/usr/local/lib/python3.6/dist-packages/cle/backends/elf/metaelf.py", line 49, in _add_plt_stub
    if sanity_check and target_addr not in [c.value for c in self._block(addr, skip_stmts=False).all_constants]:
  File "/usr/local/lib/python3.6/dist-packages/cle/backends/elf/metaelf.py", line 42, in _block
    return pyvex.IRSB(dat, addr, self.arch, bytes_offset=1 if thumb else 0, opt_level=1, skip_stmts=skip_stmts)
  File "/usr/local/lib/python3.6/dist-packages/pyvex/block.py", line 115, in __init__
    cross_insn_opt=cross_insn_opt,
  File "/usr/local/lib/python3.6/dist-packages/pyvex/lifting/__init__.py", line 83, in lift
    u_data = ffi.from_buffer(ffi.BVoidP, py_data + b'\0' * 8 if type(py_data) is bytes else py_data)
  File "/home/ling/.local/lib/python3.6/site-packages/cffi/api.py", line 362, in from_buffer
    require_writable)
TypeError: expected an array ctype, got 'void *'
```

and I solve it by upgrade cffi from cffi-1.12.2 to cffi-1.14.0.
In the setup.py of angr, the version of cffi is only required >=1.7.0

**Environment Information.**
<!--
Many common issues are caused by problems with the local Python environment.
Before submitting, double-check that your versions of all modules in the angr suite (angr, cle, pyvex, ...) are up to date.
Please include the output of `python -m angr.misc.bug_report` here.
-->


**To Reproduce.**
<!--
Please include *both a script to reproduce the crash, and attach the binary used, if possible*
-->
angr is v8.20.7.6


**Additional context.**
<!--
Add any other context about the problem here.
-->



Discussion:
I have run into this as well when upgrading an older existing venv. It looks like the API changed in 1.14.0, so we should probably pin `cffi>=1.14.0` in setup.py.
@twizmwazin can you please fix this?

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -147,7 +147,7 @@ def run(self, *args):
         'networkx>=2.0',
         'progressbar2',
         'rpyc',
-        'cffi>=1.7.0',
+        'cffi>=1.14.0',
         _UNICORN,
         'archinfo==8.20.7.6',
         'claripy==8.20.7.6',


Test patch: