How do I intercept / redirect a function to a DLL (say CreateThread from Kernel32.dll) loaded into the current process?
(I have no control over which code fragments call CreateThread , so I don't like that I can just have code instead.)
Language doesn't really matter; I suggest that C / C ++ would be the best choice for this.
Update:
I forgot to mention: I'm not looking for solutions that require combining additional libraries into my program; I was looking for a manual way to intercept (for example, by rewriting the address of a function), and not to use an external library for this.
But thanks to those who mentioned the external library; Sorry, I have not said this before.
source share