|
-
December 20th, 2003, 11:25 PM
#1
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
-
December 21st, 2003, 12:01 AM
#2
Re: malloc, another implementation of
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....
-
December 21st, 2003, 08:20 AM
#3
Why can you not use it commercially?
-
December 21st, 2003, 08:25 AM
#4
Originally posted by scarleton
Why can you not use it commercially?
try reading the license agreements...or maybe I should try again...but I do recall (and we are talking a long time ago here) that it states that you cannot use it for commercial products....
-
December 21st, 2003, 09:07 AM
#5
Re: Re: malloc, another implementation of
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 Can you enlighten me as to where I can learn about these other interception techniques?
-
December 21st, 2003, 09:14 AM
#6
well I guess it starts with the question what is it that you seek to do? specifically???
technically speaking, you can modify the detours code and use it as your own...or is that legally speaking?
-
December 21st, 2003, 01:13 PM
#7
There are a number of things I want to do. But one thing is make a tool that will record and play back user's interaction with an application.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|