angr / angr/cle

ELFParseError for Atmel and NXP binaries

Aperta
#513 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
question
Lingua principale
Python
Stelle
485
Fork
135
Merge medio
2g 2h
PR unite (30g)
15

Descrizione

### Description

I'm getting the following ElfParser error when opening these Atmel and NXP binaries in angr. I have not included all the files, just a sample set
[problematic_binaries.zip](https://github.com/user-attachments/files/17181659/problematic_binaries.zip)

```
File "cle\backends\elf\elf.py", line 393, in get_symbol
re_sym = symbol_table.get_symbol(symid)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "elftools\elf\sections.py", line 190, in get_symbol
entry = struct_parse(
^^^^^^^^^^^^^
File "elftools\common\utils.py", line 45, in struct_parse
raise ELFParseError(str(e))
elftools.common.exceptions.ELFParseError: expected 4, found 0
```
This seems to be similar to #116 but i'm fairly certain the binaries are not corrupted in this case.

Most of them are from the P2IM unit test repository https://github.com/RiS3-Lab/p2im-unit_tests/tree/cdfd9bbc72e1cc87a1f5d3905804ae1f91539beb

The STM binaries from the same work without an issue.

### Steps to reproduce the bug

I just load them into a regular angr project without any additional parameters

### Environment
```
angr environment report
=============================
Date: 2024-09-30 01:09:57.975707
!!! running in global environment. Are you sure? !!!
C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\angr\misc\bug_report.py:88: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources # pylint:disable=import-outside-toplevel
Platform: win-amd64
Python version: 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]
######## angr #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\angr\__init__.py
Pip version angr 9.2.86
Couldn't find git info
######## ailment #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\ailment\__init__.py
Pip version ailment 9.2.86
Couldn't find git info
######## cle #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\cle\__init__.py
Pip version cle 9.2.86
Couldn't find git info
######## pyvex #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyvex\__init__.py
Pip version pyvex 9.2.86
Couldn't find git info
######## claripy #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\claripy\__init__.py
Pip version claripy 9.2.86
Couldn't find git info
######## archinfo #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\archinfo\__init__.py
Pip version archinfo 9.2.86
Couldn't find git info
######## z3 #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\z3\__init__.py
Pip version z3-solver 4.10.2.0
Couldn't find git info
######## unicorn #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\unicorn\__init__.py
Pip version unicorn 2.0.1.post1
Couldn't find git info
######### Native Module Info ##########
angr:
unicorn:
pyvex: .FFILibrary object at 0x000001EC2B1211C0>
z3:
PS C:\Users\mschi\OneDrive\Desktop\masterarbeit\masterthesis-marco-schichtel> python -m angr.misc.bug_report
angr environment report
=============================
Date: 2024-09-30 01:13:37.649914
!!! running in global environment. Are you sure? !!!
C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\angr\misc\bug_report.py:88: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import pkg_resources # pylint:disable=import-outside-toplevel
Platform: win-amd64
Python version: 3.12.0 (tags/v3.12.0:0fb18b0, Oct 2 2023, 13:03:39) [MSC v.1935 64 bit (AMD64)]
######## angr #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\angr\__init__.py
Pip version angr 9.2.86
Couldn't find git info
######## ailment #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\ailment\__init__.py
Pip version ailment 9.2.86
Couldn't find git info
######## cle #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\cle\__init__.py
Pip version cle 9.2.86
Couldn't find git info
######## pyvex #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\pyvex\__init__.py
Pip version pyvex 9.2.86
Couldn't find git info
######## claripy #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\claripy\__init__.py
Pip version claripy 9.2.86
Couldn't find git info
######## archinfo #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\archinfo\__init__.py
Pip version archinfo 9.2.86
Couldn't find git info
######## z3 #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\z3\__init__.py
Pip version z3-solver 4.10.2.0
Couldn't find git info
######## unicorn #########
Python found it in C:\Users\mschi\AppData\Local\Programs\Python\Python312\Lib\site-packages\unicorn\__init__.py
Pip version unicorn 2.0.1.post1
Couldn't find git info
######### Native Module Info ##########
angr:
unicorn:
pyvex: .FFILibrary object at 0x000002350E214DD0>
z3:
```

### Additional context

_No response_

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.