angr / angrop

BSD 2-Clause "Simplified" License
589 stars 69 forks source link

AttributeError: 'unicode' object has no attribute '__slots__' #26

Closed leessang10 closed 6 years ago

leessang10 commented 6 years ago

Version

system OS: Ubuntu 14.04.5 LTS 64bit angr: 7.8.8.1 angrop:7.8.8.1 angr's requirements(archinfo, cle, claripy, pyvex...): 7.8.8.1

Problem

I recently installed a new version of angr(7.8.8.1) by pip. However, problems occur when using angrop Please help me find a solution...

Typed Commands in iPython

In [1]: import angr
WARNING | 2018-08-07 15:50:14,757 | angr.analyses.disassembly_utils | Your version of capstone does not support MIPS instruction groups.

In [2]: import angrop

In [3]: p = angr.Project("/bin/ls")

In [4]: rop = p.analyses.ROP()

In [5]: rop.find_gadgets()

Error Message

Exception in thread Thread-3:
Traceback (most recent call last):
  File "/usr/lib/python2.7/threading.py", line 810, in __bootstrap_inner
    self.run()
  File "/usr/lib/python2.7/threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 338, in _handle_tasks
    for i, task in enumerate(taskseq):
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 285, in <genexpr>
    self._taskqueue.put((((result._job, i, mapstar, (x,), {})
  File "/usr/lib/python2.7/multiprocessing/pool.py", line 436, in _get_tasks
    x = tuple(itertools.islice(it, size))
  File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angrop/rop.py", line 303, in _addresses_to_check_with_caching
    not self._block_has_ip_relative(a, bl):
  File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angrop/rop.py", line 264, in _block_has_ip_relative
    diff_constants = differing_constants(bl, bl2)
  File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angr/analyses/bindiff.py", line 186, in differing_constants
    differences = compare_statement_dict(statement, statement_2)
  File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angr/analyses/bindiff.py", line 237, in compare_statement_dict
    new_diffs = compare_statement_dict(getattr(statement_1, attr), getattr(statement_2, attr))
  File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angr/analyses/bindiff.py", line 237, in compare_statement_dict
    new_diffs = compare_statement_dict(getattr(statement_1, attr), getattr(statement_2, attr))
  File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angr/analyses/bindiff.py", line 237, in compare_statement_dict
    new_diffs = compare_statement_dict(getattr(statement_1, attr), getattr(statement_2, attr))
  File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angr/analyses/bindiff.py", line 228, in compare_statement_dict
    for attr in statement_1.__slots__:
AttributeError: 'unicode' object has no attribute '__slots__'
rhelmot commented 6 years ago

This bug has already been fixed on the master branch. Either install angr from Github (use the angr-dev repo for an install script) or wait for the next release.

On Tue, Aug 7, 2018 at 1:10 PM leessang10 notifications@github.com wrote:

Version

system OS: Ubuntu 14.04.5 LTS 64bit angr: 7.8.8.1 angrop:7.8.8.1 angr's requirements(archinfo, cle, claripy, pyvex...): 7.8.8.1 Problem

I recently installed a new version of angr(7.8.8.1) by pip. However, problems occur when using angrop Please help me find a solution... Typed Commands in iPython

In [1]: import angr WARNING | 2018-08-07 15:50:14,757 | angr.analyses.disassembly_utils | Your version of capstone does not support MIPS instruction groups.

In [2]: import angrop

In [3]: p = angr.Project("/bin/ls")

In [4]: rop = p.analyses.ROP()

In [5]: rop.find_gadgets()

Error Message

Exception in thread Thread-3: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 810, in bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 763, in run self.target(*self.args, **self.__kwargs) File "/usr/lib/python2.7/multiprocessing/pool.py", line 338, in _handle_tasks for i, task in enumerate(taskseq): File "/usr/lib/python2.7/multiprocessing/pool.py", line 285, in self._taskqueue.put((((result._job, i, mapstar, (x,), {}) File "/usr/lib/python2.7/multiprocessing/pool.py", line 436, in _get_tasks x = tuple(itertools.islice(it, size)) File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angrop/rop.py", line 303, in _addresses_to_check_with_caching not self._block_has_ip_relative(a, bl): File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angrop/rop.py", line 264, in _block_has_ip_relative diff_constants = differing_constants(bl, bl2) File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angr/analyses/bindiff.py", line 186, in differing_constants differences = compare_statement_dict(statement, statement_2) File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angr/analyses/bindiff.py", line 237, in compare_statement_dict new_diffs = compare_statement_dict(getattr(statement_1, attr), getattr(statement_2, attr)) File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angr/analyses/bindiff.py", line 237, in compare_statement_dict new_diffs = compare_statement_dict(getattr(statement_1, attr), getattr(statement_2, attr)) File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angr/analyses/bindiff.py", line 237, in compare_statement_dict new_diffs = compare_statement_dict(getattr(statement_1, attr), getattr(statement_2, attr)) File "/home/lsm/angr-dev/angr/lib/python2.7/site-packages/angr/analyses/bindiff.py", line 228, in compare_statement_dict for attr in statement_1.slots: AttributeError: 'unicode' object has no attribute 'slots__'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/salls/angrop/issues/26, or mute the thread https://github.com/notifications/unsubscribe-auth/ACYg9TSNH7En81ONs06Om452Zwd9FGnXks5uOfRCgaJpZM4Vyz7U .

leessang10 commented 6 years ago

Thank you for your prompt reply!! You mean I should reinstall angr && angrop? I'm also using your MechPhish(Driller, Rex, etc), so which version would you recommand?

rhelmot commented 6 years ago

I do mean that you should reinstall angr, via my explanation above. Your current versions of the mechaphish components should be fine.

On Tue, Aug 7, 2018 at 1:19 PM leessang10 notifications@github.com wrote:

Thank you for your prompt reply!! You mean I should reinstall angr && angrop? I'm also using your MechPhish(Driller, Rex, etc), so which version would you recommand?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/salls/angrop/issues/26#issuecomment-411188626, or mute the thread https://github.com/notifications/unsubscribe-auth/ACYg9c8RqqcWUEOSvf2wfHdVKvzruhg3ks5uOfZsgaJpZM4Vyz7U .

leessang10 commented 6 years ago

Thank you!! I solved the problem by reinstalling angr.

The following code is written for anyone with the same problem as me. It will help them fix the problem.

pip uninstall angr
pip install git+https://github.com/angr/angr.git
rhelmot commented 6 years ago

For anyone else who encounters this problem in the future: do not do that, you will be mixing versions of the angr libraries from pip and github, which is a recipe for disaster. Do this:

pip uninstall angr cle claripy pyvex archinfo
git clone https://github.com/angr/angr-dev
cd angr-dev
./setup.sh