I wouldn't expect it to be possible, because if you want to read to stdin or read from stdout of an application, you need to have access to its streams and to do that you have to be in its process group (or something like that, don't remember the actual name), in the easiest case be its parent (process that calls execve to start the app can first dup2() its descriptors).
GDB somehow manages to attach to a running application, but I suspect it uses some special means to achieve that.
Edit: Of course it might be possible using some dedicated kernel module or something, but it's probably not what you are looking for.
Bookmarks