Skip to content

uriyay/elf-patcher

Repository files navigation

Preface
--------
elf-patcher is a multi-arch patcher, it uses binutils tools for building the hooks.
This tool will patch an elf by creating a hook on a specific instruction which jumps eventually to a code in c.
see examples/example.py and patcher.py for more details.

Files
-------
generate_lds.py:
generate ld script with symbols, and place where you want to patch

patcher.py:
an interface to patch

arch_<arch_name>.py:
every arch should inherit from Arch
the arch will be supported only if it has support in binutils
arch class should define these things:
-binutils_prefix - prefix to binutils tools (like '' for the default binutils and '/opt/arm-linux/bin/arm-linux-gnueabi-' for arm)
-get_branch(), get_nop(), get_call(), get_registers_dumper(), get_registers_loader()

Depends
-------
In order to run this tool you will need these things:
-pyelftools:
    in order to parse elf files.
    installation: pip install pyelftools

Problems
---------
Currently there is no support in:
1. calls and jumps instructions relocations, that means you cannot hook calls and jumps

About

A tool for multi-arch elf patcher

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published