mirror of
https://github.com/angr/angr
synced 2026-08-17 12:23:11 -04:00
drop_bad_functions() exists to remove functions the linear scan decoded out of data. One of its tests deletes a function whose block ends in bytes the lifter could not decode, which is sound when the bytes are data and wrong when they are an instruction set VEX does not implement: glibc's EVEX string routines, the AVX-512 PLT resolvers, and MIPS III code in a 32-bit container all look like data from there. A function whose entry the file's own symbol table names is not something the scan invented, so skip it. Everything the file does not name is judged exactly as before. |
||
|---|---|---|
| .. | ||
| ailment | ||
| analyses | ||
| angrdb | ||
| engines | ||
| exploration_techniques | ||
| factory | ||
| gui | ||
| knowledge_plugins | ||
| llm | ||
| manual | ||
| mcp | ||
| misc | ||
| perf | ||
| procedures | ||
| regression | ||
| serialization | ||
| sim | ||
| simos | ||
| state_plugins | ||
| storage | ||
| types | ||
| utils | ||
| __init__.py | ||
| common.py | ||
| README.md | ||
| test_calling_conventions.py | ||
| test_cli.py | ||
| test_fuzzer.py | ||
| test_load_shellcode.py | ||
Tests
Running tests
These tests require the binaries repository, clone it in the folder where angr was cloned.
git clone https://github.com/angr/binaries
nose2 or pytest may be used to run tests.
Each tool can be installed with pip:
pip install nose2
pip install pytest
To run the tests with nose2, from the root of the repository, run:
nose2 -s tests
Or if using pytest, simply run:
pytest
Writing new tests
New tests should be written using unittest, part of Python's standard library. For more information about unittest, see https://docs.python.org/3/library/unittest.html. While we prefer nose2 and pytest for running tests, avoid using nose2 or pytest features in tests themselves, to avoid dependency on a specific runner.