I have Program A, in which function Foo is implemented. Program A is able to load dll's dynamicly, durring runtime.
I'm currently writing Program B, which is compiled into a dll, so Program A is able to load it.
What I would like to do, is to "override" function Foo in Program B somehow, so when it is called from Program A, a different code is invoked from the one, that is implemented in Program A.
A found some referencing topic about trampuline functions: http://en.wikipedia.org/wiki/Trampoline_%28computers%29
My question is, is it possible? How?
Thanks, krisy
Edit: I have the source code of Program A, but I'm not allowed to modidy this. So redefining the structure of program A is out of the question :-(
Edit: I need a - preferably - open source, cross-platform solution (or at least needs to work under linux systems)