arwen: Cross-Platform Binary Patching Tool for Mach-O and ELF in Rust
Overview
arwen is a cross-platform Rust implementation that combines functionality similar to patchelf (Linux) and install_name_tool (macOS) into a single, versatile tool for binary manipulation.
Installation
You can install arwen using Cargo:
Usage
Mach-O Commands
RPath Operations
# Add an RPath
# Change an existing RPath
# Delete an RPath
Library Install Name and library id Operations
# Change library install name
# Change install ID of a shared library
ELF Commands
Interpreter Operations
# Set ELF interpreter
# Print current interpreter
ELF Header Operations
# Print OS ABI
# Set OS ABI
RPATH Operations
# Set RPATH
# Add RPATH
# Remove RPATH
# Print current RPATH
# Shrink RPATH with allowed prefixes
Dependency Management
# Add a needed library
# Remove a needed library
# Replace a needed library
# Print needed libraries
Executable Stack Control
# Check executable stack status
# Clear executable stack
# Set executable stack
Symbol and Soname Operations
# Print soname
# Set soname
# Clear symbol version
# Rename dynamic symbols (using a map file)
Post-Modification Considerations
Mach-O Re-signing (macOS)
After modifying a Mach-O binary, re-sign it:
Integration Tests
We have comprehensive integration tests to validate feature parity with install_name_tool and patchelf, ensuring correctness and reliability.
License
arwen is licensed under the MIT license.
Contributions
Contributions are welcome! Feel free to open issues or submit pull requests.
Status
arwen is currently in active development. The API and CLI are subject to change to improve user experience.
Funding
This project is funded through NGI0 Entrust, a fund established by NLnet with financial support from the European Commission's Next Generation Internet program.
Learn more at the NLnet project page.