If you dynamically link your program, you can easilly inject another library that overrides some functions and thus you gain complete access to your program from an "external" source.
Edit: how this is done on Windows, I don't know. On linux you use LD_PRELOAD to load your custom library first.
And, the work this takes, I guess you can also put it directly in your program without resulting to hacks.
Bookmarks