phook is a userspace tool which injects code into an application to make it do whatever you want. It has a modular design to allow users use different plugins.
Default plugins are able to read and write into file descriptors belonging to another process.