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
Unfortunately I don't know enough about the microsoft linker. But ld has '--wrap' which you can use for anything like malloc or free or anything else (I do this).
all calls to malloc will be redirected to a function called __wrap_malloc which you have implemented, you can then call real malloc with __real_malloc. This has the benefit of capturing any mallocs used in external libraries too. I'm sure the Microsoft linker might have a similar function.