Read the Injection DLL Theory here: http://en.wikipedia.org/wiki/DLL_injection
However, I will put you a DLL injection fragment here: http://www.dreamincode.net/code/snippet407.htm
It is very easy to do these things, as soon as you are in the memory of an external application, after the injection you can also be part of the process.
There is something called a "workaround", which, I believe, is what you are looking for, it just hooks the function, and when this process calls it, it performs its own function. (To make sure it doesn't crash, call a function at the end of your function)
So, if you want to write your own function on CreateRegKeyEx
(http://msdn.microsoft.com/en-us/library/ms724844%28v=vs .85% 29.aspx)
It might look something like this:
LONG WINAPI myRegCreateKeyEx(HKEY hKey, LPCTSTR lpSubKey, DWORD Reserved, LPTSTR lpClass, DWORD dwOptions, REGSAM samDesired, LPSECURITY_ATTRIBUTES lpSecurityAttributes, PHKEY phkResult, LPDWORD lpdwDisposition) {
You can get a very well written crawl library called DetourXS here: http://www.gamedeception.net/threads/10649-DetourXS
Here is his sample code on how to set up a workaround using it:
And if you canβt say, this snippet connects to GetTickCount (), and whenever the function is called, it writes: "GetTickCount is connected!" - then it performs the function GetTickCount, it was intended.
Sorry for being so scattered with the information, but I hope this helps. :) - I understand that this is an old question. -