bin2elf
Convert a raw binary blob (e.g., a firmware dump) into a minimal ARM ELF file with a chosen load address - handy for disassemblers, debuggers, and reverse-engineering tools that expect ELF.
macOS & Linux systems (Windows supported via WSL).
This package provides a single CLI command:
bin2elf
It wraps GNU binutils (arm-none-eabi-*) in a tiny pipeline that:
- wraps your raw bytes into a relocatable ELF,
- marks the bytes as executable code,
- links it at the address you provide, and
- strips symbols for a clean, minimal output.
Highlights
- 🔧 Choose endianness: little or big (
-EL/-EB). - 📍 Explicit base address: place
.textexactly at--load_addr(e.g.,0x08000000). - 🧰 Pure binutils under the hood: predictable and portable.
Requirements
-
Python = 3.7
-
GNU ARM Embedded binutils available on your
PATH:arm-none-eabi-ldarm-none-eabi-objcopyarm-none-eabi-strip
Tip: Package names you might look for on your OS:
- Debian/Ubuntu:
binutils-arm-none-eabi(or the fullgcc-arm-none-eabitoolchain)- Arch:
arm-none-eabi-binutils- macOS (Homebrew):
arm-none-eabi-binutils- Windows: use WSL or an ARM embedded toolchain (ensure
arm-none-eabi-*tools are inPATH).
Installation
pip install bin2elf
Usage
bin2elf <input.bin> <output.elf> <load_addr> [--endian little|big] [--prefix arm-none-eabi-]
Positional arguments
input– path to the raw binary file.output– desired ELF output path.load_addr– load address (e.g.,0x08000000; accepts0xhex or decimal).
Options
--endian {little,big}– important, target endianness (default:little).--prefix– toolchain prefix (default:arm-none-eabi-).
Examples
Little-endian blob at 0x08000000:
bin2elf firmware.bin firmware.elf 0x08000000
Big-endian blob at 0x00100000:
bin2elf image.bin image_be.elf 0x00100000 --endian big
Analyze the result:
arm-none-eabi-readelf -h -S -l firmware.elf
arm-none-eabi-objdump -D firmware.elf | less
Exit codes
0– success1– an external tool returned an error (you’ll see the message on stderr)
Security
This tool does not execute your binary; it just wraps bytes into an ELF container. Still, be mindful when opening unknown binaries in debuggers or emulators. Happy reversing! 🛠️📦
Tim Abdiukov
Release files for bin2elf 0.1.5
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| bin2elf-0.1.5.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bin2elf-0.1.5-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 18.6 kB
Release files / bin2elf-0.1.5.tar.gz
| Download URL | bin2elf-0.1.5.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
09ca16c335f86a7e3e902c8f16350757199ace73d9ed37e898d9763f9bdde055
|
|
BLAKE2b-256 checksum How to use checksums |
f0967524734dbd88e7c0c4f1b6fb5011fce6a47cd1886e90d2d9fcee9261ef18
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|
Release files / bin2elf-0.1.5-py3-none-any.whl
| Download URL | bin2elf-0.1.5-py3-none-any.whl |
|---|---|
| Size | 8.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
581ed82c93cfbc49c11ed87532e3912ebbd79ea6f28b620dbc64e0795ecb8fee
|
|
BLAKE2b-256 checksum How to use checksums |
33e98f2d5e2f2c67c1b94041f1ab1c5c52117e9d52188718df256b1d92716134
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.0
|