I\'m trying to figure out a way to globally override malloc and related functions in visual c++ (2005). My setup is a dll with statically linked runtime library that consist
A solution I have used is to rebuild the Visual C++ C runtime library (crt) from source code.
It can be found here in this folder:
C:\Program Files\Microsoft Visual Studio 9.0\VC\crt
Make sure you start up the Visual Studio command prompt to build it. Running nmake is enough to start it building although you might want to work out which target to build and this means you will have to understand the makefile.
It may take an effort to understand how to build the crt, but once you have it building you can add your own code into malloc, free and realloc, etc.
Unfortunately I have heard a rumour that we won't be able to build the crt from source code starting with Visual Studio 2010.