malloc, another implementation of
Folks,
I am using Microsoft's Detour Code.
If you are not familary with this code, it allow a DLL to hook into a process and detour any API calls. The idea is that you do as you please with the API call and then pass it onto the API and finally return to the caller.
All is well and good, but one must be careful in how one writes the detoured code. The biggest problem is making sure that the one does not detour the detouring code. The solution is to be very careful in the 3rd party code that is used, INCLUDING THE c runtime, like malloc! Malloc eventually calls the WinAPI function HeapAlloc().
I need to find an implementation of malloc that will allow me to modify it to call the real API funtions, not the detoured ones. Does anyone know where I can find such an open source code?
Sam
Re: malloc, another implementation of
Quote:
Originally posted by scarleton
Folks,
I am using Microsoft's
Detour Code.
If you are not familary with this code, it allow a DLL to hook into a process and detour any API calls. The idea is that you do as you please with the API call and then pass it onto the API and finally return to the caller.
All is well and good, but one must be careful in how one writes the detoured code. The biggest problem is making sure that the one does not detour the detouring code. The solution is to be very careful in the 3rd party code that is used, INCLUDING THE c runtime, like malloc! Malloc eventually calls the WinAPI function HeapAlloc().
I need to find an implementation of malloc that will allow me to modify it to call the real API funtions, not the detoured ones. Does anyone know where I can find such an open source code?
Sam
Can you provide an example on what exactly is the problem? if your look at the samples in the src there is already a hook for the malloc, and I do believe it calls the real malloc for the hook...so what is the issue? Most of us have used detours just as a passing fancy, since you cannot use it commercially...and we use other interception techniques...mostly kernel hooks since usermode is so..80's...to do what we need. You statement does not really make senes to me, but then I've never really look at detours other than as a party favor.... :p
Re: Re: malloc, another implementation of
Quote:
Originally posted by Mick ...and we use other interception techniques...mostly kernel hooks since usermode is so..80's...to do what we need.
Ok, I read the license agreements:D Can you enlighten me as to where I can learn about these other interception techniques?