angr / angr

A powerful and user-friendly binary analysis platform!
http://angr.io
BSD 2-Clause "Simplified" License
7.46k stars 1.07k forks source link

opening elfcore error #1704

Closed s0i37 closed 2 years ago

s0i37 commented 5 years ago

Describe the bug. I've an follow error when I try to load elfcore:

WARNING | 2019-08-27 13:36:45,681 | cle.elfcore | No SSE registers could be loaded from core file
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.7/dist-packages/angr/project.py", line 229, in __init__
    self.simos.configure_project()
  File "/usr/local/lib/python3.7/dist-packages/angr/simos/linux.py", line 40, in configure_project
    self._loader_addr = self.project.loader.extern_object.allocate()
  File "/usr/local/lib/python3.7/dist-packages/cle/loader.py", line 205, in extern_object
    self._map_object(self._extern_object)
  File "/usr/local/lib/python3.7/dist-packages/cle/loader.py", line 763, in _map_object
    base_addr = self._find_safe_rebase_addr(obj_size)
  File "/usr/local/lib/python3.7/dist-packages/cle/loader.py", line 829, in _find_safe_rebase_addr
    raise CLEOperationError("Ran out of room in address space")
cle.errors.CLEOperationError: Ran out of room in address space

Environment Information. angr 8.19.7.25 kali rolling x64

To Reproduce. Creating a simple corefile:

echo 0x7f > /proc/`pidof top`/coredump_filter
gdb --pid=`pidof top`
gef➤ generate-core-file top.core

Importing them into angr:

import angr
project = angr.Project('top.core', load_options={'main_opts': {'backend': 'elfcore'} } )

Btw in previous version of angr backend elfcore worked fine.

rhelmot commented 5 years ago

I would like to contest that this would have worked before. The problem is that cle will refuse to load anything below the main binary. This core maps up to the very top of the 64 bit address space, and the only-loads-above-main behavior has been here forever.

I don't have a good fix for this in the general case, but you can hack it yourself by adding or True to the check at the top of cle.Loader._find_safe_rebase_addr.

github-actions[bot] commented 2 years ago

This issue has been marked as stale because it has no recent activity. Please comment or add the pinned tag to prevent this issue from being closed.

github-actions[bot] commented 2 years ago

This issue has been closed due to inactivity.