Skip to content
forked from patha454/dpatch

Experimental dynamic patching tool based on `dlfcn`.

License

Notifications You must be signed in to change notification settings

dme-forks/dpatch

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

dpatch

(work in progress) Experimental dynamic patching system.

Quickstart

You'll need to build dpatch and a target program to get started.

The target program must have its symbols exported as dynamic symbols, which is a known limitation of dpatch. The dpatch repository comes with several demonstration programs pre-configured for building and using.

# Configure build scripts into `./build`.
$ cmake -B build .

# Build the configured targets in ./build`.
$ cmake --build build

# Run the newly-built `dpatch`.
$ ./build/dpatch ./build/test/hello_world
Hello, world!

# (Optional) Install `dpatch` onto your system.
$ cmake --build build -t install
$ dpatch /usr/local/dpatch/demo/hello_world
Hello, world!

Building, installing, and packaging

dpatch is built with CMake.

Building

The basic build commands are the standard CMake commands:

# Configure build scripts in `/build` for the platform default build tool.
# This will probably be UNIX Makefiles on most Linux systems.
$ cmake -B build

# Build all targets in `./build` using the platform-default build tools.
$ cmake --build build

At this point, you could run dpatch directly from the build output directory:

$ ./build/dpatch /path/to/target/program

Installing

CMake is configured with install targets for CMake.

You can install dpatch directly onto your system using $ cmake --build build -t install. Installing dpatch will allow you to run it directly from your system paths:

$ dpatch /path/to/target/program

Packaging

dpatch can be installed to a custom output directory to support self-packaging, or automatically packaged by CMake's cpack subsystem.

CPack

dpatch can generate its own packages using CMake's cpack system. CPack will generate a (not very) reasonable default package format for your platform. On Unix-style systems, this is likely to be a self extracting archive wrapped in a shell script.

Build a package by invoking:

$ cmake --build build -t package

You can change the package format by invoking cpack directly:

$ cpack --config build/CPackConfig.cmake -G <PackageGenerator>

View cpack --help for a list of package generator formats available for your platform.

Self-packaging

dpatch's install target respects the standard DESTDIR environment variable to install dpatch to a custom path. This can be used to generate binary packages as you see fit.

About

Experimental dynamic patching tool based on `dlfcn`.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 54.5%
  • CMake 45.5%