Registry / devops / cle
library9.3.3pypypi✓ verified 23d ago

CLE (Common Library for Executables) is a Python library that loads binaries and their associated libraries, resolves imports, and provides an abstraction of process memory, mimicking how an operating system's loader would present them. It is a core component of the larger angr binary analysis framework. The current version is 9.2.209, and it maintains an active release cadence as part of the angr project.

pip install cle
INSTALL
IMPORT
SIG · CLE
C
cle
devopspythonv9.3.3
Install
5.9s avg
Import
1259ms
Disk
49MB
Pass rate
7/ 10
Env Coverage7 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v9.2.213 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
glibc
py 3.10
✕ build_error
✓ 7.5s
py 3.11
✕ build_error
✓ 6.7s
py 3.12
✓ —
✓ 5.5s
py 3.13
✓ —
✓ 5.5s
py 3.9
✕ build_error
✓ 4.5s
49MB installed
● package 49MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Loader
from cle import Loader
import cle
cle
import cle

This quickstart demonstrates how to load a binary file using `cle.Loader`, access its entry point, list its shared objects, and inspect an imported symbol. Replace `/bin/ls` with a path to an actual executable on your system for a functional example. Environment variable `CLE_BINARY_PATH` can be used to specify the binary.

import cle import os # For demonstration, use a common system binary like '/bin/ls' # On Windows, you might use a path to an executable like 'C:\Windows\System32\calc.exe' binary_path = os.environ.get('CLE_BINARY_PATH', '/bin/ls') try: ld = cle.Loader(binary_path) print(f"Loaded binary: {ld.main_object.binary_path}") print(f"Entry point: {hex(ld.main_object.entry)}") print("Shared objects:") for obj_name, obj_data in ld.shared_objects.items(): print(f" - {obj_name}: {obj_data}") # Example of accessing an import if '__libc_start_main' in ld.main_object.imports: libc_main_reloc = ld.main_object.imports['__libc_start_main'] print(f"Address of __libc_start_main GOT entry: {hex(libc_main_reloc.addr)}") except Exception as e: print(f"Error loading binary {binary_path}: {e}") print("Please ensure the binary exists and is a valid executable format for CLE.")
cle --version
Debug
Known issues
breakingWhen migrating from older versions of `cle` (prior to `angr 8`), Python 2 is no longer supported. All code must be migrated to Python 3.
fix
Upgrade your Python environment to 3.10+ and update your code to be Python 3 compliant. Review the `angr` migration guide for more details on changes in APIs like `Clemory`.
affects: < 8.x.x
breakingThe `Clemory` API (accessed via `project.loader.memory`) underwent significant refactoring with `angr 8`, specifically around replacing Python 2 string types with Python 3's `bytes`. Functions like `cbackers` and `read_bytes_c` are deprecated.
fix
Ensure all memory operations and data handling correctly use `bytes` objects. Avoid using `cbackers` and `read_bytes_c` as they are no longer recommended due to performance improvements making them unnecessary.
affects: All versions before angr 8 / cle 8
breakingSymbol types in CLE (e.g., accessed via `main_object.imports`) are now represented using Enums instead of potentially raw string or integer values, as introduced in `angr 8.19.7.25` (cle#177).
fix
Update code that inspects or compares symbol types to use the new Enum representations. Consult the `cle` API documentation for the specific Enum classes and members.
affects: < 8.19.7.25
gotchaBy default, `cle.Loader` attempts to automatically load shared libraries. If the `auto_load_libs` option is set to `False`, dependencies requested by loaded objects will not be resolved, potentially leading to incomplete memory maps or unresolved symbols.
fix
If `auto_load_libs` is `False`, explicitly specify required library paths using the `ld_path` option, or manually load them. Be aware of the implications for memory layout and symbol resolution.
affects: All versions
gotchaLoading certain binary formats (e.g., PE for Windows executables) requires optional Python packages like `pefile`. If these dependencies are not installed, `cle` may fail to load the binary or provide incomplete analysis without a clear error message indicating the missing package.
fix
Always install the relevant optional dependencies for the binary formats you intend to analyze. Check the `cle` documentation for specific backend requirements.
affects: All versions
Upgrade
Version history
9.3.3latest on PyPI · released Aug 19, 2026
Audit
Dependencies
pyvexrequiredUsed for lifting binary code to an intermediate representation (VEX), essential for deeper analysis.
pefileoptionalRequired for loading and parsing Microsoft Portable Executable (PE) binaries (e.g., Windows executables).
archinforequiredProvides architecture information necessary for binary analysis.
Agent activity
19 hits · last 30 days
node
16
Resources
cle — pip install cle · libregistry