Skip to main content

PatchMaker tool for applying source-code patches to binaries

Project description

OFRAK

OFRAK (Open Firmware Reverse Analysis Konsole) is a binary analysis and modification platform that combines the ability to unpack, analyze, modify, and repack binaries.

Package: ofrak_patch_maker

OFRAK
└───ofrak
└───ofrak_type
└───ofrak_io
└───ofrak_patch_maker  <-- //YOU ARE HERE//
│   └───binary_parser   // Interface and implementations for class parsing symbols & sections from a binary
│   └───toolchain       // Interface and implementations for build toolchains
│   └───model.py
│   └───patch_maker.py
└───ofrak_tutorial

This package contains the OFRAK PatchMaker, a powerful tool for applying source-code patches to binary files.

PatchMaker is a Python package for building code patch blobs from source and injecting them into an executable OFRAK resource. Once a patch is applied to a Resource, it may be re-packed with OFRAK the same way as if only a string modification were applied.

PatchMaker takes additional steps beyond the typical C software build process to ensure that new code and data, provided in C/asm source or binary form, land where they are supposed to and that linking against existing code and data in the target binary is easy.

Think of it as a way to compile custom code using the binary-under-analysis as a library. Normally a loader is responsible for mapping external symbols correctly into the loaded executable's memory space. With PatchMaker the process is inverted: once the patch is compiled, it can be injected into the host binary with the patch's external symbols correctly linked to the host's internal symbols, without involving a loader.

For more information, check the user guide in the OFRAK docs as well as the code references for PatchMaker and related classes.

Dependencies

This Python package only includes the Python code for the PatchMaker and does not include any of the toolchains which the PatchMaker utilizes! These would have to be installed individually and added to toolchain.conf, which is bundled with this package. An example of the toolchain.conf can be found here, and examples of how to install the toolchains can be found here.

Testing

This package maintains 100% test coverage of functions.

The tests for ofrak_patch_maker are not distributed with this package. If you wish to run the tests, download the OFRAK source code and install/run the tests from there.

License

The code in this repository comes with an OFRAK Community License, which is intended for educational uses, personal development, or just having fun.

Users interested in using OFRAK for commercial purposes can request the Pro or Enterprise License. See OFRAK Licensing for more information.

Documentation

OFRAK has general documentation and API documentation, which can be viewed at https://ofrak.com/docs.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ofrak_patch_maker-4.0.2.tar.gz (36.6 kB view hashes)

Uploaded Source

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page